-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e4ae8a
commit 2aa71c9
Showing
12 changed files
with
311 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,50 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-12-01 17:39:10 UTC using RuboCop version 1.69.0. | ||
# on 2024-12-05 02:17:24 UTC using RuboCop version 1.69.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. | ||
Metrics/AbcSize: | ||
Max: 24 | ||
|
||
# Offense count: 5 | ||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
# AllowedMethods: refine | ||
Metrics/BlockLength: | ||
Max: 161 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments, CountAsOne. | ||
Metrics/ClassLength: | ||
Max: 120 | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: EnforcedStyle, AllowedPatterns. | ||
# SupportedStyles: snake_case, camelCase | ||
Naming/MethodName: | ||
Exclude: | ||
- 'lib/advent_04_ceres_search.rb' | ||
- 'test.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. | ||
# SupportedStyles: snake_case, normalcase, non_integer | ||
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 | ||
Naming/VariableNumber: | ||
Exclude: | ||
- 'lib/advent_04_ceres_search.rb' | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: AllowedConstants. | ||
Style/Documentation: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' | ||
- 'lib/advent_01_hystorian_hysteria.rb' | ||
- 'lib/advent_02_red_nosed_reports.rb' | ||
- 'lib/advent_03_mull_it_over.rb' | ||
- 'lib/advent_04_ceres_search.rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# frozen_string_literal: true | ||
|
||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
## Uncomment and set this to only include directories you want to watch | ||
# directories %w(app lib config test spec features) \ | ||
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")} | ||
|
||
## Note: if you are using the `directories` clause above and you are not | ||
## watching the project directory ('.'), then you will want to move | ||
## the Guardfile to a watched dir and symlink it back, e.g. | ||
# | ||
# $ mkdir config | ||
# $ mv Guardfile config/ | ||
# $ ln -s config/Guardfile . | ||
# | ||
# and, you'll have to watch "config/Guardfile" instead of "Guardfile" | ||
|
||
# NOTE: The cmd option is now required due to the increasing number of ways | ||
# rspec may be run, below are examples of the most common uses. | ||
# * bundler: 'bundle exec rspec' | ||
# * bundler binstubs: 'bin/rspec' | ||
# * spring: 'bin/rspec' (This will use spring if running and you have | ||
# installed the spring binstubs per the docs) | ||
# * zeus: 'zeus rspec' (requires the server to be started separately) | ||
# * 'just' rspec: 'rspec' | ||
|
||
guard :rspec, cmd: 'bundle exec rspec' do | ||
require 'guard/rspec/dsl' | ||
dsl = Guard::RSpec::Dsl.new(self) | ||
|
||
# Feel free to open issues for suggestions and improvements | ||
|
||
# RSpec files | ||
rspec = dsl.rspec | ||
watch(rspec.spec_helper) { rspec.spec_dir } | ||
watch(rspec.spec_support) { rspec.spec_dir } | ||
watch(rspec.spec_files) | ||
|
||
# Ruby files | ||
ruby = dsl.ruby | ||
dsl.watch_spec_files_for(ruby.lib_files) | ||
|
||
# Rails files | ||
rails = dsl.rails(view_extensions: %w[erb haml slim]) | ||
dsl.watch_spec_files_for(rails.app_files) | ||
dsl.watch_spec_files_for(rails.views) | ||
|
||
watch(rails.controllers) do |m| | ||
[ | ||
rspec.spec.call("routing/#{m[1]}_routing"), | ||
rspec.spec.call("controllers/#{m[1]}_controller"), | ||
rspec.spec.call("acceptance/#{m[1]}") | ||
] | ||
end | ||
|
||
# Rails config changes | ||
watch(rails.spec_helper) { rspec.spec_dir } | ||
watch(rails.routes) { "#{rspec.spec_dir}/routing" } | ||
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" } | ||
|
||
# Capybara features specs | ||
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") } | ||
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") } | ||
|
||
# Turnip features and steps | ||
watch(%r{^spec/acceptance/(.+)\.feature$}) | ||
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m| | ||
Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'fileutils' | ||
|
||
def next_advent_number | ||
latest = Dir['./lib/advent*.rb'].map { |p| p.match(/\d{2}/)&.[](0)&.to_i }.compact.max || 0 | ||
latest + 1 | ||
end | ||
|
||
desc 'create class and spec file for DAY' | ||
task :new do | ||
day = ENV['DAY'].nil? ? next_advent_number : ENV['DAY'].to_i | ||
|
||
raise 'invalid DAY' unless day.between?(1, 31) | ||
|
||
formatted_day = day.to_s.rjust(2, '0') | ||
|
||
FileUtils.touch("./lib/advent_#{formatted_day}.rb") | ||
FileUtils.touch("./spec/advent_#{formatted_day}_spec.rb") | ||
FileUtils.touch("./spec/fixtures/advent-#{formatted_day}.txt") | ||
FileUtils.touch("./spec/fixtures/advent-#{formatted_day}-sample.txt") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.