-
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
31 changed files
with
201 additions
and
188 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,21 @@ | ||
inherit_gem: | ||
rubocop-rails: | ||
- config/rails.yml | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.4 | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
Enabled: false | ||
|
||
Layout/IndentationWidth: | ||
IgnoredPatterns: ['^\s*private$'] | ||
|
||
Style/BracesAroundHashParameters: | ||
Enabled: false | ||
|
||
Metrics/LineLength: | ||
Max: 100 |
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
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 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ def self.safe_name(name) | |
gsub(/\-+/, '-') # limit - character to once | ||
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
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
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,45 +1,43 @@ | ||
class Array | ||
|
||
def convert | ||
self | ||
end | ||
class Array | ||
def convert | ||
self | ||
end | ||
|
||
def convert_keys_recursively(&converter) | ||
map { |v| v.convert_keys_recursively(&converter) } | ||
end | ||
|
||
def convert_values_recursively(&converter) | ||
map { |v| v.convert_values_recursively(&converter) } | ||
end | ||
|
||
def symbolize_keys_recursively | ||
map(&:symbolize_keys_recursively) | ||
end | ||
|
||
def stringify_values_recursively | ||
map(&:stringify_values_recursively) | ||
end | ||
|
||
def make_indifferent_access_recursively | ||
map(&:make_indifferent_access_recursively) | ||
end | ||
|
||
def recursive_blank? | ||
each do |v| | ||
if v.respond_to?(:recursive_blank?) | ||
return false unless v.recursive_blank? | ||
else | ||
return false unless v.blank? | ||
end | ||
end | ||
true | ||
end | ||
|
||
def recursively(&block) | ||
each do |element| | ||
block.call(element) | ||
element.recursively(&block) if element.respond_to?(:recursively) | ||
end | ||
end | ||
|
||
end | ||
def convert_keys_recursively(&converter) | ||
map { |v| v.convert_keys_recursively(&converter) } | ||
end | ||
|
||
def convert_values_recursively(&converter) | ||
map { |v| v.convert_values_recursively(&converter) } | ||
end | ||
|
||
def symbolize_keys_recursively | ||
map(&:symbolize_keys_recursively) | ||
end | ||
|
||
def stringify_values_recursively | ||
map(&:stringify_values_recursively) | ||
end | ||
|
||
def make_indifferent_access_recursively | ||
map(&:make_indifferent_access_recursively) | ||
end | ||
|
||
def recursive_blank? | ||
each do |v| | ||
if v.respond_to?(:recursive_blank?) | ||
return false unless v.recursive_blank? | ||
else | ||
return false unless v.blank? | ||
end | ||
end | ||
true | ||
end | ||
|
||
def recursively(&block) | ||
each do |element| | ||
block.call(element) | ||
element.recursively(&block) if element.respond_to?(:recursively) | ||
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,8 +1,5 @@ | ||
class Date | ||
|
||
def stringify_values_recursively | ||
self.to_s | ||
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,8 +1,5 @@ | ||
class DateTime | ||
|
||
def stringify_values_recursively | ||
self.to_s | ||
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 Fixnum | ||
|
||
def stringify_values_recursively | ||
to_s | ||
end | ||
|
||
end |
Oops, something went wrong.