recurly 0.1.0 → 0.1.1
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/Rakefile +1 -1
- data/lib/recurly/account.rb +4 -0
- data/lib/recurly/base.rb +11 -3
- data/lib/recurly/billing_info.rb +2 -3
- data/lib/recurly/plan.rb +4 -0
- data/lib/recurly/subscription.rb +5 -3
- data/recurly.gemspec +2 -2
- data/test/account_test.rb +0 -4
- data/test/subscription_test.rb +2 -1
- data/test/test_helper.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('recurly', '0.1.
|
5
|
+
Echoe.new('recurly', '0.1.1') do |p|
|
6
6
|
p.description = "A Ruby API wrapper for Recurly. Super Simple Subscription billing."
|
7
7
|
p.url = "http://github.com/recurly/recurly-client-ruby"
|
8
8
|
p.author = "Isaac Hall"
|
data/lib/recurly/account.rb
CHANGED
data/lib/recurly/base.rb
CHANGED
@@ -5,8 +5,16 @@ require "active_resource"
|
|
5
5
|
# Errors in Rails 2.3.4 are not parsed correctly.
|
6
6
|
module ActiveResource
|
7
7
|
class Base
|
8
|
+
def update_only
|
9
|
+
false
|
10
|
+
end
|
11
|
+
|
8
12
|
def save
|
9
|
-
|
13
|
+
if update_only
|
14
|
+
update
|
15
|
+
else
|
16
|
+
save_without_validation
|
17
|
+
end
|
10
18
|
true
|
11
19
|
rescue ResourceInvalid => error
|
12
20
|
case error.response['Content-Type']
|
@@ -22,7 +30,7 @@ end
|
|
22
30
|
|
23
31
|
module Recurly
|
24
32
|
|
25
|
-
VERSION = '0.1.
|
33
|
+
VERSION = '0.1.1'
|
26
34
|
|
27
35
|
class << self
|
28
36
|
attr_accessor :username, :password
|
@@ -65,4 +73,4 @@ module Recurly
|
|
65
73
|
end
|
66
74
|
|
67
75
|
end
|
68
|
-
end
|
76
|
+
end
|
data/lib/recurly/billing_info.rb
CHANGED
data/lib/recurly/plan.rb
CHANGED
data/lib/recurly/subscription.rb
CHANGED
@@ -25,15 +25,17 @@ module Recurly
|
|
25
25
|
def change(timeframe, options = {})
|
26
26
|
raise "Timeframe must be :full or :partial." unless timeframe == 'now' or timeframe == 'renewal'
|
27
27
|
options[:timeframe] = timeframe
|
28
|
-
connection.put(element_path(
|
28
|
+
connection.put(element_path(self.subscription_account_code),
|
29
29
|
self.class.format.encode(options, :root => :subscription),
|
30
30
|
self.class.headers)
|
31
31
|
end
|
32
32
|
|
33
33
|
def subscription_account_code
|
34
|
-
acct_code = self.account_code if defined?(self.account_code)
|
35
|
-
acct_code ||= account.account_code
|
34
|
+
acct_code = self.account_code if defined?(self.account_code) and !self.account_code.nil? and !self.account_code.blank?
|
35
|
+
acct_code ||= account.account_code if defined?(account) and !account.nil?
|
36
36
|
acct_code ||= self.primary_key if defined?(self.primary_key)
|
37
|
+
acct_code ||= self.id if defined?(self.id)
|
38
|
+
raise 'Missing Account Code' if acct_code.nil? or acct_code.blank?
|
37
39
|
acct_code
|
38
40
|
end
|
39
41
|
end
|
data/recurly.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{recurly}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Isaac Hall"]
|
9
|
-
s.date = %q{
|
9
|
+
s.date = %q{2010-01-15}
|
10
10
|
s.description = %q{A Ruby API wrapper for Recurly. Super Simple Subscription billing.}
|
11
11
|
s.email = %q{support@recurly.com}
|
12
12
|
s.extra_rdoc_files = ["LICENSE", "README.md", "lib/recurly.rb", "lib/recurly/account.rb", "lib/recurly/base.rb", "lib/recurly/billing_info.rb", "lib/recurly/charge.rb", "lib/recurly/credit.rb", "lib/recurly/plan.rb", "lib/recurly/subscription.rb"]
|
data/test/account_test.rb
CHANGED
data/test/subscription_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
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: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Hall
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-15 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|