Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,13 @@ Style/NumericLiterals:
Style/ObjectThen:
Enabled: true

# Extensions to other Ruby libraries purposefully declare
# multiple classes.
Style/OneClassPerFile:
Exclude:
- lib/git/*
- lib/vanagon/extensions/**/*

Style/OneLineConditional:
Enabled: true

Expand Down
2 changes: 1 addition & 1 deletion lib/vanagon/component/rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def component_rule
# Generate a Makefile fragment that contains all of the rules for the component.
# @return [String]
def format
rules.map(&:to_s).join("\n")
rules.join("\n")
end

alias to_s format
Expand Down
4 changes: 2 additions & 2 deletions lib/vanagon/extensions/hashable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module HashableAttributes
# @return [Hash] Converts an object to a hash with keys representing
# each attribute (as symbols) and their corresponding values
def to_hash
instance_variables.each_with_object({}) do |var, hash|
hash[var.to_s.delete("@")] = instance_variable_get(var)
instance_variables.to_h do |var|
[var.to_s.delete("@"), instance_variable_get(var)]
end
end
alias_method :to_h, :to_hash
Expand Down
Loading