jsmestad-chargify 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -2
- data/VERSION +1 -1
- data/jsmestad-chargify.gemspec +2 -2
- data/lib/chargify/subscription.rb +7 -0
- data/spec/unit/chargify/subscription_spec.rb +10 -0
- metadata +9 -3
data/Gemfile
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
source 'http://rubygems.org'
|
|
2
2
|
|
|
3
3
|
group :runtime do
|
|
4
|
-
|
|
4
|
+
gem 'httparty', '~> 0.6.1'
|
|
5
|
+
gem 'hashie', '~> 0.1.8'
|
|
6
|
+
gem 'json'
|
|
5
7
|
end
|
|
6
8
|
|
|
7
9
|
group :test do
|
|
8
10
|
gem 'jeweler'
|
|
9
11
|
gem 'rake'
|
|
10
|
-
gem 'bundler', '
|
|
12
|
+
gem 'bundler', '~> 0.9.26'
|
|
11
13
|
gem 'fakeweb', '>= 1.2.5'
|
|
12
14
|
gem 'mocha', '~> 0.9.8'
|
|
13
15
|
gem 'rspec', '~> 2.0.0.beta.17'
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.1
|
data/jsmestad-chargify.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{jsmestad-chargify}
|
|
8
|
-
s.version = "0.3.
|
|
8
|
+
s.version = "0.3.1"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Wynn Netherland", "Justin Smestad"]
|
|
12
|
-
s.date = %q{2010-07-
|
|
12
|
+
s.date = %q{2010-07-21}
|
|
13
13
|
s.email = %q{justin.smestad@gmail.com}
|
|
14
14
|
s.extra_rdoc_files = [
|
|
15
15
|
"LICENSE",
|
|
@@ -3,7 +3,14 @@ module Chargify
|
|
|
3
3
|
|
|
4
4
|
class << self
|
|
5
5
|
|
|
6
|
+
def all
|
|
7
|
+
result = api_request(:get, "/subscriptions.json")
|
|
8
|
+
result.map{|p| Hashie::Mash.new p['subscription']}
|
|
9
|
+
end
|
|
10
|
+
|
|
6
11
|
def find!(id)
|
|
12
|
+
return all if id == :all
|
|
13
|
+
|
|
7
14
|
result = api_request(:get, "/subscriptions/#{id}.json")
|
|
8
15
|
Hashie::Mash.new(result).subscription
|
|
9
16
|
end
|
|
@@ -9,6 +9,16 @@ describe Chargify::Subscription do
|
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
describe '.all' do
|
|
13
|
+
|
|
14
|
+
it "should return a list of products" do
|
|
15
|
+
stub_get "https://OU812:x@pengwynn.chargify.com/subscriptions.json", "subscriptions.json"
|
|
16
|
+
subscription = Chargify::Subscription.all
|
|
17
|
+
subscription.first.customer.reference.should == 'bradleyjoyce'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
12
22
|
describe '.find!' do
|
|
13
23
|
|
|
14
24
|
it "should return info for a subscription" do
|
metadata
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jsmestad-chargify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 17
|
|
4
5
|
prerelease: false
|
|
5
6
|
segments:
|
|
6
7
|
- 0
|
|
7
8
|
- 3
|
|
8
|
-
-
|
|
9
|
-
version: 0.3.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.3.1
|
|
10
11
|
platform: ruby
|
|
11
12
|
authors:
|
|
12
13
|
- Wynn Netherland
|
|
@@ -15,7 +16,7 @@ autorequire:
|
|
|
15
16
|
bindir: bin
|
|
16
17
|
cert_chain: []
|
|
17
18
|
|
|
18
|
-
date: 2010-07-
|
|
19
|
+
date: 2010-07-21 00:00:00 -06:00
|
|
19
20
|
default_executable:
|
|
20
21
|
dependencies:
|
|
21
22
|
- !ruby/object:Gem::Dependency
|
|
@@ -26,6 +27,7 @@ dependencies:
|
|
|
26
27
|
requirements:
|
|
27
28
|
- - ~>
|
|
28
29
|
- !ruby/object:Gem::Version
|
|
30
|
+
hash: 5
|
|
29
31
|
segments:
|
|
30
32
|
- 0
|
|
31
33
|
- 6
|
|
@@ -41,6 +43,7 @@ dependencies:
|
|
|
41
43
|
requirements:
|
|
42
44
|
- - ~>
|
|
43
45
|
- !ruby/object:Gem::Version
|
|
46
|
+
hash: 11
|
|
44
47
|
segments:
|
|
45
48
|
- 0
|
|
46
49
|
- 1
|
|
@@ -56,6 +59,7 @@ dependencies:
|
|
|
56
59
|
requirements:
|
|
57
60
|
- - ">="
|
|
58
61
|
- !ruby/object:Gem::Version
|
|
62
|
+
hash: 3
|
|
59
63
|
segments:
|
|
60
64
|
- 0
|
|
61
65
|
version: "0"
|
|
@@ -127,6 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
127
131
|
requirements:
|
|
128
132
|
- - ">="
|
|
129
133
|
- !ruby/object:Gem::Version
|
|
134
|
+
hash: 3
|
|
130
135
|
segments:
|
|
131
136
|
- 0
|
|
132
137
|
version: "0"
|
|
@@ -135,6 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
135
140
|
requirements:
|
|
136
141
|
- - ">="
|
|
137
142
|
- !ruby/object:Gem::Version
|
|
143
|
+
hash: 3
|
|
138
144
|
segments:
|
|
139
145
|
- 0
|
|
140
146
|
version: "0"
|