chargify_api_ares 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -46,7 +46,7 @@ $ gem install chargify_api_ares
46
46
 
47
47
  ### Requirements
48
48
 
49
- This library requires ActiveResource version 2.3.4.
49
+ This library requires ActiveResource version 2.3.4 or 2.3.5.
50
50
 
51
51
  $ gem install activeresource
52
52
 
@@ -76,4 +76,5 @@ you may be interested in some [ActiveResource Documentation](http://apidock.com/
76
76
 
77
77
  ### Contributors
78
78
 
79
- * Michael Klett (Grasshopper Labs and Chargify)
79
+ * Michael Klett (Grasshopper Labs and Chargify)
80
+ * The Lab Rats @ Phase Two Labs
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  gemspec.description = ""
7
7
  gemspec.email = "mklett@grasshopper.com"
8
8
  gemspec.homepage = "http://github.com/grasshopperlabs/chargify_api_ares"
9
- gemspec.authors = ["Michael Klett"]
9
+ gemspec.authors = ["Michael Klett", "The Lab Rats @ Phase Two Labs"]
10
10
  Jeweler::GemcutterTasks.new
11
11
  end
12
12
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chargify_api_ares}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Michael Klett"]
12
- s.date = %q{2009-11-17}
11
+ s.authors = ["Michael Klett", "The Lab Rats @ Phase Two Labs"]
12
+ s.date = %q{2009-12-08}
13
13
  s.description = %q{}
14
14
  s.email = %q{mklett@grasshopper.com}
15
15
  s.extra_rdoc_files = [
@@ -1,11 +1,11 @@
1
1
  # Chargify API Wrapper using ActiveResource.
2
2
  #
3
3
  begin
4
- require 'activeresource'
4
+ require 'active_resource'
5
5
  rescue LoadError
6
6
  begin
7
7
  require 'rubygems'
8
- require 'activeresource'
8
+ require 'active_resource'
9
9
  rescue LoadError
10
10
  abort <<-ERROR
11
11
  The 'activeresource' library could not be loaded. If you have RubyGems
@@ -17,32 +17,31 @@ end
17
17
 
18
18
  # Version check
19
19
  module Chargify
20
- ARES_VERSION = '2.3.4'
20
+ ARES_VERSIONS = ['2.3.4', '2.3.5']
21
21
  end
22
22
  require 'active_resource/version'
23
- unless ActiveResource::VERSION::STRING == Chargify::ARES_VERSION
23
+ unless Chargify::ARES_VERSIONS.include?(ActiveResource::VERSION::STRING)
24
24
  abort <<-ERROR
25
- ActiveResource version #{Chargify::ARES_VERSION} is required.
25
+ ActiveResource version #{Chargify::ARES_VERSIONS.join(' or ')} is required.
26
26
  ERROR
27
27
  end
28
28
 
29
-
30
- # A patch for ActiveResource until a version after 2.3.4 fixes it.
31
- module ActiveResource
32
- # Errors returned from the API layer were not getting put into our object as of Rails 2.3.4
33
- # See http://github.com/rails/rails/commit/1488c6cc9e6237ce794e3c4a6201627b9fd4ca09
34
- class Base
35
- def save
36
- save_without_validation
37
- true
38
- rescue ResourceInvalid => error
39
- case error.response['Content-Type']
40
- when /application\/xml/
41
- errors.from_xml(error.response.body)
42
- when /application\/json/
43
- errors.from_json(error.response.body)
29
+ # Patch ActiveResource version 2.3.4
30
+ if ActiveResource::VERSION::STRING == '2.3.4'
31
+ module ActiveResource
32
+ class Base
33
+ def save
34
+ save_without_validation
35
+ true
36
+ rescue ResourceInvalid => error
37
+ case error.response['Content-Type']
38
+ when /application\/xml/
39
+ errors.from_xml(error.response.body)
40
+ when /application\/json/
41
+ errors.from_json(error.response.body)
42
+ end
43
+ false
44
44
  end
45
- false
46
45
  end
47
46
  end
48
47
  end
@@ -77,7 +76,7 @@ module Chargify
77
76
 
78
77
  class Customer < Base
79
78
  def self.find_by_reference(reference)
80
- find(:all, :params => {:reference => reference})
79
+ get(:lookup, :reference => reference)
81
80
  end
82
81
  end
83
82
 
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chargify_api_ares
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klett
8
+ - The Lab Rats @ Phase Two Labs
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-11-17 00:00:00 -05:00
13
+ date: 2009-12-08 00:00:00 -05:00
13
14
  default_executable:
14
15
  dependencies: []
15
16