OpenWeather 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/OpenWeather.gemspec +0 -1
- data/lib/OpenWeather.rb +8 -0
- data/lib/OpenWeather/forecast.rb +3 -1
- data/lib/OpenWeather/version.rb +1 -1
- data/lib/OpenWeather/weather.rb +3 -1
- data/tests/weather_spec.rb +2 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37aaafc5556bcb8258e0936268287d575f32d5f1
|
4
|
+
data.tar.gz: db9ffc7eed78c33a3568d316d2975ea096bb1a44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b4fca983b1c0eefcb187d580c27dca43e4bb151df4c900879a84e121acba49339b8fd349753c1b772829651d8cd7d90aacfa3031262ca5cc56d6c058c4999be
|
7
|
+
data.tar.gz: feb52c16f4e56c1f4d9c9d468aae97245f3be8a0b83e929a90689b54bd2069219d913119f1c9ed1567198947ba23c0c058167278d023ef4b8f28f267665e51e1
|
data/OpenWeather.gemspec
CHANGED
data/lib/OpenWeather.rb
CHANGED
data/lib/OpenWeather/forecast.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module OpenWeather
|
2
2
|
module Forecast
|
3
3
|
def forecast_raw(city)
|
4
|
-
|
4
|
+
@city_file.nil? ?
|
5
|
+
get('/forecast', query: {q: city, units: @units_format, mode: @data_format}) :
|
6
|
+
JSON.parse(File.read(@city_file))
|
5
7
|
end
|
6
8
|
|
7
9
|
def forecast_tomorrow_min(city)
|
data/lib/OpenWeather/version.rb
CHANGED
data/lib/OpenWeather/weather.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
module OpenWeather
|
2
2
|
module Weather
|
3
3
|
def weather_raw(city)
|
4
|
-
|
4
|
+
@city_file.nil? ?
|
5
|
+
get('/weather', query: {q: city, units: @units_format, mode: @data_format}) :
|
6
|
+
JSON.parse(File.read(@city_file))
|
5
7
|
end
|
6
8
|
|
7
9
|
def weather_min(city)
|
data/tests/weather_spec.rb
CHANGED
@@ -7,8 +7,8 @@ describe "Fetch Weather" do
|
|
7
7
|
it "should get proper coordinates" do
|
8
8
|
owc = OpenWeather::Client.new
|
9
9
|
weather = owc.weather_raw "Montreal"
|
10
|
-
weather['coord']['lon'].should == -73.
|
11
|
-
weather['coord']['lat'].should == 45.
|
10
|
+
weather['coord']['lon'].should == -73.59
|
11
|
+
weather['coord']['lat'].should == 45.51
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should return unknown city" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: OpenWeather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris911
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: json
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '>='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '>='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
69
|
description: Ruby wrapper for Open Weather Map - http://openweathermap.org/
|
84
70
|
email:
|
85
71
|
- Christophe.naud.dulude@gmail.com
|