chargify2 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - ree
5
+ branches:
6
+ only:
7
+ - master
data/README.md CHANGED
@@ -1,23 +1,46 @@
1
- Chargify V2 API Ruby Wrapper
1
+ Chargify API V2 Ruby Wrapper [![build status](https://secure.travis-ci.org/chargify/chargify2.png)](http://travis-ci.org/chargify/chargify2)
2
2
  ============================
3
3
 
4
- chargify = Chargify2::Client.new(:api_id => "f43ee0a0-4356-012e-0f5f-0025009f114a", :api_password => 'direct777test', :base_uri => "http://app.chargify.local/api/v2")
5
- call = chargify.calls.read("4dbc42ecc21d93ec8f9bb581346dd41c5c3c2cf5")
4
+ This gem is meant to be used with the [Chargify Direct API](http://docs.chargify.com/chargify-direct-introduction).
6
5
 
7
- Contributing to Chargify2
8
- -------------------------
9
-
10
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
11
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
12
- * Fork the project
13
- * Start a feature/bugfix branch
14
- * Commit and push until you are happy with your contribution
15
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
16
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
6
+ You'll need Chargify Direct credentials to interact with the Chargify V2 API, which you can get by [opening a support ticket](http://help.chargify.com/anonymous_requests/new).
7
+
8
+ Getting Started
9
+ ---------------
10
+
11
+ Install the gem, or add it to your Gemfile:
12
+
13
+ gem install chargify2
14
+
15
+ Sample Code
16
+ -----------
17
+
18
+ Check out the [Chargify Direct Example App](https://github.com/chargify/chargify_direct_example) for usage examples.
19
+
20
+ View a *call* resource:
21
+
22
+ ``` ruby
23
+ chargify = Chargify2::Client.new(:api_id => "f43ee0a0-4356-012e-0f5f-0025009f114a", :api_password => 'direct777test', :base_uri => "http://app.chargify.local/api/v2")
24
+ call = chargify.calls.read("4dbc42ecc21d93ec8f9bb581346dd41c5c3c2cf5")
25
+ ```
17
26
 
27
+ Contributing
28
+ ------------
29
+
30
+ **What to contribute:**
31
+
32
+ * Check out the project's [issues page](https://github.com/chargify/chargify2/issues)
33
+ * Refactor something that looks messy to you!
34
+
35
+ **How to contribute:**
36
+
37
+ * Fork the project.
38
+ * Implement your feature on a topic branch.
39
+ * Add tests for it. This is important so we don't break it in a future version unintentionally.
40
+ * Commit, do not mess with Rakefile, version, or history. If you want to have your own version, that's fine but bump version in acommit by itself that we can ignore when we pull.
41
+ * Send us a pull request.
42
+
18
43
  Copyright
19
44
  ---------
20
45
 
21
- Copyright (c) 2011 Chargify. See LICENSE.txt for
22
- further details.
23
-
46
+ Copyright (c) 2011 Chargify. See LICENSE.txt for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/chargify2.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chargify2}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Klett"]
12
- s.date = %q{2011-04-20}
12
+ s.date = %q{2011-10-19}
13
13
  s.description = %q{}
14
14
  s.email = %q{michael@webadvocate.com}
15
15
  s.extra_rdoc_files = [
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.files = [
20
20
  ".document",
21
21
  ".rspec",
22
+ ".travis.yml",
22
23
  "Gemfile",
23
24
  "Gemfile.lock",
24
25
  "LICENSE.txt",
@@ -44,7 +45,7 @@ Gem::Specification.new do |s|
44
45
  s.homepage = %q{http://github.com/chargify/chargify2}
45
46
  s.licenses = ["MIT"]
46
47
  s.require_paths = ["lib"]
47
- s.rubygems_version = %q{1.3.7}
48
+ s.rubygems_version = %q{1.6.2}
48
49
  s.summary = %q{Chargify API V2 Ruby Wrapper}
49
50
  s.test_files = [
50
51
  "spec/call_resource_spec.rb",
@@ -57,7 +58,6 @@ Gem::Specification.new do |s|
57
58
  ]
58
59
 
59
60
  if s.respond_to? :specification_version then
60
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
61
61
  s.specification_version = 3
62
62
 
63
63
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -1,3 +1,5 @@
1
+ require 'chargify2/client'
2
+
1
3
  module Chargify2
2
4
  # Resource orchestrates the connection from the Client to the Chargify API Resources, available
3
5
  # at the Resource URIs.
data/lib/chargify2.rb CHANGED
@@ -3,6 +3,11 @@ require 'addressable/uri'
3
3
  require 'hashie'
4
4
  require 'hashery/opencascade'
5
5
 
6
- Dir["#{File.dirname(__FILE__)}/chargify2/**/*.rb"].each {|f| require f}
6
+ require 'chargify2/utils'
7
+ require 'chargify2/direct'
8
+ require 'chargify2/resource'
9
+ require 'chargify2/client'
10
+ require 'chargify2/representations/call'
11
+ require 'chargify2/resources/call_resource'
7
12
 
8
13
  Hash.send(:include, Chargify2::Utils::HashExtensions)
metadata CHANGED
@@ -1,211 +1,160 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: chargify2
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Michael Klett
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-04-20 00:00:00 -04:00
12
+ date: 2011-10-19 00:00:00.000000000 -04:00
19
13
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- prerelease: false
23
- type: :runtime
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
24
16
  name: httparty
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2153775320 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
34
- requirement: *id001
35
- - !ruby/object:Gem::Dependency
36
- prerelease: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
37
23
  type: :runtime
24
+ prerelease: false
25
+ version_requirements: *2153775320
26
+ - !ruby/object:Gem::Dependency
38
27
  name: addressable
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
28
+ requirement: &2153774820 !ruby/object:Gem::Requirement
40
29
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
48
- requirement: *id002
49
- - !ruby/object:Gem::Dependency
50
- prerelease: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
51
34
  type: :runtime
35
+ prerelease: false
36
+ version_requirements: *2153774820
37
+ - !ruby/object:Gem::Dependency
52
38
  name: hashie
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
39
+ requirement: &2153774320 !ruby/object:Gem::Requirement
54
40
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
62
- requirement: *id003
63
- - !ruby/object:Gem::Dependency
64
- prerelease: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
65
45
  type: :runtime
46
+ prerelease: false
47
+ version_requirements: *2153774320
48
+ - !ruby/object:Gem::Dependency
66
49
  name: hashery
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
50
+ requirement: &2153773820 !ruby/object:Gem::Requirement
68
51
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
76
- requirement: *id004
77
- - !ruby/object:Gem::Dependency
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :runtime
78
57
  prerelease: false
79
- type: :development
58
+ version_requirements: *2153773820
59
+ - !ruby/object:Gem::Dependency
80
60
  name: rspec
81
- version_requirements: &id005 !ruby/object:Gem::Requirement
61
+ requirement: &2153773320 !ruby/object:Gem::Requirement
82
62
  none: false
83
- requirements:
63
+ requirements:
84
64
  - - ~>
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 2
89
- - 3
90
- - 0
65
+ - !ruby/object:Gem::Version
91
66
  version: 2.3.0
92
- requirement: *id005
93
- - !ruby/object:Gem::Dependency
94
- prerelease: false
95
67
  type: :development
68
+ prerelease: false
69
+ version_requirements: *2153773320
70
+ - !ruby/object:Gem::Dependency
96
71
  name: yard
97
- version_requirements: &id006 !ruby/object:Gem::Requirement
72
+ requirement: &2153772780 !ruby/object:Gem::Requirement
98
73
  none: false
99
- requirements:
74
+ requirements:
100
75
  - - ~>
101
- - !ruby/object:Gem::Version
102
- hash: 7
103
- segments:
104
- - 0
105
- - 6
106
- - 0
76
+ - !ruby/object:Gem::Version
107
77
  version: 0.6.0
108
- requirement: *id006
109
- - !ruby/object:Gem::Dependency
110
- prerelease: false
111
78
  type: :development
79
+ prerelease: false
80
+ version_requirements: *2153772780
81
+ - !ruby/object:Gem::Dependency
112
82
  name: bundler
113
- version_requirements: &id007 !ruby/object:Gem::Requirement
83
+ requirement: &2153772240 !ruby/object:Gem::Requirement
114
84
  none: false
115
- requirements:
85
+ requirements:
116
86
  - - ~>
117
- - !ruby/object:Gem::Version
118
- hash: 23
119
- segments:
120
- - 1
121
- - 0
122
- - 0
87
+ - !ruby/object:Gem::Version
123
88
  version: 1.0.0
124
- requirement: *id007
125
- - !ruby/object:Gem::Dependency
126
- prerelease: false
127
89
  type: :development
90
+ prerelease: false
91
+ version_requirements: *2153772240
92
+ - !ruby/object:Gem::Dependency
128
93
  name: jeweler
129
- version_requirements: &id008 !ruby/object:Gem::Requirement
94
+ requirement: &2153771720 !ruby/object:Gem::Requirement
130
95
  none: false
131
- requirements:
96
+ requirements:
132
97
  - - ~>
133
- - !ruby/object:Gem::Version
134
- hash: 7
135
- segments:
136
- - 1
137
- - 5
138
- - 2
98
+ - !ruby/object:Gem::Version
139
99
  version: 1.5.2
140
- requirement: *id008
141
- - !ruby/object:Gem::Dependency
142
- prerelease: false
143
100
  type: :development
101
+ prerelease: false
102
+ version_requirements: *2153771720
103
+ - !ruby/object:Gem::Dependency
144
104
  name: rcov
145
- version_requirements: &id009 !ruby/object:Gem::Requirement
105
+ requirement: &2153771200 !ruby/object:Gem::Requirement
146
106
  none: false
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- hash: 3
151
- segments:
152
- - 0
153
- version: "0"
154
- requirement: *id009
155
- - !ruby/object:Gem::Dependency
156
- prerelease: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
157
111
  type: :development
112
+ prerelease: false
113
+ version_requirements: *2153771200
114
+ - !ruby/object:Gem::Dependency
158
115
  name: webmock
159
- version_requirements: &id010 !ruby/object:Gem::Requirement
116
+ requirement: &2153770660 !ruby/object:Gem::Requirement
160
117
  none: false
161
- requirements:
162
- - - ">="
163
- - !ruby/object:Gem::Version
164
- hash: 3
165
- segments:
166
- - 0
167
- version: "0"
168
- requirement: *id010
169
- - !ruby/object:Gem::Dependency
170
- prerelease: false
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
171
122
  type: :development
123
+ prerelease: false
124
+ version_requirements: *2153770660
125
+ - !ruby/object:Gem::Dependency
172
126
  name: vcr
173
- version_requirements: &id011 !ruby/object:Gem::Requirement
127
+ requirement: &2153770140 !ruby/object:Gem::Requirement
174
128
  none: false
175
- requirements:
176
- - - ">="
177
- - !ruby/object:Gem::Version
178
- hash: 3
179
- segments:
180
- - 0
181
- version: "0"
182
- requirement: *id011
183
- - !ruby/object:Gem::Dependency
184
- prerelease: false
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
185
133
  type: :development
134
+ prerelease: false
135
+ version_requirements: *2153770140
136
+ - !ruby/object:Gem::Dependency
186
137
  name: capybara
187
- version_requirements: &id012 !ruby/object:Gem::Requirement
138
+ requirement: &2153769600 !ruby/object:Gem::Requirement
188
139
  none: false
189
- requirements:
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- hash: 3
193
- segments:
194
- - 0
195
- version: "0"
196
- requirement: *id012
197
- description: ""
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: *2153769600
147
+ description: ''
198
148
  email: michael@webadvocate.com
199
149
  executables: []
200
-
201
150
  extensions: []
202
-
203
- extra_rdoc_files:
151
+ extra_rdoc_files:
204
152
  - LICENSE.txt
205
153
  - README.md
206
- files:
154
+ files:
207
155
  - .document
208
156
  - .rspec
157
+ - .travis.yml
209
158
  - Gemfile
210
159
  - Gemfile.lock
211
160
  - LICENSE.txt
@@ -229,39 +178,34 @@ files:
229
178
  - spec/support/spec_helper_methods.rb
230
179
  has_rdoc: true
231
180
  homepage: http://github.com/chargify/chargify2
232
- licenses:
181
+ licenses:
233
182
  - MIT
234
183
  post_install_message:
235
184
  rdoc_options: []
236
-
237
- require_paths:
185
+ require_paths:
238
186
  - lib
239
- required_ruby_version: !ruby/object:Gem::Requirement
187
+ required_ruby_version: !ruby/object:Gem::Requirement
240
188
  none: false
241
- requirements:
242
- - - ">="
243
- - !ruby/object:Gem::Version
244
- hash: 3
245
- segments:
189
+ requirements:
190
+ - - ! '>='
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ segments:
246
194
  - 0
247
- version: "0"
248
- required_rubygems_version: !ruby/object:Gem::Requirement
195
+ hash: 1643346488157857297
196
+ required_rubygems_version: !ruby/object:Gem::Requirement
249
197
  none: false
250
- requirements:
251
- - - ">="
252
- - !ruby/object:Gem::Version
253
- hash: 3
254
- segments:
255
- - 0
256
- version: "0"
198
+ requirements:
199
+ - - ! '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
257
202
  requirements: []
258
-
259
203
  rubyforge_project:
260
- rubygems_version: 1.3.7
204
+ rubygems_version: 1.6.2
261
205
  signing_key:
262
206
  specification_version: 3
263
207
  summary: Chargify API V2 Ruby Wrapper
264
- test_files:
208
+ test_files:
265
209
  - spec/call_resource_spec.rb
266
210
  - spec/client_spec.rb
267
211
  - spec/direct_response_parameters_spec.rb