Skip to content

Commit 40aa1bd

Browse files
authored
Merge pull request #82 from Sharpie/fix-rubocop-lint
Fix Rubocop lint
2 parents d65cca4 + ab6d8e9 commit 40aa1bd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.rubocop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,13 @@ Style/NumericLiterals:
666666
Style/ObjectThen:
667667
Enabled: true
668668

669+
# Extensions to other Ruby libraries purposefully declare
670+
# multiple classes.
671+
Style/OneClassPerFile:
672+
Exclude:
673+
- lib/git/*
674+
- lib/vanagon/extensions/**/*
675+
669676
Style/OneLineConditional:
670677
Enabled: true
671678

lib/vanagon/component/rules.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def component_rule
225225
# Generate a Makefile fragment that contains all of the rules for the component.
226226
# @return [String]
227227
def format
228-
rules.map(&:to_s).join("\n")
228+
rules.join("\n")
229229
end
230230

231231
alias to_s format

lib/vanagon/extensions/hashable.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ module HashableAttributes
77
# @return [Hash] Converts an object to a hash with keys representing
88
# each attribute (as symbols) and their corresponding values
99
def to_hash
10-
instance_variables.each_with_object({}) do |var, hash|
11-
hash[var.to_s.delete("@")] = instance_variable_get(var)
10+
instance_variables.to_h do |var|
11+
[var.to_s.delete("@"), instance_variable_get(var)]
1212
end
1313
end
1414
alias_method :to_h, :to_hash

0 commit comments

Comments
 (0)