-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: lib/open_weather/version.rb open_weather.gemspec
- Loading branch information
Showing
10 changed files
with
119 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### CONTRIBUTORS | ||
|
||
[Harisankar P S](https://github.com/coderhs) | ||
|
||
[Deepak Kumar](https://github.com/42races) | ||
|
||
[Daniel Nitsikopoulos](https://github.com/dNitza) | ||
|
||
[Yone Lacort Collado](https://github.com/yonelacort) | ||
|
||
[iamdeuterium](https://github.com/iamdeuterium) | ||
|
||
[ssendev](https://github.com/ssendev) | ||
|
||
[Nithin Bekal](https://github.com/nithinbekal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
module OpenWeather | ||
$LOAD_PATH<< "../lib" | ||
$LOAD_PATH<< '../lib' | ||
|
||
autoload :Base, "open_weather/base" | ||
autoload :Current, "open_weather/current" | ||
autoload :Forecast, "open_weather/forecast" | ||
autoload :ForecastDaily, "open_weather/forecast_daily" | ||
autoload :VERSION, "open_weather/version" | ||
autoload :Base, 'open_weather/base' | ||
autoload :Current, 'open_weather/current' | ||
autoload :Forecast, 'open_weather/forecast' | ||
autoload :ForecastDaily, 'open_weather/forecast_daily' | ||
autoload :VERSION, 'open_weather/version' | ||
|
||
require "open_weather/api.rb" | ||
require 'open_weather/api.rb' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module OpenWeather | ||
class Current < Base | ||
def initialize(options = {}) | ||
super("http://api.openweathermap.org/data/2.5/weather", options) | ||
super('http://api.openweathermap.org/data/2.5/weather', options) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module OpenWeather | ||
VERSION = "0.11.0" | ||
VERSION = '0.11.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
$:.push File.expand_path("../lib", __FILE__) | ||
$:.push File.expand_path('../lib', __FILE__) | ||
require 'open_weather/version' | ||
|
||
Gem::Specification.new do |gem| | ||
gem.name = "open-weather" | ||
gem.name = 'open-weather' | ||
gem.version = OpenWeather::VERSION | ||
gem.authors = ["HsPS [email protected]", "Deepak [email protected]"] | ||
gem.authors = ['HsPS [email protected]', 'Deepak [email protected]'] | ||
gem.email = ['[email protected]'] | ||
gem.homepage = "https://github.com/coderhs/ruby_open_weather_map" | ||
gem.homepage = 'https://github.com/coderhs/ruby_open_weather_map' | ||
gem.summary = %q{ A ruby wrapper for Open Weather Map API. } | ||
gem.description = %q{ A ruby wrapper for Open Weather Map API. } | ||
gem.files = `git ls-files`.split("\n") | ||
gem.test_files = gem.files.grep(/^(spec|test|features)/) | ||
gem.executables = gem.files.grep(/^bin/).map{ |f| File.basename(f) } | ||
gem.require_paths = ["lib"] | ||
gem.add_development_dependency "rspec" | ||
gem.add_development_dependency "vcr" | ||
gem.add_development_dependency "webmock" | ||
gem.add_runtime_dependency 'json' | ||
gem.require_paths = ['lib'] | ||
gem.add_development_dependency 'rspec' | ||
gem.add_development_dependency 'vcr' | ||
gem.add_development_dependency 'webmock' | ||
gem.add_runtime_dependency 'json' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
describe "Current weather information with APPID" do | ||
describe 'Current weather information with APPID' do | ||
let(:options) do | ||
{ units: "metric", APPID: 1111111111 } | ||
{ units: 'metric', APPID: 1111111111 } | ||
end | ||
|
||
describe "searching by city" do | ||
context "when the city is found" do | ||
describe 'searching by city' do | ||
context 'when the city is found' do | ||
let(:weather) do | ||
VCR.use_cassette("integration/current_by_city") do | ||
OpenWeather::Current.city("Berlin, DE", options) | ||
VCR.use_cassette('integration/current_by_city') do | ||
OpenWeather::Current.city('Berlin, DE', options) | ||
end | ||
end | ||
|
||
it "returns results" do | ||
expect(weather).to include("weather") | ||
it 'returns results' do | ||
expect(weather).to include('weather') | ||
end | ||
end | ||
|
||
context "when the city is not found" do | ||
context 'when the city is not found' do | ||
let(:weather) do | ||
VCR.use_cassette("integration/current_not_found_city") do | ||
OpenWeather::Current.city("Berlin, DE", options) | ||
VCR.use_cassette('integration/current_not_found_city') do | ||
OpenWeather::Current.city('Berlin, DE', options) | ||
end | ||
end | ||
|
||
it "returns an attribute with code 404" do | ||
expect(weather["cod"]).to eq("404") | ||
it 'returns an attribute with code 404' do | ||
expect(weather['cod']).to eq('404') | ||
end | ||
end | ||
end | ||
|
||
describe "searching by geolocation" do | ||
describe 'searching by geolocation' do | ||
let(:weather) do | ||
VCR.use_cassette("integration/current_by_geocode") do | ||
VCR.use_cassette('integration/current_by_geocode') do | ||
OpenWeather::Current.geocode(48.140938, 11.582005, options) | ||
end | ||
end | ||
|
||
it "returns results" do | ||
expect(weather).to include("weather") | ||
it 'returns results' do | ||
expect(weather).to include('weather') | ||
end | ||
end | ||
|
||
describe "searching by city_id" do | ||
describe 'searching by city_id' do | ||
let(:weather) do | ||
VCR.use_cassette("integration/current_by_city_id") do | ||
VCR.use_cassette('integration/current_by_city_id') do | ||
OpenWeather::Current.city_id(524901, options) | ||
end | ||
end | ||
|
||
it "returns results" do | ||
expect(weather).to include("weather") | ||
it 'returns results' do | ||
expect(weather).to include('weather') | ||
end | ||
end | ||
end |
Oops, something went wrong.