action_kit_rest 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.document +5 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +112 -0
- data/LICENSE.txt +24 -0
- data/README.md +23 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/action_kit_rest.gemspec +107 -0
- data/lib/action_kit_rest.rb +30 -0
- data/lib/action_kit_rest/action.rb +7 -0
- data/lib/action_kit_rest/api.rb +53 -0
- data/lib/action_kit_rest/base.rb +37 -0
- data/lib/action_kit_rest/client.rb +35 -0
- data/lib/action_kit_rest/list.rb +12 -0
- data/lib/action_kit_rest/page.rb +11 -0
- data/lib/action_kit_rest/pages/base.rb +20 -0
- data/lib/action_kit_rest/pages/import_page.rb +9 -0
- data/lib/action_kit_rest/pages/signup_page.rb +9 -0
- data/lib/action_kit_rest/railties.rb +7 -0
- data/lib/action_kit_rest/response/collection.rb +25 -0
- data/lib/action_kit_rest/response/raise_error.rb +25 -0
- data/lib/action_kit_rest/response/validation_error.rb +19 -0
- data/lib/action_kit_rest/response/wrapper.rb +120 -0
- data/lib/action_kit_rest/tag.rb +20 -0
- data/lib/action_kit_rest/user.rb +7 -0
- data/lib/action_kit_rest/version.rb +10 -0
- data/spec/action_kit_rest/logger_spec.rb +20 -0
- data/spec/action_kit_rest/page_spec.rb +87 -0
- data/spec/action_kit_rest/pages/input_page_spec.rb +55 -0
- data/spec/action_kit_rest/user_spec.rb +32 -0
- data/spec/fixtures/error.json +1 -0
- data/spec/fixtures/page/collection.json +984 -0
- data/spec/fixtures/page/object.json +18 -0
- data/spec/fixtures/user/object.json +1 -0
- data/spec/spec_helper.rb +43 -0
- metadata +237 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
{"actions": "/rest/v1/petitionaction/?page=1", "allow_multiple_responses": false, "cms_form": "/rest/v1/petitionform/1/", "created_at": "2009-06-26T18:14:25", "delivery_template": "", "fields": {}, "followup": {
|
2
|
+
"email_body": "<p>Dear {{user.first_name}},</p>\r\n<p>Thank you for signing!</p>\r\n<p>Best,</p>\r\n<p>Food Democracy Now</p>",
|
3
|
+
"email_custom_from": "",
|
4
|
+
"email_from_line": "/rest/v1/fromline/1/",
|
5
|
+
"email_subject": "Thanks for demanding a sustainable USDA",
|
6
|
+
"email_wrapper": "/rest/v1/emailwrapper/1/",
|
7
|
+
"id": 1,
|
8
|
+
"notifications": [],
|
9
|
+
"page": "/rest/v1/petitionpage/1/",
|
10
|
+
"resource_uri": "/rest/v1/pagefollowup/1/",
|
11
|
+
"send_email": true,
|
12
|
+
"send_notifications": false,
|
13
|
+
"send_pushes": false,
|
14
|
+
"send_taf": true,
|
15
|
+
"taf_body": "Sample tellafriend content",
|
16
|
+
"taf_subject": "Sample tellafriend message",
|
17
|
+
"url": "/cms/thanks/usda/"
|
18
|
+
}, "goal": 10, "goal_type": "actions", "hidden": false, "hosted_with": "/rest/v1/hostingplatform/1/", "id": 1, "immediate_email_subject": "", "language": "/rest/v1/language/100/", "list": "/rest/v1/list/1/", "multilingual_campaign": null, "name": "usda", "one_click": false, "recognize": "once", "required_fields": [], "resource_uri": "/rest/v1/petitionpage/1/", "send_immediate_email": false, "send_immediate_email_override_limit": false, "send_immediate_fax": false, "status": "active", "tags": [], "title": "Demand a Sustainable USDA", "type": "Petition", "updated_at": "2012-07-19T13:45:39", "url": ""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"actions": "/rest/v1/action/?user=1", "address1": "", "address2": "", "city": "Philadelphia", "country": "United States", "created_at": "2009-09-02T18:42:54", "email": "walkers@wawd.com", "events": "/rest/v1/event/?user=1", "eventsignups": "/rest/v1/eventsignup/?user=1", "fields": {"abc1": "2012-07-09 22:22:38", "abc2": "1", "abc4": "808003061", "abc5": "100", "abc6": "unsubscribed", "abc8": "roboticdogs", "color": ["blue", "yellow"], "food": "meatloaf", "test_custom": "\">la la la"}, "first_name": "", "id": 1, "lang": "/rest/v1/language/100/", "last_name": "", "location": "/rest/v1/location/1/", "middle_name": "", "orderrecurrings": "/rest/v1/orderrecurring/?user=1", "orders": "/rest/v1/order/?user=1", "phones": ["/rest/v1/phone/83/", "/rest/v1/phone/12/"], "plus4": "", "postal": "19130", "prefix": "", "rand_id": 382815937, "region": "PA", "resource_uri": "/rest/v1/user/1/", "source": "", "state": "PA", "subscription_status": "unsubscribed", "subscriptionhistory": "/rest/v1/subscriptionhistory/?user=1", "subscriptions": "/rest/v1/subscription/?user=1", "suffix": "", "token": ".1.9P66-W", "updated_at": "2013-10-02T00:56:36", "usergeofields": "/rest/v1/usergeofield/?user=1", "usermailings": "/rest/v1/usermailing/?user=1", "useroriginal": "/rest/v1/useroriginal/1/", "zip": "19130"}
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'webmock/rspec'
|
3
|
+
|
4
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
5
|
+
|
6
|
+
require 'action_kit_rest'
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.include WebMock::API
|
10
|
+
|
11
|
+
config.before(:each) do
|
12
|
+
WebMock.reset!
|
13
|
+
end
|
14
|
+
config.after(:each) do
|
15
|
+
WebMock.reset!
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
def stub_get(path)
|
21
|
+
stub_action_kit_request(:get, path)
|
22
|
+
end
|
23
|
+
|
24
|
+
def stub_post(path)
|
25
|
+
stub_action_kit_request(:post, path)
|
26
|
+
end
|
27
|
+
|
28
|
+
def stub_put(path)
|
29
|
+
stub_action_kit_request(:put, path)
|
30
|
+
end
|
31
|
+
|
32
|
+
def stub_action_kit_request(method, path)
|
33
|
+
prefix = ActionKitRest.new.connection.configuration.prefix.to_s
|
34
|
+
stub_request(method, 'https://test.com' + prefix + path)
|
35
|
+
end
|
36
|
+
|
37
|
+
def fixture_path
|
38
|
+
File.expand_path("../fixtures", __FILE__)
|
39
|
+
end
|
40
|
+
|
41
|
+
def fixture(file)
|
42
|
+
File.new(File.join(fixture_path, '/', file))
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,237 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: action_kit_rest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nathan Woodhull
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: action_kit_rest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: guard
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: guard-rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-debugger
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rb-fsevent
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rdoc
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: bundler
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: webmock
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ! '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: jeweler
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ~>
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.8.4
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ~>
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.8.4
|
167
|
+
description: Gem for interacting with the ActionKit API
|
168
|
+
email: woodhull@gmail.com
|
169
|
+
executables: []
|
170
|
+
extensions: []
|
171
|
+
extra_rdoc_files:
|
172
|
+
- LICENSE.txt
|
173
|
+
- README.md
|
174
|
+
files:
|
175
|
+
- .document
|
176
|
+
- .rspec
|
177
|
+
- .ruby-gemset
|
178
|
+
- .ruby-version
|
179
|
+
- Gemfile
|
180
|
+
- Gemfile.lock
|
181
|
+
- LICENSE.txt
|
182
|
+
- README.md
|
183
|
+
- Rakefile
|
184
|
+
- VERSION
|
185
|
+
- action_kit_rest.gemspec
|
186
|
+
- lib/action_kit_rest.rb
|
187
|
+
- lib/action_kit_rest/action.rb
|
188
|
+
- lib/action_kit_rest/api.rb
|
189
|
+
- lib/action_kit_rest/base.rb
|
190
|
+
- lib/action_kit_rest/client.rb
|
191
|
+
- lib/action_kit_rest/list.rb
|
192
|
+
- lib/action_kit_rest/page.rb
|
193
|
+
- lib/action_kit_rest/pages/base.rb
|
194
|
+
- lib/action_kit_rest/pages/import_page.rb
|
195
|
+
- lib/action_kit_rest/pages/signup_page.rb
|
196
|
+
- lib/action_kit_rest/railties.rb
|
197
|
+
- lib/action_kit_rest/response/collection.rb
|
198
|
+
- lib/action_kit_rest/response/raise_error.rb
|
199
|
+
- lib/action_kit_rest/response/validation_error.rb
|
200
|
+
- lib/action_kit_rest/response/wrapper.rb
|
201
|
+
- lib/action_kit_rest/tag.rb
|
202
|
+
- lib/action_kit_rest/user.rb
|
203
|
+
- lib/action_kit_rest/version.rb
|
204
|
+
- spec/action_kit_rest/logger_spec.rb
|
205
|
+
- spec/action_kit_rest/page_spec.rb
|
206
|
+
- spec/action_kit_rest/pages/input_page_spec.rb
|
207
|
+
- spec/action_kit_rest/user_spec.rb
|
208
|
+
- spec/fixtures/error.json
|
209
|
+
- spec/fixtures/page/collection.json
|
210
|
+
- spec/fixtures/page/object.json
|
211
|
+
- spec/fixtures/user/object.json
|
212
|
+
- spec/spec_helper.rb
|
213
|
+
homepage: http://github.com/controlshift/action_kit_rest
|
214
|
+
licenses:
|
215
|
+
- MIT
|
216
|
+
metadata: {}
|
217
|
+
post_install_message:
|
218
|
+
rdoc_options: []
|
219
|
+
require_paths:
|
220
|
+
- lib
|
221
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - ! '>='
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '0'
|
226
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
|
+
requirements:
|
228
|
+
- - ! '>='
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
231
|
+
requirements: []
|
232
|
+
rubyforge_project:
|
233
|
+
rubygems_version: 2.0.7
|
234
|
+
signing_key:
|
235
|
+
specification_version: 4
|
236
|
+
summary: A wrapper for the ActionKit REST API
|
237
|
+
test_files: []
|