windward 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2619e972b9300dd1d0a78bef8b617bf2f26fdd67
4
- data.tar.gz: edb5a1d087e9a62c160f250b29469ddbdda1347e
3
+ metadata.gz: 73c11bb209042c5b7ef0033b0eef1c4708ea3fb0
4
+ data.tar.gz: 8c8c99ce99477fcad60cb8c5a4b334638c3df9f0
5
5
  SHA512:
6
- metadata.gz: 90efbbc1120980c592790eb0bd32b2c5cbf1838f7fdebdcac99cb091531b3ae5b49275a1ee1e43f63e13b867f0c9d51823afae5268a54642f0278682bdd0fbfd
7
- data.tar.gz: a5e3ce1235cc3423141a7523e522f034bcb3b6dea8fd2f2cf683afe5606924c76fe8b8cef2d9751174ee5ec175edd5e24d61cbc921e72ec30707297c594fb8ba
6
+ metadata.gz: 61721fcd570194c9ca5202f05a28b6971799a729bec348e3e5ea146c164e7f51338d167249bec3ff52c20266bea7bd6b9349e588e438b5e34e59b754452aa3cb
7
+ data.tar.gz: 384bd1748dbd650fa8acd2dae36a0d0500befdb1cb963d3e6a8591ef9ec9cd3ae623944301f0245e8ca25652c0edda823c82b0872a30afac71359e497b75b5d8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Windward
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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
 
@@ -1,3 +1,3 @@
1
1
  module Windward
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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("./lib/data/regions.xml"))
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.1
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-23 00:00:00.000000000 Z
11
+ date: 2013-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler