Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup, fixed small things

  • Loading branch information...
commit 1fea450a30cfe16e493f08ba206f78f5fd7dfa44 1 parent f632762
Johannes Wagener authored
1  .gitignore
View
@@ -3,3 +3,4 @@
coverage
rdoc
pkg
+*.gem
4 Rakefile
View
@@ -5,11 +5,11 @@ begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "oauth-active-resource"
- gem.summary = %Q{TODO}
+ gem.summary = "An OAuth enabled ActiveResource wrapper"
gem.email = "johannes@wagener.cc"
gem.homepage = "http://github.com/jwagener/oauth-active-resource"
gem.authors = ["Johannes Wagener"]
- gem.add_dependency "pelle-oauth"
+ gem.add_dependency "oauth", ">= 0.3.6"
gem.add_dependency "activeresource"
gem.add_dependency "multipart"
end
2  VERSION.yml
View
@@ -1,4 +1,4 @@
---
:major: 0
:minor: 4
-:patch: 1
+:patch: 4
17 lib/oauth_active_resource/resource.rb
View
@@ -97,12 +97,27 @@ def self.has_many(*args)
end
end
+
+ # ignore is added because the multipart gem is adding an extra new line
+ # to the last parameter which will break parsing of track[sharing]
+ def self.multipart_bug_fix(params)
+ ordered_params = ActiveSupport::OrderedHash.new
+ params.each do |k,v|
+ ordered_params[k] = v
+ end
+ ordered_params[:ignore] = 'multipart bug'
+ ordered_params
+ end
+
# allows you to POST/PUT an oauth authenticated multipart request
- def self.send_multipart_request(method,path,files,params={})
+ def self.send_multipart_request(method, path, files, params={})
req = Net::HTTP::Post.new(path)
if method == :put
params[:_method] = "PUT"
end
+
+ params = multipart_bug_fix(params)
+
file_hash = {}
files.each do |k,v|
file_hash[k] = Net::HTTP::FileForPost.new(v)
14 oauth-active-resource.gemspec
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{oauth-active-resource}
- s.version = "0.4.1"
+ s.version = "0.4.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Johannes Wagener"]
- s.date = %q{2009-09-03}
+ s.date = %q{2009-11-19}
s.email = %q{johannes@wagener.cc}
s.extra_rdoc_files = [
"LICENSE",
@@ -58,8 +58,8 @@ Gem::Specification.new do |s|
s.homepage = %q{http://github.com/jwagener/oauth-active-resource}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.4}
- s.summary = %q{TODO}
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{An OAuth enabled ActiveResource wrapper}
s.test_files = [
"spec/oauth_active_resource_spec.rb",
"spec/spec_helper.rb"
@@ -70,16 +70,16 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<pelle-oauth>, [">= 0"])
+ s.add_runtime_dependency(%q<oauth>, [">= 0.3.6"])
s.add_runtime_dependency(%q<activeresource>, [">= 0"])
s.add_runtime_dependency(%q<multipart>, [">= 0"])
else
- s.add_dependency(%q<pelle-oauth>, [">= 0"])
+ s.add_dependency(%q<oauth>, [">= 0.3.6"])
s.add_dependency(%q<activeresource>, [">= 0"])
s.add_dependency(%q<multipart>, [">= 0"])
end
else
- s.add_dependency(%q<pelle-oauth>, [">= 0"])
+ s.add_dependency(%q<oauth>, [">= 0.3.6"])
s.add_dependency(%q<activeresource>, [">= 0"])
s.add_dependency(%q<multipart>, [">= 0"])
end
2  spec/oauth_active_resource_spec.rb
View
@@ -1,6 +1,6 @@
require 'rubygems'
-gem 'pelle-oauth', '0.3.6'
+gem 'oauth', '>= 0.3.6'
require 'oauth'
require 'spec_helper'
Please sign in to comment.
Something went wrong with that request. Please try again.