Skip to content

Commit

Permalink
Fix rubocop style violations
Browse files Browse the repository at this point in the history
  • Loading branch information
grobie committed Feb 14, 2017
1 parent b7d966c commit 47424d1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ Style/TrailingCommaInLiteral:

Metrics/AbcSize:
Max: 18

Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def ruby_version?(constraint)
end

group :test do
gem 'json', '< 2.0' if ruby_version?('< 2.0')
gem 'coveralls'
gem 'json', '< 2.0' if ruby_version?('< 2.0')
gem 'rack', '< 2.0' if ruby_version?('< 2.2.2')
gem 'rack-test'
gem 'rake'
Expand Down
6 changes: 3 additions & 3 deletions lib/prometheus/client/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def delete
def parse(url)
uri = URI.parse(url)

if uri.scheme == 'http'
uri
else
if uri.scheme != 'http'
raise ArgumentError, 'only HTTP gateway URLs are supported currently.'
end

uri
rescue URI::InvalidURIError => e
raise ArgumentError, "#{url} is not a valid URL: #{e}"
end
Expand Down
3 changes: 1 addition & 2 deletions lib/prometheus/client/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ def register(metric)
@mutex.synchronize do
if exist?(name.to_sym)
raise AlreadyRegisteredError, "#{name} has already been registered"
else
@metrics[name.to_sym] = metric
end
@metrics[name.to_sym] = metric
end

metric
Expand Down

0 comments on commit 47424d1

Please sign in to comment.