send_with_us 1.2.1 → 1.2.3
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/.gitignore +1 -0
- data/Gemfile +13 -0
- data/lib/send_with_us.rb +1 -1
- data/lib/send_with_us/api.rb +8 -8
- data/lib/send_with_us/version.rb +1 -1
- data/test/lib/send_with_us/api_request_test.rb +6 -5
- metadata +13 -6
- checksums.yaml +0 -15
- data/Gemfile.lock +0 -35
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,4 +1,17 @@
|
|
1
|
+
# gem "rails"
|
1
2
|
source 'https://rubygems.org'
|
2
3
|
|
3
4
|
# Specify your gem's dependencies in send_with_us.gemspec
|
4
5
|
gemspec
|
6
|
+
|
7
|
+
# Test Dependencies
|
8
|
+
gem 'mocha', '0.10.5'
|
9
|
+
gem 'i18n', '0.6.1'
|
10
|
+
gem 'rake', '10.0.3'
|
11
|
+
gem 'multi_json', '1.5.0'
|
12
|
+
gem 'metaclass', '0.0.1'
|
13
|
+
gem 'shoulda-context', '1.0.2'
|
14
|
+
gem 'activesupport', '3.2.11'
|
15
|
+
gem 'bourne', '1.1.2'
|
16
|
+
gem 'shoulda-matchers', '1.4.2'
|
17
|
+
gem 'shoulda', '3.3.2'
|
data/lib/send_with_us.rb
CHANGED
data/lib/send_with_us/api.rb
CHANGED
@@ -104,9 +104,9 @@ module SendWithUs
|
|
104
104
|
recipient_address: recipient_address,
|
105
105
|
email_data: email_data
|
106
106
|
}.to_json
|
107
|
-
|
107
|
+
end
|
108
108
|
|
109
|
-
SendWithUs::ApiRequest.new(@configuration).post(
|
109
|
+
SendWithUs::ApiRequest.new(@configuration).post("drip_campaigns/#{drip_campaign_id}/activate", payload)
|
110
110
|
end
|
111
111
|
|
112
112
|
def remove_from_drip_campaign(recipient_address, drip_campaign_id)
|
@@ -114,21 +114,21 @@ module SendWithUs
|
|
114
114
|
recipient_address: recipient_address
|
115
115
|
}.to_json
|
116
116
|
|
117
|
-
SendWithUs::ApiRequest.new(@configuration).post(
|
117
|
+
SendWithUs::ApiRequest.new(@configuration).post("drip_campaigns/#{drip_campaign_id}/deactivate", payload)
|
118
118
|
end
|
119
119
|
|
120
120
|
def drip_campaign_details(drip_campaign_id)
|
121
|
-
SendWithUs::ApiRequest.new(@configuration).get(
|
121
|
+
SendWithUs::ApiRequest.new(@configuration).get("drip_campaigns/#{drip_campaign_id}")
|
122
122
|
end
|
123
|
-
|
123
|
+
|
124
124
|
def list_customers_on_campaign(drip_campaign_id)
|
125
|
-
SendWithUs::ApiRequest.new(@configuration).get(
|
125
|
+
SendWithUs::ApiRequest.new(@configuration).get("drip_campaigns/#{drip_campaign_id}/customers")
|
126
126
|
end
|
127
127
|
|
128
128
|
def list_customers_on_campaign_step(drip_campaign_id, drip_campaign_step_id)
|
129
|
-
SendWithUs::ApiRequest.new(@configuration).get(
|
129
|
+
SendWithUs::ApiRequest.new(@configuration).get("drip_campaigns/#{drip_campaign_id}/step/#{drip_campaign_step_id}/customers")
|
130
130
|
end
|
131
|
-
|
131
|
+
|
132
132
|
def add_customer_event(customer, event_name, revenue=nil)
|
133
133
|
|
134
134
|
if revenue.nil?
|
data/lib/send_with_us/version.rb
CHANGED
@@ -7,6 +7,7 @@ class TestApiRequest < MiniTest::Unit::TestCase
|
|
7
7
|
@api = SendWithUs::Api.new( api_key: 'THIS_IS_A_TEST_API_KEY', debug: false)
|
8
8
|
@config = SendWithUs::Config.new( api_version: '1_0', api_key: 'THIS_IS_A_TEST_API_KEY', debug: false )
|
9
9
|
@request = SendWithUs::ApiRequest.new(@config)
|
10
|
+
@drip_campaign = { :drip_campaign_id => 'dc_Rmd7y5oUJ3tn86sPJ8ESCk', :drip_campaign_step_id => 'dcs_yaAMiZNWCLAEGw7GLjBuGY' }
|
10
11
|
end
|
11
12
|
|
12
13
|
def test_payload
|
@@ -98,31 +99,31 @@ class TestApiRequest < MiniTest::Unit::TestCase
|
|
98
99
|
def test_start_on_drip_campaign
|
99
100
|
build_objects
|
100
101
|
Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
|
101
|
-
assert_instance_of( Net::HTTPSuccess, @request.post(
|
102
|
+
assert_instance_of( Net::HTTPSuccess, @request.post("drip_campaigns/#{@drip_campaign[:drip_campaign_id]}/activate", @payload) )
|
102
103
|
end
|
103
104
|
|
104
105
|
def test_remove_from_drip_campaign
|
105
106
|
build_objects
|
106
107
|
Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
|
107
|
-
assert_instance_of( Net::HTTPSuccess, @request.post(
|
108
|
+
assert_instance_of( Net::HTTPSuccess, @request.post("drip_campaigns/#{@drip_campaign[:drip_campaign_id]}/deactivate", @payload) )
|
108
109
|
end
|
109
110
|
|
110
111
|
def test_drip_campaign_details
|
111
112
|
build_objects
|
112
113
|
Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
|
113
|
-
assert_instance_of( Net::HTTPSuccess, @request.get(
|
114
|
+
assert_instance_of( Net::HTTPSuccess, @request.get("drip_campaigns/#{@drip_campaign[:drip_campaign_id]}") )
|
114
115
|
end
|
115
116
|
|
116
117
|
def test_list_customers_on_campaign
|
117
118
|
build_objects
|
118
119
|
Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
|
119
|
-
assert_instance_of( Net::HTTPSuccess, @request.get(
|
120
|
+
assert_instance_of( Net::HTTPSuccess, @request.get("drip_campaigns/#{@drip_campaign[:drip_campaign_id]}/customers") )
|
120
121
|
end
|
121
122
|
|
122
123
|
def test_list_customers_on_campaign_step
|
123
124
|
build_objects
|
124
125
|
Net::HTTP.any_instance.stubs(:request).returns(Net::HTTPSuccess.new(1.0, 200, "OK"))
|
125
|
-
assert_instance_of( Net::HTTPSuccess, @request.get(
|
126
|
+
assert_instance_of( Net::HTTPSuccess, @request.get("drip_campaigns/#{@drip_campaign[:drip_campaign_id]}/step/#{@drip_campaign[:drip_campaign_step_id]}/customers") )
|
126
127
|
end
|
127
128
|
|
128
129
|
def test_request_path
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: send_with_us
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Matt Harris
|
@@ -10,11 +11,12 @@ authors:
|
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2014-10-
|
14
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: rake
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
18
20
|
requirements:
|
19
21
|
- - ! '>='
|
20
22
|
- !ruby/object:Gem::Version
|
@@ -22,6 +24,7 @@ dependencies:
|
|
22
24
|
type: :development
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
29
|
- - ! '>='
|
27
30
|
- !ruby/object:Gem::Version
|
@@ -29,6 +32,7 @@ dependencies:
|
|
29
32
|
- !ruby/object:Gem::Dependency
|
30
33
|
name: shoulda
|
31
34
|
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
32
36
|
requirements:
|
33
37
|
- - ! '>='
|
34
38
|
- !ruby/object:Gem::Version
|
@@ -36,6 +40,7 @@ dependencies:
|
|
36
40
|
type: :development
|
37
41
|
prerelease: false
|
38
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
39
44
|
requirements:
|
40
45
|
- - ! '>='
|
41
46
|
- !ruby/object:Gem::Version
|
@@ -43,6 +48,7 @@ dependencies:
|
|
43
48
|
- !ruby/object:Gem::Dependency
|
44
49
|
name: mocha
|
45
50
|
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
46
52
|
requirements:
|
47
53
|
- - ! '>='
|
48
54
|
- !ruby/object:Gem::Version
|
@@ -50,6 +56,7 @@ dependencies:
|
|
50
56
|
type: :development
|
51
57
|
prerelease: false
|
52
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
53
60
|
requirements:
|
54
61
|
- - ! '>='
|
55
62
|
- !ruby/object:Gem::Version
|
@@ -65,7 +72,6 @@ files:
|
|
65
72
|
- .travis.yml
|
66
73
|
- CHANGELOG.md
|
67
74
|
- Gemfile
|
68
|
-
- Gemfile.lock
|
69
75
|
- LICENSE
|
70
76
|
- NOTICE
|
71
77
|
- README.md
|
@@ -84,26 +90,27 @@ files:
|
|
84
90
|
homepage: https://github.com/sendwithus/sendwithus_ruby
|
85
91
|
licenses:
|
86
92
|
- Apache-2.0
|
87
|
-
metadata: {}
|
88
93
|
post_install_message:
|
89
94
|
rdoc_options: []
|
90
95
|
require_paths:
|
91
96
|
- lib
|
92
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
93
99
|
requirements:
|
94
100
|
- - ! '>='
|
95
101
|
- !ruby/object:Gem::Version
|
96
102
|
version: '0'
|
97
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
98
105
|
requirements:
|
99
106
|
- - ! '>='
|
100
107
|
- !ruby/object:Gem::Version
|
101
108
|
version: '0'
|
102
109
|
requirements: []
|
103
110
|
rubyforge_project:
|
104
|
-
rubygems_version:
|
111
|
+
rubygems_version: 1.8.23.2
|
105
112
|
signing_key:
|
106
|
-
specification_version:
|
113
|
+
specification_version: 3
|
107
114
|
summary: SendWithUs.com Ruby Client
|
108
115
|
test_files:
|
109
116
|
- test/lib/send_with_us/api_request_test.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
YzhjOWQ4MWU0N2I0ZDJhY2Q4MWQ3YTIyN2Q2YjAwN2Q3NThhMThlMQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MjA4NGZlZjM1Njg2MmNkM2FhNGI4YzYzMDRiZDNkNDI5MjRkMTdlMg==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YjUwODIxOWM2NTkzNzFmNTE5NjU4MDFlZGVkMTczZTllYjZiMTk0ZTMzZDg1
|
10
|
-
M2RjM2E4ZDUyN2MyY2YzNTFhYmMwNjdiZmVlMjI0YmJkMjQ0NzMxNzVjYjEx
|
11
|
-
MTBhNDBiMzU5ZDExNDY4MDNkNGNiMzAxNGM0NjVhMTQyM2FmMjc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NTlmY2RkNzcwN2ZmODM4N2MxZDg5YWUwM2IwZThlNjMyNjViMGI3OTlmNjZl
|
14
|
-
YWYyYjYzODY0ZmFkMjI4Y2E2Mzc3ZWFmZmVlOTZjNTdmMGEzYmI4MjA4YmI0
|
15
|
-
MDMxYzQwYWQ3MDA0ZjkxZWIyOGY3ZjAwOGU5OWMwMDM1ZjU4OTE=
|
data/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
send_with_us (1.2.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
activesupport (3.2.11)
|
10
|
-
i18n (~> 0.6)
|
11
|
-
multi_json (~> 1.0)
|
12
|
-
bourne (1.1.2)
|
13
|
-
mocha (= 0.10.5)
|
14
|
-
i18n (0.6.1)
|
15
|
-
metaclass (0.0.1)
|
16
|
-
mocha (0.10.5)
|
17
|
-
metaclass (~> 0.0.1)
|
18
|
-
multi_json (1.5.0)
|
19
|
-
rake (10.0.3)
|
20
|
-
shoulda (3.3.2)
|
21
|
-
shoulda-context (~> 1.0.1)
|
22
|
-
shoulda-matchers (~> 1.4.1)
|
23
|
-
shoulda-context (1.0.2)
|
24
|
-
shoulda-matchers (1.4.2)
|
25
|
-
activesupport (>= 3.0.0)
|
26
|
-
bourne (~> 1.1.2)
|
27
|
-
|
28
|
-
PLATFORMS
|
29
|
-
ruby
|
30
|
-
|
31
|
-
DEPENDENCIES
|
32
|
-
mocha
|
33
|
-
rake
|
34
|
-
send_with_us!
|
35
|
-
shoulda
|