clima_tempo 1.0 → 1.01

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ clima_tempo (1.0)
5
+ nokogiri (>= 1.5.6)
6
+ rest-client (>= 1.6.7)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ fakeweb (1.3.0)
12
+ mime-types (1.19)
13
+ nokogiri (1.5.6)
14
+ rest-client (1.6.7)
15
+ mime-types (>= 1.16)
16
+
17
+ PLATFORMS
18
+ ruby
19
+
20
+ DEPENDENCIES
21
+ clima_tempo!
22
+ fakeweb (>= 1.3)
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # ClimaTempo
2
+
3
+ Get brazilian weather values of the ClimaTempo.
4
+
5
+ ## Installation
6
+
7
+ ~~~.ruby
8
+ gem install clima_tempo
9
+ ~~~
10
+
11
+ ## Usage
12
+
13
+ ~~~.ruby
14
+ require "rubygems"
15
+ require "clima_tempo"
16
+
17
+ climatempo = ClimaTempo.new :code => 558
18
+
19
+ climatempo.now[:temperature]
20
+ #=> 25ºC
21
+
22
+ climatempo.now[:pressure]
23
+ #=> 1010 hPa
24
+
25
+ climatempo.now[:humidity]
26
+ #=> 50%
27
+ ~~~
28
+
29
+ ## Maintainer
30
+
31
+ * Rogério Zambon (http://rogeriozambon.com)
32
+
33
+ ## License
34
+
35
+ (The MIT License)
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
40
+
41
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0
1
+ 1.01
data/clima_tempo.gemspec CHANGED
@@ -1,22 +1,21 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
+ s.name = "clima_tempo"
3
4
  s.authors = ["Rogério Zambon"]
4
- s.date = "2013-01-22"
5
+ s.email = ["rogeriozambon@gmail.com"]
6
+ s.date = "2013-02-01"
5
7
  s.description = "Get brazilian weather values of the ClimaTempo"
6
- s.email = "rogeriozambon@gmail.com"
8
+ s.homepage = "http://github.com/rogeriozambon/clima_tempo"
9
+
7
10
  s.add_dependency "rest-client", ">= 1.6.7"
8
11
  s.add_dependency "nokogiri", ">= 1.5.6"
9
- s.files = [
10
- "lib/clima_tempo.rb",
11
- "spec/clima_tempo_spec.rb",
12
- "spec/fixture/sao_paulo.html",
13
- "VERSION",
14
- "clima_tempo.gemspec"
15
- ]
16
- s.homepage = "http://github.com/rogeriozambon/clima_tempo"
17
- s.name = "clima_tempo"
12
+ s.add_development_dependency "fakeweb", ">= 1.3"
13
+
14
+ s.files = `git ls-files`.split("\n")
18
15
  s.require_paths = ["lib"]
16
+
19
17
  s.required_rubygems_version = Gem::Requirement.new(">= 1.8.23")
20
18
  s.summary = s.description
21
- s.version = "1.0"
19
+
20
+ s.version = "1.01"
22
21
  end
data/lib/clima_tempo.rb CHANGED
@@ -30,6 +30,7 @@ class ClimaTempo
30
30
 
31
31
  private
32
32
  def request_page
33
+ RestClient.proxy = ENV["http_proxy"]
33
34
  request = RestClient.get "http://www.climatempo.com.br/previsao-do-tempo/cidade/#{@code}/empty"
34
35
 
35
36
  Nokogiri::HTML request.body
@@ -1,4 +1,5 @@
1
1
  require_relative "../lib/clima_tempo"
2
+ require "fakeweb"
2
3
 
3
4
  describe ClimaTempo do
4
5
  it "missing parameters" do
@@ -8,10 +9,9 @@ describe ClimaTempo do
8
9
  context "Values up to this moment" do
9
10
  before do
10
11
  fixture = File.open("spec/fixture/sao_paulo.html").read
11
- parser = Nokogiri::HTML fixture
12
+ FakeWeb.register_uri(:any, "http://www.climatempo.com.br/previsao-do-tempo/cidade/558/empty", :body => fixture)
12
13
 
13
14
  @climatempo = ClimaTempo.new :code => 558
14
- @climatempo.stub(:request_page).and_return parser
15
15
  end
16
16
 
17
17
  it "check object types" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clima_tempo
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.01'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2013-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -43,17 +43,37 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.5.6
46
+ - !ruby/object:Gem::Dependency
47
+ name: fakeweb
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '1.3'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
46
62
  description: Get brazilian weather values of the ClimaTempo
47
- email: rogeriozambon@gmail.com
63
+ email:
64
+ - rogeriozambon@gmail.com
48
65
  executables: []
49
66
  extensions: []
50
67
  extra_rdoc_files: []
51
68
  files:
69
+ - Gemfile
70
+ - Gemfile.lock
71
+ - README.md
72
+ - VERSION
73
+ - clima_tempo.gemspec
52
74
  - lib/clima_tempo.rb
53
75
  - spec/clima_tempo_spec.rb
54
76
  - spec/fixture/sao_paulo.html
55
- - VERSION
56
- - clima_tempo.gemspec
57
77
  homepage: http://github.com/rogeriozambon/clima_tempo
58
78
  licenses: []
59
79
  post_install_message: