recurly 2.0.9 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of recurly might be problematic. Click here for more details.

data/README.markdown CHANGED
@@ -12,7 +12,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
12
12
  [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
13
13
 
14
14
  ``` ruby
15
- gem 'recurly', '~> 2.0.9'
15
+ gem 'recurly', '~> 2.0.10'
16
16
  ```
17
17
 
18
18
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -62,7 +62,7 @@ Instructions and examples are available on
62
62
  [Recurly's documentation site](http://docs.recurly.com/api/basics).
63
63
 
64
64
  Recurly's gem API is available
65
- [here](http://rubydoc.info/gems/recurly/2.0.9/frames).
65
+ [here](http://rubydoc.info/gems/recurly/2.0.10/frames).
66
66
 
67
67
 
68
68
  ## Contributing
data/bin/recurly CHANGED
@@ -45,7 +45,7 @@ OptionParser.new do |opts|
45
45
  end
46
46
  end.parse!
47
47
 
48
- require 'recurly'
48
+ require 'recurly/all'
49
49
  Recurly.api_key = options[:api_key] || ENV['RECURLY_API_KEY']
50
50
  include Recurly
51
51
 
@@ -0,0 +1,20 @@
1
+ require 'recurly'
2
+ require 'recurly/account'
3
+ require 'recurly/add_on'
4
+ require 'recurly/adjustment'
5
+ require 'recurly/api'
6
+ require 'recurly/billing_info'
7
+ require 'recurly/coupon'
8
+ require 'recurly/helper'
9
+ require 'recurly/invoice'
10
+ require 'recurly/js'
11
+ require 'recurly/money'
12
+ require 'recurly/plan'
13
+ require 'recurly/redemption'
14
+ require 'recurly/resource'
15
+ require 'recurly/resource/pager'
16
+ require 'recurly/subscription'
17
+ require 'recurly/subscription/add_ons'
18
+ require 'recurly/transaction'
19
+ require 'recurly/version'
20
+ require 'recurly/xml'
@@ -30,8 +30,10 @@ module Recurly
30
30
  word
31
31
  end
32
32
 
33
- def hash_with_indifferent_read_access
34
- Hash.new { |hash, key| hash[key.to_s] if key.is_a? Symbol }
33
+ def hash_with_indifferent_read_access base = {}
34
+ indifferent = Hash.new { |hash, key| hash[key.to_s] if key.is_a? Symbol }
35
+ base.each_pair { |key, value| indifferent[key.to_s] = value }
36
+ indifferent
35
37
  end
36
38
 
37
39
  extend self
@@ -845,6 +845,32 @@ module Recurly
845
845
  other.is_a?(self.class) && other.to_s == to_s
846
846
  end
847
847
 
848
+ def marshal_dump
849
+ [
850
+ @attributes.reject { |k, v| v.is_a? Proc },
851
+ @new_record,
852
+ @destroyed,
853
+ @uri,
854
+ @href,
855
+ changed_attributes,
856
+ previous_changes,
857
+ etag,
858
+ response
859
+ ]
860
+ end
861
+
862
+ def marshal_load serialization
863
+ @attributes,
864
+ @new_record,
865
+ @destroyed,
866
+ @uri,
867
+ @href,
868
+ @changed_attributes,
869
+ @previous_changes,
870
+ @response,
871
+ @etag = serialization
872
+ end
873
+
848
874
  # @return [String]
849
875
  def inspect attributes = self.class.attribute_names.to_a
850
876
  string = "#<#{self.class}"
@@ -27,6 +27,7 @@ module Recurly
27
27
  when AddOn then add_on = { :add_on_code => add_on.add_on_code }
28
28
  when String, Symbol then add_on = { :add_on_code => add_on.to_s }
29
29
  end
30
+ add_on = Helper.hash_with_indifferent_read_access add_on
30
31
 
31
32
  exist = @add_ons.find { |a| a[:add_on_code] == add_on[:add_on_code] }
32
33
  if exist
@@ -122,6 +122,7 @@ module Recurly
122
122
  reload self[:terminate].call(:params => { :refund => refund_type })
123
123
  true
124
124
  end
125
+ alias destroy terminate
125
126
 
126
127
  # Reactivate a subscription.
127
128
  #
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 9
5
+ PATCH = 10
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
data/lib/recurly/xml.rb CHANGED
@@ -9,10 +9,7 @@ module Recurly
9
9
  end
10
10
 
11
11
  case type
12
- when 'array'
13
- el.elements.map { |e|
14
- e.elements.empty? ? XML.cast(e) : { e.name => XML.cast(e) }
15
- }
12
+ when 'array' then el.elements.map { |e| XML.cast e }
16
13
  when 'boolean' then el.text == 'true'
17
14
  when 'date' then Date.parse el.text
18
15
  when 'datetime' then DateTime.parse el.text
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-30 00:00:00.000000000 Z
12
+ date: 2011-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70125982298980 !ruby/object:Gem::Requirement
16
+ requirement: &70198296894000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.9.2
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70125982298980
24
+ version_requirements: *70198296894000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70125982298100 !ruby/object:Gem::Requirement
27
+ requirement: &70198297061820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.pre.10
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70125982298100
35
+ version_requirements: *70198297061820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: minitest
38
- requirement: &70125982297300 !ruby/object:Gem::Requirement
38
+ requirement: &70198297061020 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.6.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70125982297300
46
+ version_requirements: *70198297061020
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: webmock
49
- requirement: &70125982296580 !ruby/object:Gem::Requirement
49
+ requirement: &70198297060280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.7.6
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70125982296580
57
+ version_requirements: *70198297060280
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-minitest
60
- requirement: &70125982295680 !ruby/object:Gem::Requirement
60
+ requirement: &70198297059360 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.4.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70125982295680
68
+ version_requirements: *70198297059360
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rb-fsevent
71
- requirement: &70125982294700 !ruby/object:Gem::Requirement
71
+ requirement: &70198297058380 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.4.3.1
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70125982294700
79
+ version_requirements: *70198297058380
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: growl_notify
82
- requirement: &70125982293960 !ruby/object:Gem::Requirement
82
+ requirement: &70198297057560 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: 0.0.1
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70125982293960
90
+ version_requirements: *70198297057560
91
91
  description: ! 'An API client library for Recurly: http://recurly.com'
92
92
  email: support@recurly.com
93
93
  executables:
@@ -101,6 +101,7 @@ files:
101
101
  - lib/recurly/account.rb
102
102
  - lib/recurly/add_on.rb
103
103
  - lib/recurly/adjustment.rb
104
+ - lib/recurly/all.rb
104
105
  - lib/recurly/api/errors.rb
105
106
  - lib/recurly/api/net_http_adapter.rb
106
107
  - lib/recurly/api.rb