mls 0.2.29 → 0.2.31

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mls.rb CHANGED
@@ -23,7 +23,7 @@ class MLS
23
23
 
24
24
  API_VERSION = '0.1.0'
25
25
 
26
- attr_reader :url
26
+ attr_reader :url, :user_agent
27
27
  attr_writer :asset_host, :listing_amenities, :address_amenities
28
28
  attr_accessor :api_key, :auth_key, :logger
29
29
 
@@ -36,6 +36,12 @@ class MLS
36
36
  @api_key = CGI.unescape(@url.user)
37
37
  @host, @port = @url.host, @url.port
38
38
  end
39
+
40
+ # Sets the user agent so that MLS can distinguish between multiple users
41
+ # with the same auth
42
+ def user_agent=(user_agent)
43
+ @user_agent = user_agent
44
+ end
39
45
 
40
46
  def logger # TODO: testme
41
47
  @logger ||= default_logger
@@ -66,6 +72,7 @@ class MLS
66
72
  def headers # TODO: testme
67
73
  h = {
68
74
  'Content-Type' => 'application/json',
75
+ 'User-Agent' => @user_agent,
69
76
  'X-42Floors-API-Version' => API_VERSION,
70
77
  'X-42Floors-API-Key' => api_key
71
78
  }
@@ -217,12 +217,12 @@ class MLS::Listing < MLS::Resource
217
217
 
218
218
  def find(id)
219
219
  response = MLS.get("/listings/#{id}")
220
- puts response.body
221
220
  MLS::Listing::Parser.parse(response.body)
222
221
  end
223
222
 
224
- def all(filters = {}, limit = nil, order = 'listings.id')
225
- response = MLS.get('/listings', :filters => filters, :limit => limit, :order => order)
223
+ # currently supported options are filters, page, per_page, offset, order
224
+ def all(options={})
225
+ response = MLS.get('/listings', options)
226
226
  MLS::Listing::Parser.parse_collection(response.body)
227
227
  end
228
228
 
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mls"
6
- s.version = '0.2.29'
6
+ s.version = '0.2.31'
7
7
  s.authors = ["James R. Bracy", "Jon Bracy"]
8
8
  s.email = ["james@42floors.com"]
9
9
  s.homepage = "http://mls.42floors.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.29
4
+ version: 0.2.31
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-12 00:00:00.000000000 Z
13
+ date: 2013-02-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: !ruby/object:Gem::Requirement
17
+ requirement: &70316573365380 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,15 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
30
- version: '0'
25
+ version_requirements: *70316573365380
31
26
  - !ruby/object:Gem::Dependency
32
27
  name: rdoc
33
- requirement: !ruby/object:Gem::Requirement
28
+ requirement: &70316573364660 !ruby/object:Gem::Requirement
34
29
  none: false
35
30
  requirements:
36
31
  - - ! '>='
@@ -38,15 +33,10 @@ dependencies:
38
33
  version: '0'
39
34
  type: :development
40
35
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
36
+ version_requirements: *70316573364660
47
37
  - !ruby/object:Gem::Dependency
48
38
  name: bundler
49
- requirement: !ruby/object:Gem::Requirement
39
+ requirement: &70316573364240 !ruby/object:Gem::Requirement
50
40
  none: false
51
41
  requirements:
52
42
  - - ! '>='
@@ -54,15 +44,10 @@ dependencies:
54
44
  version: '0'
55
45
  type: :development
56
46
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
47
+ version_requirements: *70316573364240
63
48
  - !ruby/object:Gem::Dependency
64
49
  name: minitest
65
- requirement: !ruby/object:Gem::Requirement
50
+ requirement: &70316573363800 !ruby/object:Gem::Requirement
66
51
  none: false
67
52
  requirements:
68
53
  - - ! '>='
@@ -70,15 +55,10 @@ dependencies:
70
55
  version: '0'
71
56
  type: :development
72
57
  prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
58
+ version_requirements: *70316573363800
79
59
  - !ruby/object:Gem::Dependency
80
60
  name: turn
81
- requirement: !ruby/object:Gem::Requirement
61
+ requirement: &70316573379740 !ruby/object:Gem::Requirement
82
62
  none: false
