windward 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/README.md +24 -2
- data/lib/windward/version.rb +1 -1
- data/lib/windward.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73c11bb209042c5b7ef0033b0eef1c4708ea3fb0
|
4
|
+
data.tar.gz: 8c8c99ce99477fcad60cb8c5a4b334638c3df9f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61721fcd570194c9ca5202f05a28b6971799a729bec348e3e5ea146c164e7f51338d167249bec3ff52c20266bea7bd6b9349e588e438b5e34e59b754452aa3cb
|
7
|
+
data.tar.gz: 384bd1748dbd650fa8acd2dae36a0d0500befdb1cb963d3e6a8591ef9ec9cd3ae623944301f0245e8ca25652c0edda823c82b0872a30afac71359e497b75b5d8
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Windward
|
2
2
|
|
3
|
-
|
3
|
+
Windward is a parser for http://meteofrance.com/accueil
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,29 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
### Instantiate a Weather object
|
22
|
+
When a Weather object is instantiate, a request is sent to meteofrance.com and weather informations are stored.
|
23
|
+
|
24
|
+
require 'windward'
|
25
|
+
weather = Windward::Weather.new
|
26
|
+
|
27
|
+
### Reload Weather informations
|
28
|
+
|
29
|
+
weather.reload
|
30
|
+
|
31
|
+
### List availables regions
|
32
|
+
|
33
|
+
weather.regions
|
34
|
+
|
35
|
+
### Get actual weather for a specific region
|
36
|
+
|
37
|
+
weather.previsions("Alsace")
|
38
|
+
=> {"Rhin (Bas)"=>{"temps"=>"Pluies éparses", "temper"=>"5"}}
|
39
|
+
|
40
|
+
This method returns a Hash with weather informations for each department of specified region.
|
41
|
+
Some regions have 3 departments like "Provence-Alpes-Côte d'Azur".
|
42
|
+
|
43
|
+
###
|
22
44
|
|
23
45
|
## Contributing
|
24
46
|
|
data/lib/windward/version.rb
CHANGED
data/lib/windward.rb
CHANGED
@@ -9,7 +9,7 @@ module Windward
|
|
9
9
|
@departments = departments
|
10
10
|
@regions = load_data
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def regions
|
14
14
|
@regions.keys
|
15
15
|
end
|
@@ -26,9 +26,14 @@ module Windward
|
|
26
26
|
@regions = load_data
|
27
27
|
end
|
28
28
|
|
29
|
+
def self.root
|
30
|
+
File.expand_path('../..',__FILE__)
|
31
|
+
end
|
32
|
+
|
29
33
|
private
|
34
|
+
|
30
35
|
def departments
|
31
|
-
doc = Nokogiri::XML(open("
|
36
|
+
doc = Nokogiri::XML(open(File.join Weather.root, "lib/data/regions.xml"))
|
32
37
|
provinces = doc.root.xpath("province")
|
33
38
|
departments = Hash.new
|
34
39
|
provinces.each do |p|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windward
|
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
|
- Yann VERY
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|