rubillow 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -0
- data/Gemfile.lock +2 -7
- data/README.md +5 -0
- data/lib/rubillow.rb +2 -0
- data/lib/rubillow/models/updated_property_details.rb +1 -0
- data/lib/rubillow/property_details.rb +2 -2
- data/lib/rubillow/version.rb +1 -1
- data/rubillow.gemspec +1 -2
- data/spec/rubillow/home_valuation_spec.rb +4 -4
- data/spec/rubillow/mortgage_spec.rb +2 -2
- data/spec/rubillow/neighborhood_spec.rb +3 -3
- data/spec/rubillow/postings_spec.rb +1 -1
- data/spec/rubillow/property_details_spec.rb +3 -3
- data/spec/rubillow/request_spec.rb +10 -7
- data/spec/spec_helper.rb +0 -5
- metadata +25 -29
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubillow (0.0.
|
4
|
+
rubillow (0.0.3)
|
5
5
|
nokogiri (~> 1.5.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
10
|
bluecloth (2.1.0)
|
11
|
-
bourne (1.0)
|
12
|
-
mocha (= 0.9.8)
|
13
11
|
diff-lcs (1.1.2)
|
14
|
-
mocha (0.9.8)
|
15
|
-
rake
|
16
12
|
nokogiri (1.5.0)
|
17
13
|
rake (0.9.2)
|
18
14
|
rcov (0.9.10)
|
@@ -31,8 +27,7 @@ PLATFORMS
|
|
31
27
|
|
32
28
|
DEPENDENCIES
|
33
29
|
bluecloth (>= 2.1.0)
|
34
|
-
|
35
|
-
mocha (~> 0.9.8)
|
30
|
+
rake (~> 0.9.2)
|
36
31
|
rcov (~> 0.9.10)
|
37
32
|
rspec (~> 2.6)
|
38
33
|
rubillow!
|
data/README.md
CHANGED
@@ -59,6 +59,11 @@ You should find the documentation for your version of Rubillow on [Rubygems](htt
|
|
59
59
|
* [Rubygems](http://rubygems.org/gems/rubillow)
|
60
60
|
* [Issues](http://github.com/synewaves/rubillow/issues)
|
61
61
|
|
62
|
+
# Build & Dependency Status
|
63
|
+
|
64
|
+
[![Build Status](http://travis-ci.org/synewaves/rubillow.png)](http://travis-ci.org/synewaves/rubillow)
|
65
|
+
[![Dependency Status](https://gemnasium.com/synewaves/rubillow.png?travis)](https://gemnasium.com/synewaves/rubillow)
|
66
|
+
|
62
67
|
# License
|
63
68
|
|
64
69
|
Rubillow uses the MIT license. See LICENSE for more details.
|
data/lib/rubillow.rb
CHANGED
@@ -101,7 +101,7 @@ module Rubillow
|
|
101
101
|
raise ArgumentError, "The zpid option is required"
|
102
102
|
end
|
103
103
|
|
104
|
-
Models::UpdatedPropertyDetails.new(Rubillow::Request.get("
|
104
|
+
Models::UpdatedPropertyDetails.new(Rubillow::Request.get("GetUpdatedPropertyDetails", options))
|
105
105
|
end
|
106
106
|
end
|
107
|
-
end
|
107
|
+
end
|
data/lib/rubillow/version.rb
CHANGED
data/rubillow.gemspec
CHANGED
@@ -18,9 +18,8 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
+
s.add_development_dependency "rake", "~> 0.9.2"
|
21
22
|
s.add_development_dependency "rspec", "~> 2.6"
|
22
|
-
s.add_development_dependency "mocha", "~> 0.9.8"
|
23
|
-
s.add_development_dependency "bourne", "~> 1.0"
|
24
23
|
s.add_development_dependency "yard", ">= 0.6.8"
|
25
24
|
s.add_development_dependency "bluecloth", ">= 2.1.0"
|
26
25
|
s.add_development_dependency "rcov", "~> 0.9.10"
|
@@ -17,7 +17,7 @@ describe Rubillow::HomeValuation, ".search_results" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "fetches the XML" do
|
20
|
-
Rubillow::Request.
|
20
|
+
Rubillow::Request.stub(:request).and_return(request)
|
21
21
|
|
22
22
|
response = Rubillow::HomeValuation.search_results({ :address => '2114 Bigelow Ave', :citystatezip => 'Seattle, WA' })
|
23
23
|
response.should be_an_instance_of(Rubillow::Models::SearchResult)
|
@@ -35,7 +35,7 @@ describe Rubillow::HomeValuation, ".zestimate" do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it "fetches the XML" do
|
38
|
-
Rubillow::Request.
|
38
|
+
Rubillow::Request.stub(:request).and_return(request)
|
39
39
|
|
40
40
|
response = Rubillow::HomeValuation.zestimate({ :zpid => '48749425' })
|
41
41
|
response.should be_an_instance_of(Rubillow::Models::SearchResult)
|
@@ -59,7 +59,7 @@ describe Rubillow::HomeValuation, ".chart" do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "fetches the XML" do
|
62
|
-
Rubillow::Request.
|
62
|
+
Rubillow::Request.stub(:request).and_return(request)
|
63
63
|
|
64
64
|
response = Rubillow::HomeValuation.chart({ :zpid => '48749425', :unit_type => "percent" })
|
65
65
|
response.should be_an_instance_of(Rubillow::Models::PropertyChart)
|
@@ -83,7 +83,7 @@ describe Rubillow::HomeValuation, ".comps" do
|
|
83
83
|
end
|
84
84
|
|
85
85
|
it "fetches the XML" do
|
86
|
-
Rubillow::Request.
|
86
|
+
Rubillow::Request.stub(:request).and_return(request)
|
87
87
|
|
88
88
|
response = Rubillow::HomeValuation.comps({ :zpid => '48749425', :count => 5 })
|
89
89
|
response.should be_an_instance_of(Rubillow::Models::Comps)
|
@@ -5,7 +5,7 @@ describe Rubillow::Mortgage, ".rate_summary" do
|
|
5
5
|
let(:response) { stub("Response", :body => "", :code => 200) }
|
6
6
|
|
7
7
|
it "fetches the XML" do
|
8
|
-
Rubillow::Request.
|
8
|
+
Rubillow::Request.stub(:request).and_return(request)
|
9
9
|
|
10
10
|
response = Rubillow::Mortgage.rate_summary()
|
11
11
|
response.should be_an_instance_of(Rubillow::Models::RateSummary)
|
@@ -29,7 +29,7 @@ describe Rubillow::Mortgage, ".monthly_payments" do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "fetches the XML" do
|
32
|
-
Rubillow::Request.
|
32
|
+
Rubillow::Request.stub(:request).and_return(request)
|
33
33
|
|
34
34
|
response = Rubillow::Mortgage.monthly_payments({ :price => "300000", :down => "15", :zip => "98104" })
|
35
35
|
response.should be_an_instance_of(Rubillow::Models::MonthlyPayments)
|
@@ -11,7 +11,7 @@ describe Rubillow::Neighborhood, ".demographics" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "fetches the XML" do
|
14
|
-
Rubillow::Request.
|
14
|
+
Rubillow::Request.stub(:request).and_return(request)
|
15
15
|
|
16
16
|
response = Rubillow::Neighborhood.demographics({ :state => 'WA', :city => 'Seattle', :neighborhood => 'Ballard' })
|
17
17
|
response.should be_an_instance_of(Rubillow::Models::Demographics)
|
@@ -29,7 +29,7 @@ describe Rubillow::Neighborhood, ".region_children" do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "fetches the XML" do
|
32
|
-
Rubillow::Request.
|
32
|
+
Rubillow::Request.stub(:request).and_return(request)
|
33
33
|
|
34
34
|
response = Rubillow::Neighborhood.region_children({ :state => 'WA', :city => 'Seattle', :childtype => 'neighborhood' })
|
35
35
|
response.should be_an_instance_of(Rubillow::Models::RegionChildren)
|
@@ -47,7 +47,7 @@ describe Rubillow::Neighborhood, ".region_chart" do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "fetches the XML" do
|
50
|
-
Rubillow::Request.
|
50
|
+
Rubillow::Request.stub(:request).and_return(request)
|
51
51
|
|
52
52
|
response = Rubillow::Neighborhood.region_chart({ :city => 'Seattle', :state => 'WA', :unit_type => 'percent', :width => 300, :height => 150 })
|
53
53
|
response.should be_an_instance_of(Rubillow::Models::RegionChart)
|
@@ -11,7 +11,7 @@ describe Rubillow::Postings, ".region_postings" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "fetches the XML" do
|
14
|
-
Rubillow::Request.
|
14
|
+
Rubillow::Request.stub(:request).and_return(request)
|
15
15
|
|
16
16
|
response = Rubillow::Postings.region_postings({ :zipcode => "98102", :rental => true })
|
17
17
|
response.should be_an_instance_of(Rubillow::Models::Postings)
|
@@ -17,7 +17,7 @@ describe Rubillow::PropertyDetails, ".deep_search_results" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "fetches the XML" do
|
20
|
-
Rubillow::Request.
|
20
|
+
Rubillow::Request.stub(:request).and_return(request)
|
21
21
|
|
22
22
|
response = Rubillow::PropertyDetails.deep_search_results({ :address => '2114 Bigelow Ave', :citystatezip => 'Seattle, WA' })
|
23
23
|
response.should be_an_instance_of(Rubillow::Models::DeepSearchResult)
|
@@ -41,7 +41,7 @@ describe Rubillow::PropertyDetails, ".deep_comps" do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "fetches the XML" do
|
44
|
-
Rubillow::Request.
|
44
|
+
Rubillow::Request.stub(:request).and_return(request)
|
45
45
|
|
46
46
|
response = Rubillow::PropertyDetails.deep_comps({ :zpid => '48749425', :count => 5 })
|
47
47
|
response.should be_an_instance_of(Rubillow::Models::DeepComps)
|
@@ -59,7 +59,7 @@ describe Rubillow::PropertyDetails, ".updated_property_details" do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "fetches the XML" do
|
62
|
-
Rubillow::Request.
|
62
|
+
Rubillow::Request.stub(:request).and_return(request)
|
63
63
|
|
64
64
|
response = Rubillow::PropertyDetails.updated_property_details({ :zpid => '48749425' })
|
65
65
|
response.should be_an_instance_of(Rubillow::Models::UpdatedPropertyDetails)
|
@@ -6,30 +6,33 @@ describe Rubillow::Request, ".get" do
|
|
6
6
|
let(:zwsid) { "xyz123-oo" }
|
7
7
|
|
8
8
|
before do
|
9
|
-
Rubillow::Request.
|
10
|
-
Rubillow::Request.
|
9
|
+
Rubillow::Request.stub(:uri).and_return("/")
|
10
|
+
Rubillow::Request.stub(:request).and_return(request)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "constructs the request URI" do
|
14
|
+
Rubillow::Request.should_receive(:uri).with("/", :option => 1)
|
14
15
|
Rubillow::Request.get("/", :option => 1)
|
15
|
-
Rubillow::Request.should have_received(:uri).with("/", :option => 1)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "includes access key when configured" do
|
19
|
+
Rubillow::Request.should_receive(:uri).with("/", :zws_id => zwsid)
|
20
|
+
|
19
21
|
Rubillow.configuration.zwsid = zwsid
|
20
22
|
Rubillow::Request.get("/")
|
21
|
-
Rubillow::Request.should have_received(:uri).with("/", :zws_id => zwsid)
|
22
23
|
end
|
23
24
|
|
24
25
|
it "allows overriding of configured access key" do
|
26
|
+
Rubillow::Request.should_receive(:uri).with("/", :zws_id => "abc890_11")
|
27
|
+
|
25
28
|
Rubillow.configuration.zwsid = zwsid
|
26
29
|
Rubillow::Request.get("/", :zws_id => "abc890_11")
|
27
|
-
Rubillow::Request.should have_received(:uri).with("/", :zws_id => "abc890_11")
|
28
30
|
end
|
29
31
|
|
30
32
|
it "makes an API request" do
|
33
|
+
request.should_receive(:get).with("/")
|
34
|
+
|
31
35
|
Rubillow::Request.get("/")
|
32
|
-
request.should have_received(:get).with("/")
|
33
36
|
end
|
34
37
|
|
35
38
|
it "returns the XML for a successful response" do
|
@@ -37,7 +40,7 @@ describe Rubillow::Request, ".get" do
|
|
37
40
|
end
|
38
41
|
|
39
42
|
it "returns false for any response code other than 200" do
|
40
|
-
response.
|
43
|
+
response.stub(:code => "401")
|
41
44
|
Rubillow::Request.get("/").should == false
|
42
45
|
end
|
43
46
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,10 @@
|
|
1
1
|
require File.expand_path("../../lib/rubillow", __FILE__)
|
2
2
|
require 'rspec'
|
3
|
-
require "bourne"
|
4
3
|
|
5
4
|
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each do |file|
|
6
5
|
require file
|
7
6
|
end
|
8
7
|
|
9
|
-
RSpec.configure do |config|
|
10
|
-
config.mock_with :mocha
|
11
|
-
end
|
12
|
-
|
13
8
|
def get_xml(file)
|
14
9
|
File.open(File.expand_path("../xml/" + file, __FILE__)).read
|
15
10
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubillow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,44 +9,33 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: rake
|
16
|
+
requirement: &70335938496480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.9.2
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70335938496480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.9.8
|
33
|
-
type: :development
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70188860390000
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: bourne
|
38
|
-
requirement: &70188860389320 !ruby/object:Gem::Requirement
|
26
|
+
name: rspec
|
27
|
+
requirement: &70335938494960 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
29
|
requirements:
|
41
30
|
- - ~>
|
42
31
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
32
|
+
version: '2.6'
|
44
33
|
type: :development
|
45
34
|
prerelease: false
|
46
|
-
version_requirements: *
|
35
|
+
version_requirements: *70335938494960
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: yard
|
49
|
-
requirement: &
|
38
|
+
requirement: &70335938493020 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
40
|
requirements:
|
52
41
|
- - ! '>='
|
@@ -54,10 +43,10 @@ dependencies:
|
|
54
43
|
version: 0.6.8
|
55
44
|
type: :development
|
56
45
|
prerelease: false
|
57
|
-
version_requirements: *
|
46
|
+
version_requirements: *70335938493020
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: bluecloth
|
60
|
-
requirement: &
|
49
|
+
requirement: &70335938514740 !ruby/object:Gem::Requirement
|
61
50
|
none: false
|
62
51
|
requirements:
|
63
52
|
- - ! '>='
|
@@ -65,10 +54,10 @@ dependencies:
|
|
65
54
|
version: 2.1.0
|
66
55
|
type: :development
|
67
56
|
prerelease: false
|
68
|
-
version_requirements: *
|
57
|
+
version_requirements: *70335938514740
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
59
|
name: rcov
|
71
|
-
requirement: &
|
60
|
+
requirement: &70335938513780 !ruby/object:Gem::Requirement
|
72
61
|
none: false
|
73
62
|
requirements:
|
74
63
|
- - ~>
|
@@ -76,10 +65,10 @@ dependencies:
|
|
76
65
|
version: 0.9.10
|
77
66
|
type: :development
|
78
67
|
prerelease: false
|
79
|
-
version_requirements: *
|
68
|
+
version_requirements: *70335938513780
|
80
69
|
- !ruby/object:Gem::Dependency
|
81
70
|
name: nokogiri
|
82
|
-
requirement: &
|
71
|
+
requirement: &70335938512480 !ruby/object:Gem::Requirement
|
83
72
|
none: false
|
84
73
|
requirements:
|
85
74
|
- - ~>
|
@@ -87,7 +76,7 @@ dependencies:
|
|
87
76
|
version: 1.5.0
|
88
77
|
type: :runtime
|
89
78
|
prerelease: false
|
90
|
-
version_requirements: *
|
79
|
+
version_requirements: *70335938512480
|
91
80
|
description: Ruby library to access the Zillow API
|
92
81
|
email:
|
93
82
|
- rubillow@matthewvince.com
|
@@ -97,6 +86,7 @@ extra_rdoc_files: []
|
|
97
86
|
files:
|
98
87
|
- .gitignore
|
99
88
|
- .rspec
|
89
|
+
- .travis.yml
|
100
90
|
- .yardopts
|
101
91
|
- Gemfile
|
102
92
|
- Gemfile.lock
|
@@ -187,12 +177,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
177
|
- - ! '>='
|
188
178
|
- !ruby/object:Gem::Version
|
189
179
|
version: '0'
|
180
|
+
segments:
|
181
|
+
- 0
|
182
|
+
hash: 1608190687670668257
|
190
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
184
|
none: false
|
192
185
|
requirements:
|
193
186
|
- - ! '>='
|
194
187
|
- !ruby/object:Gem::Version
|
195
188
|
version: '0'
|
189
|
+
segments:
|
190
|
+
- 0
|
191
|
+
hash: 1608190687670668257
|
196
192
|
requirements: []
|
197
193
|
rubyforge_project: rubillow
|
198
194
|
rubygems_version: 1.8.10
|