83
63
  requirements:
84
64
  - - ! '>='
@@ -86,15 +66,10 @@ dependencies:
86
66
  version: '0'
87
67
  type: :development
88
68
  prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ! '>='
93
- - !ruby/object:Gem::Version
94
- version: '0'
69
+ version_requirements: *70316573379740
95
70
  - !ruby/object:Gem::Dependency
96
71
  name: faker
97
- requirement: !ruby/object:Gem::Requirement
72
+ requirement: &70316573379280 !ruby/object:Gem::Requirement
98
73
  none: false
99
74
  requirements:
100
75
  - - ! '>='
@@ -102,15 +77,10 @@ dependencies:
102
77
  version: '0'
103
78
  type: :development
104
79
  prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
80
+ version_requirements: *70316573379280
111
81
  - !ruby/object:Gem::Dependency
112
82
  name: factory_girl
113
- requirement: !ruby/object:Gem::Requirement
83
+ requirement: &70316573378840 !ruby/object:Gem::Requirement
114
84
  none: false
115
85
  requirements:
116
86
  - - ! '>='
@@ -118,15 +88,10 @@ dependencies:
118
88
  version: '0'
119
89
  type: :development
120
90
  prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ! '>='
125
- - !ruby/object:Gem::Version
126
- version: '0'
91
+ version_requirements: *70316573378840
127
92
  - !ruby/object:Gem::Dependency
128
93
  name: fakeweb
129
- requirement: !ruby/object:Gem::Requirement
94
+ requirement: &70316573378420 !ruby/object:Gem::Requirement
130
95
  none: false
131
96
  requirements:
132
97
  - - ! '>='
@@ -134,15 +99,10 @@ dependencies:
134
99
  version: '0'
135
100
  type: :development
136
101
  prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ! '>='
141
- - !ruby/object:Gem::Version
142
- version: '0'
102
+ version_requirements: *70316573378420
143
103
  - !ruby/object:Gem::Dependency
144
104
  name: activesupport
145
- requirement: !ruby/object:Gem::Requirement
105
+ requirement: &70316573378000 !ruby/object:Gem::Requirement
146
106
  none: false
147
107
  requirements:
148
108
  - - ! '>='
@@ -150,15 +110,10 @@ dependencies:
150
110
  version: '0'
151
111
  type: :runtime
152
112
  prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - ! '>='
157
- - !ruby/object:Gem::Version
158
- version: '0'
113
+ version_requirements: *70316573378000
159
114
  - !ruby/object:Gem::Dependency
160
115
  name: yajl-ruby
161
- requirement: !ruby/object:Gem::Requirement
116
+ requirement: &70316573377580 !ruby/object:Gem::Requirement
162
117
  none: false
163
118
  requirements:
164
119
  - - ! '>='
@@ -166,15 +121,10 @@ dependencies:
166
121
  version: '0'
167
122
  type: :runtime
168
123
  prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - ! '>='
173
- - !ruby/object:Gem::Version
174
- version: '0'
124
+ version_requirements: *70316573377580
175
125
  - !ruby/object:Gem::Dependency
176
126
  name: rest-client
177
- requirement: !ruby/object:Gem::Requirement
127
+ requirement: &70316573377160 !ruby/object:Gem::Requirement
178
128
  none: false
179
129
  requirements:
180
130
  - - ! '>='
@@ -182,12 +132,7 @@ dependencies:
182
132
  version: '0'
183
133
  type: :runtime
184
134
  prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
188
- - - ! '>='
189
- - !ruby/object:Gem::Version
190
- version: '0'
135
+ version_requirements: *70316573377160
191
136
  description: Ruby library for integrating with the 42Floors MLS
192
137
  email:
193
138
  - james@42floors.com
@@ -283,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
228
  version: '0'
284
229
  requirements: []
285
230
  rubyforge_project: mls
286
- rubygems_version: 1.8.24
231
+ rubygems_version: 1.8.11
287
232
  signing_key:
288
233
  specification_version: 3
289
234
  summary: 42Floors MLS Client