Skip to content
Browse files

Version bump to change in the file uploading for photos.

  • Loading branch information...
1 parent 09a7079 commit 8aa7e5a7db18a618d28136c8814cc00490a45fae @waratuman waratuman committed Jan 21, 2013
Showing with 7 additions and 7 deletions.
  1. +1 −1 lib/mls.rb
  2. +4 −4 lib/mls/models/photo.rb
  3. +2 −2 mls.gemspec
View
2 lib/mls.rb
@@ -361,7 +361,7 @@ def handle_response(response, *valid_response_codes)
when 503
raise MLS::Exception::ServiceUnavailable, response.body
when 300..599
- raise MLS::Exception, "#{code}\n\n#{response.body}"
+ raise MLS::Exception, code
end
end
View
8 lib/mls/models/photo.rb
@@ -15,13 +15,13 @@ def url(style='large', protocol='http')
"#{protocol}://#{MLS.asset_host}/photos/#{style}/#{@digest}.jpg"
end
- def self.create(image_file)
- image_file.rewind
+ def self.create(attrs)
+ attrs[:file].rewind
url = MLS.url.dup
url.user = nil
url.path = "/api/photos"
- response = RestClient.post(url.to_s, {:file => image_file}, MLS.headers)
- image_file.close unless image_file.closed?
+ response = RestClient.post(url.to_s, {:file => attrs[:file]}, MLS.headers)
+ attrs[:file].close unless attrs[:file].closed?
MLS::Photo::Parser.parse(response.body)
end
View
4 mls.gemspec
@@ -3,8 +3,8 @@ $:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "mls"
- s.version = '0.2.22'
- s.authors = ["James R. Bracy"]
+ s.version = '0.2.23'
+ s.authors = ["James R. Bracy", "Jon Bracy"]
s.email = ["james@42floors.com"]
s.homepage = "http://mls.42floors.com"
s.summary = %q{42Floors MLS Client}

0 comments on commit 8aa7e5a

Please sign in to comment.
Something went wrong with that request. Please try again.