-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
37 changed files
with
306 additions
and
316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ruby: | ||
config_file: .rubocop.yml |
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,17 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.4 | ||
|
||
Metrics/LineLength: | ||
Max: 80 | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false # Using Ruby 2.4 doesn't need it | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: single_quotes | ||
SupportedStyles: | ||
- single_quotes | ||
- double_quotes |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
require "bundler/gem_tasks" | ||
require 'bundler/gem_tasks' | ||
|
||
desc 'Default: run specs.' | ||
task :default => :spec | ||
task default: :spec | ||
|
||
require 'rspec/core/rake_task' | ||
|
||
desc "Run specs" | ||
desc 'Run specs' | ||
RSpec::Core::RakeTask.new do |t| | ||
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default. | ||
t.pattern = './spec/**/*_spec.rb' # don't need this, it's default. | ||
# Put spec opts in a file named .rspec in root | ||
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 @@ | ||
bundle exec rubocop --only Layout lib spec && bundle exec rspec |
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
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,8 +1,5 @@ | ||
class Class | ||
|
||
def downcase_symbol | ||
self.to_s.downcase.to_sym | ||
to_s.downcase.to_sym | ||
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
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
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,34 +1,29 @@ | ||
class Hash | ||
|
||
unless self.method_defined?(:extract!) | ||
#Imported from Rails 3 | ||
unless method_defined?(:extract!) | ||
# Imported from Rails 3 | ||
def extract!(*keys) | ||
result = {} | ||
keys.each { |key| result[key] = delete(key) } | ||
result | ||
end | ||
end | ||
|
||
|
||
def map_key_value(key_method, value_method = nil) | ||
value_method ||= key_method | ||
each.with_object({}) do |(k,v), new_hash| | ||
each.with_object({}) do |(k, v), new_hash| | ||
new_hash[k.send(key_method)] = v.send(value_method) | ||
end | ||
end | ||
|
||
|
||
def map_key(method) | ||
each.with_object({}) do |(k,v), new_hash| | ||
each.with_object({}) do |(k, v), new_hash| | ||
new_hash[k.send(method)] = v | ||
end | ||
end | ||
|
||
|
||
def map_value(method) | ||
each.with_object({}) do |(k,v), new_hash| | ||
each.with_object({}) do |(k, v), new_hash| | ||
new_hash[k] = v.send(method) | ||
end | ||
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
module Kernel | ||
|
||
def require_dirs(dirs) | ||
Array.wrap(dirs).each do |load_path| | ||
Dir.glob("#{load_path}/**/*.rb").each do |file| | ||
require file | ||
end | ||
end | ||
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
class Numeric | ||
|
||
def to_bool | ||
!zero? | ||
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
Oops, something went wrong.