ractive_campaign 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +69 -55
- data/lib/active_campaign/models/contact.rb +13 -3
- data/lib/active_campaign/models/tag.rb +6 -0
- data/lib/active_campaign/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9408a43bb84b20b2b675f9b82726ea2766db83be2a8197e02ea2682f623aee4b
|
4
|
+
data.tar.gz: 70b0e772adc7678ae9f356abc1a1f3757d10b457a4dececefe0fbb77e22da2ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2d039ee5f958c807e93e4af17bf06a5078846c272899d55dedaece4a9da5b1a78c80c5d337837c9cb8da019822a718e5dbbc4636cb4ea39cd88f281d32edf1
|
7
|
+
data.tar.gz: 35dba20d5d097abf722d7cd712188e97bbae69c5c34437f1799d41570a8ec0b37ae07ae5ad2a2cae5a30964bf93ba18bc30f045c9a6198a3c110e5d0d01cbd7b
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.6] - 2024-080-29
|
4
|
+
### Changed
|
5
|
+
|
6
|
+
- update ruby version to 2.7
|
7
|
+
|
8
|
+
## [0.1.5] - 2021-11-19
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- when adding a tag to a contact, create it if it doesn't exist
|
12
|
+
|
3
13
|
## [0.1.4] - 2021-11-19
|
4
14
|
### Changed
|
5
15
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ractive_campaign (0.1.
|
4
|
+
ractive_campaign (0.1.6)
|
5
5
|
activemodel (~> 6.1.4)
|
6
6
|
dry-configurable (~> 0.12.1)
|
7
7
|
faraday (~> 1.8.0)
|
@@ -10,29 +10,33 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activemodel (6.1.
|
14
|
-
activesupport (= 6.1.
|
15
|
-
activesupport (6.1.
|
13
|
+
activemodel (6.1.7.8)
|
14
|
+
activesupport (= 6.1.7.8)
|
15
|
+
activesupport (6.1.7.8)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
17
|
i18n (>= 1.6, < 2)
|
18
18
|
minitest (>= 5.1)
|
19
19
|
tzinfo (~> 2.0)
|
20
20
|
zeitwerk (~> 2.3)
|
21
|
-
addressable (2.8.
|
22
|
-
public_suffix (>= 2.0.2, <
|
21
|
+
addressable (2.8.7)
|
22
|
+
public_suffix (>= 2.0.2, < 7.0)
|
23
23
|
ast (2.4.2)
|
24
|
+
base64 (0.2.0)
|
25
|
+
bigdecimal (3.1.8)
|
24
26
|
byebug (11.1.3)
|
25
27
|
coderay (1.1.3)
|
26
|
-
concurrent-ruby (1.
|
27
|
-
crack (0.
|
28
|
+
concurrent-ruby (1.3.4)
|
29
|
+
crack (1.0.0)
|
30
|
+
bigdecimal
|
28
31
|
rexml
|
29
|
-
diff-lcs (1.
|
30
|
-
dotenv (
|
32
|
+
diff-lcs (1.5.1)
|
33
|
+
dotenv (3.1.2)
|
31
34
|
dry-configurable (0.12.1)
|
32
35
|
concurrent-ruby (~> 1.0)
|
33
36
|
dry-core (~> 0.5, >= 0.5.0)
|
34
|
-
dry-core (0.
|
37
|
+
dry-core (0.9.1)
|
35
38
|
concurrent-ruby (~> 1.0)
|
39
|
+
zeitwerk (~> 2.6)
|
36
40
|
faraday (1.8.0)
|
37
41
|
faraday-em_http (~> 1.0)
|
38
42
|
faraday-em_synchrony (~> 1.0)
|
@@ -48,73 +52,83 @@ GEM
|
|
48
52
|
faraday-em_synchrony (1.0.0)
|
49
53
|
faraday-excon (1.1.0)
|
50
54
|
faraday-httpclient (1.0.1)
|
51
|
-
faraday-net_http (1.0.
|
55
|
+
faraday-net_http (1.0.2)
|
52
56
|
faraday-net_http_persistent (1.2.0)
|
53
57
|
faraday-patron (1.0.0)
|
54
58
|
faraday-rack (1.0.0)
|
55
59
|
faraday_middleware (1.2.0)
|
56
60
|
faraday (~> 1.0)
|
57
|
-
hashdiff (1.
|
58
|
-
httplog (1.
|
59
|
-
rack (>=
|
61
|
+
hashdiff (1.1.1)
|
62
|
+
httplog (1.7.0)
|
63
|
+
rack (>= 2.0)
|
60
64
|
rainbow (>= 2.0.0)
|
61
|
-
i18n (1.
|
65
|
+
i18n (1.14.5)
|
62
66
|
concurrent-ruby (~> 1.0)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
67
|
+
json (2.7.2)
|
68
|
+
language_server-protocol (3.17.0.3)
|
69
|
+
method_source (1.1.0)
|
70
|
+
minitest (5.25.1)
|
71
|
+
multipart-post (2.4.1)
|
72
|
+
parallel (1.26.3)
|
73
|
+
parser (3.3.4.2)
|
68
74
|
ast (~> 2.4.1)
|
69
|
-
|
75
|
+
racc
|
76
|
+
pry (0.14.2)
|
70
77
|
coderay (~> 1.1)
|
71
78
|
method_source (~> 1.0)
|
72
|
-
pry-byebug (3.
|
79
|
+
pry-byebug (3.10.1)
|
73
80
|
byebug (~> 11.0)
|
74
|
-
pry (
|
75
|
-
public_suffix (
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
rspec-
|
85
|
-
|
86
|
-
rspec-
|
87
|
-
rspec-
|
81
|
+
pry (>= 0.13, < 0.15)
|
82
|
+
public_suffix (6.0.1)
|
83
|
+
racc (1.8.1)
|
84
|
+
rack (3.1.7)
|
85
|
+
rainbow (3.1.1)
|
86
|
+
rake (13.2.1)
|
87
|
+
regexp_parser (2.9.2)
|
88
|
+
rexml (3.3.6)
|
89
|
+
strscan
|
90
|
+
rspec (3.13.0)
|
91
|
+
rspec-core (~> 3.13.0)
|
92
|
+
rspec-expectations (~> 3.13.0)
|
93
|
+
rspec-mocks (~> 3.13.0)
|
94
|
+
rspec-core (3.13.0)
|
95
|
+
rspec-support (~> 3.13.0)
|
96
|
+
rspec-expectations (3.13.2)
|
88
97
|
diff-lcs (>= 1.2.0, < 2.0)
|
89
|
-
rspec-support (~> 3.
|
90
|
-
rspec-mocks (3.
|
98
|
+
rspec-support (~> 3.13.0)
|
99
|
+
rspec-mocks (3.13.1)
|
91
100
|
diff-lcs (>= 1.2.0, < 2.0)
|
92
|
-
rspec-support (~> 3.
|
93
|
-
rspec-support (3.
|
94
|
-
rubocop (1.
|
101
|
+
rspec-support (~> 3.13.0)
|
102
|
+
rspec-support (3.13.1)
|
103
|
+
rubocop (1.65.1)
|
104
|
+
json (~> 2.3)
|
105
|
+
language_server-protocol (>= 3.17.0)
|
95
106
|
parallel (~> 1.10)
|
96
|
-
parser (>= 3.
|
107
|
+
parser (>= 3.3.0.2)
|
97
108
|
rainbow (>= 2.2.2, < 4.0)
|
98
|
-
regexp_parser (>=
|
99
|
-
rexml
|
100
|
-
rubocop-ast (>= 1.
|
109
|
+
regexp_parser (>= 2.4, < 3.0)
|
110
|
+
rexml (>= 3.2.5, < 4.0)
|
111
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
101
112
|
ruby-progressbar (~> 1.7)
|
102
|
-
unicode-display_width (>=
|
103
|
-
rubocop-ast (1.
|
104
|
-
parser (>= 3.
|
105
|
-
ruby-progressbar (1.
|
113
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
114
|
+
rubocop-ast (1.32.1)
|
115
|
+
parser (>= 3.3.1.0)
|
116
|
+
ruby-progressbar (1.13.0)
|
106
117
|
ruby2_keywords (0.0.5)
|
107
|
-
|
118
|
+
strscan (3.1.0)
|
119
|
+
tzinfo (2.0.6)
|
108
120
|
concurrent-ruby (~> 1.0)
|
109
|
-
unicode-display_width (2.
|
110
|
-
vcr (6.
|
111
|
-
|
121
|
+
unicode-display_width (2.5.0)
|
122
|
+
vcr (6.3.1)
|
123
|
+
base64
|
124
|
+
webmock (3.23.1)
|
112
125
|
addressable (>= 2.8.0)
|
113
126
|
crack (>= 0.3.2)
|
114
127
|
hashdiff (>= 0.4.0, < 2.0.0)
|
115
|
-
zeitwerk (2.
|
128
|
+
zeitwerk (2.6.17)
|
116
129
|
|
117
130
|
PLATFORMS
|
131
|
+
arm64-darwin-21
|
118
132
|
x86_64-linux
|
119
133
|
|
120
134
|
DEPENDENCIES
|
@@ -24,14 +24,22 @@ module ActiveCampaign
|
|
24
24
|
ContactTag.get "#{self.class.endpoint}/#{id}/contactTags"
|
25
25
|
end
|
26
26
|
|
27
|
-
# @example
|
27
|
+
# @example Add a tag to a contact.
|
28
28
|
#
|
29
29
|
# ActiveCampaign::Contact.find(1).add_tag "tag-name"
|
30
30
|
#
|
31
|
-
|
31
|
+
# Don't create the tag if it doesn't exist.
|
32
|
+
#
|
33
|
+
# ActiveCampaign::Contact.find(1).add_tag "tag-name", create_if_not_found: false
|
34
|
+
#
|
35
|
+
def add_tag(tag, create_if_not_found: true)
|
32
36
|
tag_id = Tag.find_by(tag: tag)&.id
|
33
37
|
|
34
|
-
ActiveCampaign::
|
38
|
+
tag_id = ActiveCampaign::Tag.create(tag: tag)&.id if !tag_id && create_if_not_found
|
39
|
+
|
40
|
+
return false unless tag_id
|
41
|
+
|
42
|
+
ActiveCampaign::ContactTag.create contact: id, tag: tag_id
|
35
43
|
end
|
36
44
|
|
37
45
|
# @example Remove a tag from a contact.
|
@@ -41,6 +49,8 @@ module ActiveCampaign
|
|
41
49
|
def remove_tag(tag)
|
42
50
|
tag_id = Tag.find_by(tag: tag)&.id
|
43
51
|
|
52
|
+
return false unless tag_id
|
53
|
+
|
44
54
|
contact_tag = contact_tags.filter_map { |ct| ct if ct.tag == tag_id }.last
|
45
55
|
|
46
56
|
contact_tag&.destroy
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ractive_campaign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wedson Lima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -122,6 +122,7 @@ metadata:
|
|
122
122
|
homepage_uri: https://github.com/wedsonlima/ractive_campaign
|
123
123
|
source_code_uri: https://github.com/wedsonlima/ractive_campaign
|
124
124
|
changelog_uri: https://github.com/wedsonlima/ractive_campaign/blob/main/CHANGELOG.md
|
125
|
+
documentation_uri: https://www.rubydoc.info/gems/ractive_campaign/0.1.6
|
125
126
|
post_install_message:
|
126
127
|
rdoc_options: []
|
127
128
|
require_paths:
|
@@ -130,14 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
131
|
requirements:
|
131
132
|
- - ">="
|
132
133
|
- !ruby/object:Gem::Version
|
133
|
-
version: 2.
|
134
|
+
version: 2.7.8
|
134
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
136
|
requirements:
|
136
137
|
- - ">="
|
137
138
|
- !ruby/object:Gem::Version
|
138
139
|
version: '0'
|
139
140
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.1.6
|
141
142
|
signing_key:
|
142
143
|
specification_version: 4
|
143
144
|
summary: Ruby API wrapper for ActiveCampaign API v3
|