sjain-redfin_api 0.1.1 → 0.1.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.
data/Manifest CHANGED
@@ -1,16 +1,16 @@
1
- Rakefile
2
- tasks/redfin.rake
3
- redfin_api.gemspec
4
- README.rdoc
5
1
  Manifest
6
- lib/redfin_api/base.rb
7
- lib/redfin_api.rb
2
+ README.rdoc
3
+ Rakefile
4
+ VERSION.yml
8
5
  lib/object.rb
9
- test/test_helper.rb
6
+ lib/redfin_api.rb
7
+ lib/redfin_api/base.rb
8
+ redfin_api.gemspec
9
+ tasks/redfin.rake
10
+ test/data/gis_id_search.json
10
11
  test/data/property_page.html
11
12
  test/data/query_location_listings.json
12
- test/data/gis_id_search.json
13
13
  test/data/query_location_pastSalesBuildings.json
14
+ test/test_helper.rb
14
15
  test/test_redfin_api.rb
15
16
  test/test_redfin_base.rb
16
- VERSION.yml
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
3
2
  :major: 0
4
3
  :minor: 1
4
+ :patch: 2
@@ -60,7 +60,7 @@ module RedfinApi
60
60
  hash
61
61
  end
62
62
  def construct_redfin_url_from_address(location)
63
- "http://www.redfin.com/#{location[:state]}/#{location[:city]}/#{location[:number]}-#{location[:street_name]}-#{location[:street_type]}-#{location[:zip]}/home/#{location[:property_id]}"
63
+ "http://www.redfin.com/#{location[:state]}/#{location[:city].gsub(' ','-')}/#{location[:number]}-#{location[:street_name].gsub(' ','-')}-#{location[:street_type]}-#{location[:zip]}/home/#{location[:property_id]}"
64
64
  end
65
65
  def gis_id_search(listing_id)
66
66
  url ="http://www.redfin.com/stingray/do/gis-id-search?listing_id=#{listing_id}"
data/redfin_api.gemspec CHANGED
@@ -1,15 +1,16 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  Gem::Specification.new do |s|
3
4
  s.name = %q{redfin_api}
4
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
5
6
 
6
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
7
8
  s.authors = ["Sharad Jain"]
8
- s.date = %q{2009-08-08}
9
+ s.date = %q{2009-09-16}
9
10
  s.description = %q{Redfin.com webservice interface}
10
11
  s.email = %q{shaanjain@gmail.com}
11
- s.extra_rdoc_files = ["tasks/redfin.rake", "README.rdoc", "lib/redfin_api/base.rb", "lib/redfin_api.rb", "lib/object.rb"]
12
- s.files = ["Rakefile", "tasks/redfin.rake", "redfin_api.gemspec", "README.rdoc", "Manifest", "lib/redfin_api/base.rb", "lib/redfin_api.rb", "lib/object.rb", "test/test_helper.rb", "test/data/property_page.html", "test/data/query_location_listings.json", "test/data/gis_id_search.json", "test/data/query_location_pastSalesBuildings.json", "test/test_redfin_api.rb", "test/test_redfin_base.rb", "VERSION.yml"]
12
+ s.extra_rdoc_files = ["README.rdoc", "lib/object.rb", "lib/redfin_api.rb", "lib/redfin_api/base.rb", "tasks/redfin.rake"]
13
+ s.files = ["Manifest", "README.rdoc", "Rakefile", "VERSION.yml", "lib/object.rb", "lib/redfin_api.rb", "lib/redfin_api/base.rb", "redfin_api.gemspec", "tasks/redfin.rake", "test/data/gis_id_search.json", "test/data/property_page.html", "test/data/query_location_listings.json", "test/data/query_location_pastSalesBuildings.json", "test/test_helper.rb", "test/test_redfin_api.rb", "test/test_redfin_base.rb"]
13
14
  s.has_rdoc = true
14
15
  s.homepage = %q{http://github.com/sjain/redfin_api}
15
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Redfin_api", "--main", "README.rdoc"]
@@ -77,4 +77,20 @@ class TestRedfinApiBase < Test::Unit::TestCase
77
77
  assert_equal("http://www.redfin.com/IL/Schaumburg/1930-Keystone-Pl-60193/unit-A/home/21620838", resp[:url])
78
78
  end
79
79
  end
80
+ context "with location hash containing address information" do
81
+ setup do
82
+ @location = {
83
+ :state => "IL",
84
+ :city => "Hoffman Estates",
85
+ :number => "123",
86
+ :street_name => "Popular Creek",
87
+ :street_type => "Dr",
88
+ :zip => "12345",
89
+ :property_id => "1239812"
90
+ }
91
+ end
92
+ should "generate proper redfin url by replacing spaces with dashes in address components" do
93
+ assert_equal("http://www.redfin.com/IL/Hoffman-Estates/123-Popular-Creek-Dr-12345/home/1239812", RedfinApi::Base.construct_redfin_url_from_address(@location))
94
+ end
95
+ end
80
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sjain-redfin_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharad Jain
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-08 00:00:00 -07:00
12
+ date: 2009-09-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -20,28 +20,28 @@ executables: []
20
20
  extensions: []
21
21
 
22
22
  extra_rdoc_files:
23
- - tasks/redfin.rake
24
23
  - README.rdoc
25
- - lib/redfin_api/base.rb
26
- - lib/redfin_api.rb
27
24
  - lib/object.rb
28
- files:
29
- - Rakefile
25
+ - lib/redfin_api.rb
26
+ - lib/redfin_api/base.rb
30
27
  - tasks/redfin.rake
31
- - redfin_api.gemspec
32
- - README.rdoc
28
+ files:
33
29
  - Manifest
34
- - lib/redfin_api/base.rb
35
- - lib/redfin_api.rb
30
+ - README.rdoc
31
+ - Rakefile
32
+ - VERSION.yml
36
33
  - lib/object.rb
37
- - test/test_helper.rb
34
+ - lib/redfin_api.rb
35
+ - lib/redfin_api/base.rb
36
+ - redfin_api.gemspec
37
+ - tasks/redfin.rake
38
+ - test/data/gis_id_search.json
38
39
  - test/data/property_page.html
39
40
  - test/data/query_location_listings.json
40
- - test/data/gis_id_search.json
41
41
  - test/data/query_location_pastSalesBuildings.json
42
+ - test/test_helper.rb
42
43
  - test/test_redfin_api.rb
43
44
  - test/test_redfin_base.rb
44
- - VERSION.yml
45
45
  has_rdoc: true
46
46
  homepage: http://github.com/sjain/redfin_api
47
47
  licenses: