Skip to content
This repository
Browse code

cleanup, fixed small things

  • Loading branch information...
commit 1fea450a30cfe16e493f08ba206f78f5fd7dfa44 1 parent f632762
Johannes Wagener authored
1  .gitignore
@@ -3,3 +3,4 @@
3 3 coverage
4 4 rdoc
5 5 pkg
  6 +*.gem
4 Rakefile
@@ -5,11 +5,11 @@ begin
5 5 require 'jeweler'
6 6 Jeweler::Tasks.new do |gem|
7 7 gem.name = "oauth-active-resource"
8   - gem.summary = %Q{TODO}
  8 + gem.summary = "An OAuth enabled ActiveResource wrapper"
9 9 gem.email = "johannes@wagener.cc"
10 10 gem.homepage = "http://github.com/jwagener/oauth-active-resource"
11 11 gem.authors = ["Johannes Wagener"]
12   - gem.add_dependency "pelle-oauth"
  12 + gem.add_dependency "oauth", ">= 0.3.6"
13 13 gem.add_dependency "activeresource"
14 14 gem.add_dependency "multipart"
15 15 end
2  VERSION.yml
... ... @@ -1,4 +1,4 @@
1 1 ---
2 2 :major: 0
3 3 :minor: 4
4   -:patch: 1
  4 +:patch: 4
17 lib/oauth_active_resource/resource.rb
@@ -97,12 +97,27 @@ def self.has_many(*args)
97 97 end
98 98 end
99 99
  100 +
  101 + # ignore is added because the multipart gem is adding an extra new line
  102 + # to the last parameter which will break parsing of track[sharing]
  103 + def self.multipart_bug_fix(params)
  104 + ordered_params = ActiveSupport::OrderedHash.new
  105 + params.each do |k,v|
  106 + ordered_params[k] = v
  107 + end
  108 + ordered_params[:ignore] = 'multipart bug'
  109 + ordered_params
  110 + end
  111 +
100 112 # allows you to POST/PUT an oauth authenticated multipart request
101   - def self.send_multipart_request(method,path,files,params={})
  113 + def self.send_multipart_request(method, path, files, params={})
102 114 req = Net::HTTP::Post.new(path)
103 115 if method == :put
104 116 params[:_method] = "PUT"
105 117 end
  118 +
  119 + params = multipart_bug_fix(params)
  120 +
106 121 file_hash = {}
107 122 files.each do |k,v|
108 123 file_hash[k] = Net::HTTP::FileForPost.new(v)
14 oauth-active-resource.gemspec
@@ -2,11 +2,11 @@
2 2
3 3 Gem::Specification.new do |s|
4 4 s.name = %q{oauth-active-resource}
5   - s.version = "0.4.1"
  5 + s.version = "0.4.4"
6 6
7 7 s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8 8 s.authors = ["Johannes Wagener"]
9   - s.date = %q{2009-09-03}
  9 + s.date = %q{2009-11-19}
10 10 s.email = %q{johannes@wagener.cc}
11 11 s.extra_rdoc_files = [
12 12 "LICENSE",
@@ -58,8 +58,8 @@ Gem::Specification.new do |s|
58 58 s.homepage = %q{http://github.com/jwagener/oauth-active-resource}
59 59 s.rdoc_options = ["--charset=UTF-8"]
60 60 s.require_paths = ["lib"]
61   - s.rubygems_version = %q{1.3.4}
62   - s.summary = %q{TODO}
  61 + s.rubygems_version = %q{1.3.5}
  62 + s.summary = %q{An OAuth enabled ActiveResource wrapper}
63 63 s.test_files = [
64 64 "spec/oauth_active_resource_spec.rb",
65 65 "spec/spec_helper.rb"
@@ -70,16 +70,16 @@ Gem::Specification.new do |s|
70 70 s.specification_version = 3
71 71
72 72 if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
73   - s.add_runtime_dependency(%q<pelle-oauth>, [">= 0"])
  73 + s.add_runtime_dependency(%q<oauth>, [">= 0.3.6"])
74 74 s.add_runtime_dependency(%q<activeresource>, [">= 0"])
75 75 s.add_runtime_dependency(%q<multipart>, [">= 0"])
76 76 else
77   - s.add_dependency(%q<pelle-oauth>, [">= 0"])
  77 + s.add_dependency(%q<oauth>, [">= 0.3.6"])
78 78 s.add_dependency(%q<activeresource>, [">= 0"])
79 79 s.add_dependency(%q<multipart>, [">= 0"])
80 80 end
81 81 else
82   - s.add_dependency(%q<pelle-oauth>, [">= 0"])
  82 + s.add_dependency(%q<oauth>, [">= 0.3.6"])
83 83 s.add_dependency(%q<activeresource>, [">= 0"])
84 84 s.add_dependency(%q<multipart>, [">= 0"])
85 85 end
2  spec/oauth_active_resource_spec.rb
... ... @@ -1,6 +1,6 @@
1 1 require 'rubygems'
2 2
3   -gem 'pelle-oauth', '0.3.6'
  3 +gem 'oauth', '>= 0.3.6'
4 4 require 'oauth'
5 5
6 6 require 'spec_helper'

0 comments on commit 1fea450

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