Skip to content

Commit

Permalink
Revert "Rubocop autocorrections"
Browse files Browse the repository at this point in the history
This reverts commit 6a044fc.
  • Loading branch information
troya2 committed Jul 3, 2024
1 parent 05eedf0 commit 90f6e1f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/open_weather/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def connection

options[:headers]['User-Agent'] = user_agent if user_agent
options[:proxy] = proxy if proxy
options[:ssl] = { ca_path:, ca_file: } if ca_path || ca_file
options[:ssl] = { ca_path: ca_path, ca_file: ca_file } if ca_path || ca_file

request_options = {}
request_options[:timeout] = timeout if timeout
Expand Down
8 changes: 4 additions & 4 deletions lib/open_weather/endpoints/current.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ module OpenWeather
module Endpoints
module Current
def current_zip(code, country = nil, options = {})
options = code.is_a?(Hash) ? options.merge(code) : options.merge(zip: code, country:)
options = code.is_a?(Hash) ? options.merge(code) : options.merge(zip: code, country: country)
current_weather(options)
end

def current_geo(lat, lon = nil, options = {})
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat:, lon:)
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
current_weather(options)
end

def current_city(name, state = nil, country = nil, options = {})
options = name.is_a?(Hash) ? options.merge(name) : options.merge(city: name, state:, country:)
options = name.is_a?(Hash) ? options.merge(name) : options.merge(city: name, state: state, country: country)
current_weather(options)
end

def current_city_id(id, options = {})
options = id.is_a?(Hash) ? options.merge(id) : options.merge(id:)
options = id.is_a?(Hash) ? options.merge(id) : options.merge(id: id)
current_weather(options)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/open_weather/endpoints/hourly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module Hourly
def hourly(lat, lon = nil, options = {})
# default to the pro endpoint if not specified
endpoint = options.delete(:endpoint) || pro_endpoint
options = options.merge(endpoint:)
options = options.merge(endpoint: endpoint)

options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat:, lon:)
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
OpenWeather::Models::Forecast::Hourly.new(get('2.5/forecast/hourly', options), options)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/open_weather/endpoints/one_call.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module OpenWeather
module Endpoints
module OneCall
def one_call(lat, lon = nil, options = {})
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat:, lon:)
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
options[:exclude] = options[:exclude].join(',') if options[:exclude].is_a?(Array)
options[:dt] = options[:dt].to_i if options[:dt].is_a?(Time)
path = options.key?(:dt) ? '3.0/onecall/timemachine' : '3.0/onecall'
Expand Down
2 changes: 1 addition & 1 deletion lib/open_weather/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def on_complete(env)
when 407
# mimic the behavior that we get with proxy requests with HTTPS
raise Faraday::ConnectionFailed, %(407 "Proxy Authentication Required ")
when (400...600)
when (400...600).freeze
raise OpenWeather::Errors::Fault, response_values(env)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/open_weather/models/station_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
.with(id)
.and_call_original

model = OpenWeather::Models::Station.new(id:)
model = OpenWeather::Models::Station.new(id: id)
result = model.delete!
expect(result).to be_nil
end
Expand Down

0 comments on commit 90f6e1f

Please sign in to comment.