Skip to content

Commit

Permalink
Fix RuboCop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Feb 3, 2014
1 parent 6b577ee commit 3292f60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
23 changes: 10 additions & 13 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,20 @@ ParameterLists:

MethodLength:
CountComments: false
Max: 15
Max: 5

# Avoid more than `Max` levels of nesting.
BlockNesting:
Max: 3
Max: 2

# Align with the style guide.
CollectionMethods:
PreferredMethods:
collect: 'map'
inject: 'reduce'
map: 'collect'
reduce: 'inject'
find: 'detect'
find_all: 'select'

# Do not force public/protected/private keyword to be indented at the same
# level as the def keyword. My personal preference is to outdent these keywords
# because I think when scanning code it makes it easier to identify the
# sections of code and visually separate them. When the keyword is at the same
# level I think it sort of blends in with the def keywords and makes it harder
# to scan the code and see where the sections are.
AccessModifierIndentation:
Enabled: false

# Limit line length
LineLength:
Enabled: false
Expand Down Expand Up @@ -76,3 +67,9 @@ CaseIndentation:

Lambda:
Enabled: false

RaiseArgs:
EnforcedStyle: compact

TrailingComma:
Enabled: false
3 changes: 1 addition & 2 deletions lib/gems/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ def options

# Reset all configuration options to defaults
def reset
self.username, self.password = nil, nil
self.host = DEFAULT_HOST
self.key = DEFAULT_KEY
self.password = nil
self.user_agent = DEFAULT_USER_AGENT
self.username = nil
self
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/gems/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def request(method, path, data, content_type, request_host = host) # rubocop:dis
end

def hash_to_query_string(hash)
hash.keys.reduce('') do |query_string, key|
hash.keys.inject('') do |query_string, key|
query_string << '&' unless key == hash.keys.first
query_string << "#{URI.encode(key.to_s)}=#{URI.encode(hash[key])}"
end
Expand Down

0 comments on commit 3292f60

Please sign in to comment.