braze_ruby 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.github/workflows/release.yml +3 -1
- data/.rspec +2 -0
- data/CHANGELOG.md +126 -0
- data/LICENSE.txt +1 -1
- data/README.md +40 -6
- data/bin/console +10 -0
- data/bin/release +1 -11
- data/braze_ruby.gemspec +2 -2
- data/lib/braze_ruby/api.rb +4 -4
- data/lib/braze_ruby/rest/canvas_details.rb +1 -1
- data/lib/braze_ruby/rest/email_hard_bounces.rb +1 -1
- data/lib/braze_ruby/rest/email_status.rb +1 -1
- data/lib/braze_ruby/rest/email_unsubscribes.rb +1 -1
- data/lib/braze_ruby/rest/schedule_messages.rb +1 -1
- data/lib/braze_ruby/rest/scheduled_broadcasts.rb +1 -1
- data/lib/braze_ruby/rest/send_messages.rb +1 -1
- data/lib/braze_ruby/rest/subscription_status_get.rb +1 -1
- data/lib/braze_ruby/rest/subscription_status_set.rb +1 -1
- data/lib/braze_ruby/rest/subscription_user_status.rb +1 -1
- data/lib/braze_ruby/rest/trigger_campaign_schedule.rb +1 -1
- data/lib/braze_ruby/rest/trigger_campaign_send.rb +1 -1
- data/lib/braze_ruby/rest/trigger_canvas_send.rb +1 -1
- data/lib/braze_ruby/version.rb +1 -1
- data/lib/braze_ruby.rb +4 -0
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d93e632f509eb5ccaef744c1e378092fc25c68829f0819524484c1612e5438
|
4
|
+
data.tar.gz: f3827d451cf7ba1d424a23365676c74e83d0d3e999a0dfc295bacc0240de4261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc3543daf80e77fa1a59d0cbcb11825ca0078426c02802dc7acd66b48f9e745baaa0a0e7f19b86c22c7678b0732c9a04d53fbe92e521daa50e32734f12298b78
|
7
|
+
data.tar.gz: 89d604660de041f123a0d051d1a075d9b51ccf389e6e2342966657ea557aa6408fc149340855523d23454106d2efba65fbb8881cb1c63cf29aad27bb9b8c042f
|
data/.circleci/config.yml
CHANGED
data/.rspec
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog][] and this project adheres to
|
6
|
+
[Semantic Versioning][].
|
7
|
+
|
8
|
+
[Keep a Changelog]: https://keepachangelog.com
|
9
|
+
[Semantic Versioning]: https://semver.org
|
10
|
+
|
11
|
+
## [Unreleased][]
|
12
|
+
|
13
|
+
### Added
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
### Deprecated
|
18
|
+
|
19
|
+
### Removed
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
|
23
|
+
### Security
|
24
|
+
|
25
|
+
## [0.9.0][] - 2024-10-25
|
26
|
+
|
27
|
+
### Added
|
28
|
+
|
29
|
+
* Add a CHANGELOG ([#61][])
|
30
|
+
* Add console script ([#63][])
|
31
|
+
|
32
|
+
### Changed
|
33
|
+
|
34
|
+
* Improve configuration support ([#64][])
|
35
|
+
* Improve release script ([#65][])
|
36
|
+
|
37
|
+
### Fixed
|
38
|
+
|
39
|
+
* Fix CircleCI builds ([#62][])
|
40
|
+
|
41
|
+
## [0.8.0][] - 2022-01-24
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
* Add a Configuration class ([#42][])
|
46
|
+
* Add an endpoint for messages that are scheduled ([#43][])
|
47
|
+
* Document #scheduled_messages ([#45][])
|
48
|
+
* Add support for deleting scheduled triggers ([#47][])
|
49
|
+
|
50
|
+
### Changed
|
51
|
+
|
52
|
+
* Standardize rest test code structure ([#44][])
|
53
|
+
|
54
|
+
### Fixed
|
55
|
+
|
56
|
+
* Fix typo in README code example ([#46][])
|
57
|
+
|
58
|
+
## [0.7.0][] - 2021-09-29
|
59
|
+
|
60
|
+
### Added
|
61
|
+
|
62
|
+
* Add campaign scheduling endpoint ([#41][])
|
63
|
+
|
64
|
+
### Fixed
|
65
|
+
|
66
|
+
* Fix syntax error in "send campaigns" example ([#38][])
|
67
|
+
|
68
|
+
## [0.6.0][] - 2021-07-23
|
69
|
+
|
70
|
+
### Added
|
71
|
+
|
72
|
+
* Add retry configuration pass through ([#31][])
|
73
|
+
* Endpoint for 'remove email address from spam' ([#32][])
|
74
|
+
* Ability to set Faraday connection options ([#34][])
|
75
|
+
|
76
|
+
### Changed
|
77
|
+
|
78
|
+
* Publish via GitHub actions ([#36][])
|
79
|
+
* Allow options when exporting users by ids ([#37][])
|
80
|
+
|
81
|
+
## [0.5.0][] - 2021-05-06
|
82
|
+
|
83
|
+
### Added
|
84
|
+
|
85
|
+
* Add .circleci/config.yml ([#25][])
|
86
|
+
* Setup and comply with standardrb ([#28][])
|
87
|
+
* Add release workflow to publish gem from CI ([#29][])
|
88
|
+
* Add script to help automate releases ([#30][])
|
89
|
+
|
90
|
+
### Changed
|
91
|
+
|
92
|
+
* Modernize a few files and tinker with CI setup ([#26][])
|
93
|
+
* Update authors and license ([#27][])
|
94
|
+
|
95
|
+
[Unreleased]: https://github.com/jonallured/braze_ruby/compare/v0.9.0...HEAD
|
96
|
+
|
97
|
+
[0.5.0]: https://github.com/jonallured/braze_ruby/releases/tag/v0.5.0
|
98
|
+
[0.6.0]: https://github.com/jonallured/braze_ruby/releases/tag/v0.6.0
|
99
|
+
[0.7.0]: https://github.com/jonallured/braze_ruby/releases/tag/v0.7.0
|
100
|
+
[0.8.0]: https://github.com/jonallured/braze_ruby/releases/tag/v0.8.0
|
101
|
+
[0.9.0]: https://github.com/jonallured/braze_ruby/releases/tag/v0.9.0
|
102
|
+
|
103
|
+
[#25]: https://github.com/jonallured/braze_ruby/pull/25
|
104
|
+
[#26]: https://github.com/jonallured/braze_ruby/pull/26
|
105
|
+
[#27]: https://github.com/jonallured/braze_ruby/pull/27
|
106
|
+
[#28]: https://github.com/jonallured/braze_ruby/pull/28
|
107
|
+
[#29]: https://github.com/jonallured/braze_ruby/pull/29
|
108
|
+
[#30]: https://github.com/jonallured/braze_ruby/pull/30
|
109
|
+
[#31]: https://github.com/jonallured/braze_ruby/pull/31
|
110
|
+
[#32]: https://github.com/jonallured/braze_ruby/pull/32
|
111
|
+
[#34]: https://github.com/jonallured/braze_ruby/pull/34
|
112
|
+
[#36]: https://github.com/jonallured/braze_ruby/pull/36
|
113
|
+
[#37]: https://github.com/jonallured/braze_ruby/pull/37
|
114
|
+
[#38]: https://github.com/jonallured/braze_ruby/pull/38
|
115
|
+
[#41]: https://github.com/jonallured/braze_ruby/pull/41
|
116
|
+
[#42]: https://github.com/jonallured/braze_ruby/pull/42
|
117
|
+
[#43]: https://github.com/jonallured/braze_ruby/pull/43
|
118
|
+
[#44]: https://github.com/jonallured/braze_ruby/pull/44
|
119
|
+
[#45]: https://github.com/jonallured/braze_ruby/pull/45
|
120
|
+
[#46]: https://github.com/jonallured/braze_ruby/pull/46
|
121
|
+
[#47]: https://github.com/jonallured/braze_ruby/pull/47
|
122
|
+
[#61]: https://github.com/jonallured/braze_ruby/pull/61
|
123
|
+
[#62]: https://github.com/jonallured/braze_ruby/pull/62
|
124
|
+
[#63]: https://github.com/jonallured/braze_ruby/pull/63
|
125
|
+
[#64]: https://github.com/jonallured/braze_ruby/pull/64
|
126
|
+
[#65]: https://github.com/jonallured/braze_ruby/pull/65
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -19,22 +19,43 @@ Or install it yourself as:
|
|
19
19
|
|
20
20
|
### Configuration
|
21
21
|
|
22
|
-
Configuration
|
22
|
+
Configuration settings may be passed when a new API object is instantiated:
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
|
25
|
+
api_key = "instance-api-key"
|
26
|
+
braze_url = "instance-braze-url"
|
27
|
+
options = { key: "instance-options" }
|
28
|
+
|
29
|
+
api = BrazeRuby::API.new(api_key, braze_url, options)
|
30
|
+
|
31
|
+
api.api_key
|
32
|
+
# => "instance-api-key"
|
33
|
+
api.braze_url
|
34
|
+
# => "instance-braze-url"
|
35
|
+
api.options
|
36
|
+
# => {:key=>"instance-options"}
|
26
37
|
```
|
27
38
|
|
28
39
|
Alternatively, you can pass your [Braze REST API key][braze_api_key], [Braze
|
29
40
|
REST URL][braze_url], and any required [Faraday options][faraday_options] to the
|
30
|
-
`BrazeRuby::configure` method
|
41
|
+
`BrazeRuby::configure` method. Then, if you instantiate an API object with no
|
42
|
+
arguments it will use these global configuration settings:
|
31
43
|
|
32
44
|
```ruby
|
33
45
|
BrazeRuby.configure do |config|
|
34
|
-
config.rest_api_key =
|
35
|
-
config.rest_url =
|
36
|
-
config.options = {
|
46
|
+
config.rest_api_key = "global-api-key"
|
47
|
+
config.rest_url = "global-braze-url"
|
48
|
+
config.options = { key: "global-options" }
|
37
49
|
end
|
50
|
+
|
51
|
+
api = BrazeRuby::API.new
|
52
|
+
|
53
|
+
api.api_key
|
54
|
+
# => "global-api-key"
|
55
|
+
api.braze_url
|
56
|
+
# => "global-braze-url"
|
57
|
+
api.options
|
58
|
+
# => {:key=>"global-options"}
|
38
59
|
```
|
39
60
|
|
40
61
|
## Examples
|
@@ -307,6 +328,18 @@ export BRAZE_RUBY_DEBUG=true
|
|
307
328
|
bundle exec rails whatever
|
308
329
|
```
|
309
330
|
|
331
|
+
## Releasing
|
332
|
+
|
333
|
+
Before releasing the CHANGELOG should be updated so that the new version has
|
334
|
+
it's own section and an empty Unreleased section is ready for the next change.
|
335
|
+
New versions are released by running a script locally that bumps the minor level
|
336
|
+
of the gem and then pushes to a GitHub Action that actually sends the new
|
337
|
+
version to RubyGems.org:
|
338
|
+
|
339
|
+
```
|
340
|
+
$ ./bin/release
|
341
|
+
```
|
342
|
+
|
310
343
|
## Contributing
|
311
344
|
|
312
345
|
1. Fork it
|
@@ -314,6 +347,7 @@ bundle exec rails whatever
|
|
314
347
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
315
348
|
4. Push to the branch (`git push origin my-new-feature`)
|
316
349
|
5. Create new Pull Request
|
350
|
+
6. Update CHANGELOG
|
317
351
|
|
318
352
|
[badge]: https://circleci.com/gh/jonallured/braze_ruby.svg?style=svg
|
319
353
|
[braze_api_key]: https://www.braze.com/docs/api/api_key/
|
data/bin/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "braze_ruby"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
require "irb"
|
10
|
+
IRB.start(__FILE__)
|
data/bin/release
CHANGED
@@ -1,16 +1,6 @@
|
|
1
1
|
#! /bin/sh
|
2
2
|
set -ex
|
3
3
|
|
4
|
-
|
5
|
-
new_version=$2
|
6
|
-
|
7
|
-
version_files="lib/braze_ruby/version.rb Gemfile.lock"
|
8
|
-
commit_message="Bumping version numbers for $new_version"
|
9
|
-
tag_message="Tagging version $new_version"
|
10
|
-
|
11
|
-
sed -i "" "s/$old_version/$new_version/g" $version_files
|
12
|
-
git add .
|
13
|
-
git commit --message "$commit_message"
|
4
|
+
bundle exec bump minor --tag
|
14
5
|
git push origin main
|
15
|
-
git tag --annotate v$new_version --message "$tag_message"
|
16
6
|
git push origin --tags
|
data/braze_ruby.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "braze_ruby"
|
5
5
|
spec.version = BrazeRuby::VERSION
|
6
6
|
spec.authors = ["Josh Nussbaum", "Hugo Bastien", "Justin Boltz", "Jonathan Allured"]
|
7
|
-
spec.email = %w[josh@godynamo.com hugo@godynamo.com justin.boltz@takl.com jon
|
7
|
+
spec.email = %w[josh@godynamo.com hugo@godynamo.com justin.boltz@takl.com jon@jonallured.com]
|
8
8
|
|
9
9
|
spec.summary = "A wrapper gem for the Braze REST API."
|
10
10
|
spec.description = "Wrapper for Braze API"
|
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
|
|
19
19
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
20
20
|
end
|
21
21
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
22
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
22
|
spec.require_paths = ["lib"]
|
24
23
|
|
25
24
|
spec.add_dependency "faraday"
|
26
25
|
|
26
|
+
spec.add_development_dependency "bump"
|
27
27
|
spec.add_development_dependency "dotenv"
|
28
28
|
spec.add_development_dependency "factory_bot"
|
29
29
|
spec.add_development_dependency "pry"
|
data/lib/braze_ruby/api.rb
CHANGED
@@ -43,10 +43,10 @@ module BrazeRuby
|
|
43
43
|
|
44
44
|
attr_reader :api_key, :braze_url, :options
|
45
45
|
|
46
|
-
def initialize(api_key, braze_url, options =
|
47
|
-
@api_key = api_key || configuration.rest_api_key
|
48
|
-
@braze_url = braze_url || configuration.rest_url
|
49
|
-
@options = options || configuration.options
|
46
|
+
def initialize(api_key = nil, braze_url = nil, options = nil)
|
47
|
+
@api_key = api_key || BrazeRuby.configuration.rest_api_key
|
48
|
+
@braze_url = braze_url || BrazeRuby.configuration.rest_url
|
49
|
+
@options = options || BrazeRuby.configuration.options || {}
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -8,7 +8,7 @@ module BrazeRuby
|
|
8
8
|
def initialize(api_key, braze_url, options, messages: [], external_user_ids: [])
|
9
9
|
@messages = messages
|
10
10
|
@external_user_ids = external_user_ids
|
11
|
-
super
|
11
|
+
super(api_key, braze_url, options)
|
12
12
|
end
|
13
13
|
|
14
14
|
def perform
|
data/lib/braze_ruby/version.rb
CHANGED
data/lib/braze_ruby.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: braze_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nussbaum
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -27,6 +27,20 @@ dependencies:
|
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bump
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
30
44
|
- !ruby/object:Gem::Dependency
|
31
45
|
name: dotenv
|
32
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,7 +158,7 @@ email:
|
|
144
158
|
- josh@godynamo.com
|
145
159
|
- hugo@godynamo.com
|
146
160
|
- justin.boltz@takl.com
|
147
|
-
- jon
|
161
|
+
- jon@jonallured.com
|
148
162
|
executables: []
|
149
163
|
extensions: []
|
150
164
|
extra_rdoc_files: []
|
@@ -155,10 +169,12 @@ files:
|
|
155
169
|
- ".gitignore"
|
156
170
|
- ".rspec"
|
157
171
|
- ".standard.yml"
|
172
|
+
- CHANGELOG.md
|
158
173
|
- Gemfile
|
159
174
|
- LICENSE.txt
|
160
175
|
- README.md
|
161
176
|
- Rakefile
|
177
|
+
- bin/console
|
162
178
|
- bin/release
|
163
179
|
- braze_ruby.gemspec
|
164
180
|
- lib/braze_ruby.rb
|
@@ -228,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
244
|
- !ruby/object:Gem::Version
|
229
245
|
version: '0'
|
230
246
|
requirements: []
|
231
|
-
rubygems_version: 3.
|
247
|
+
rubygems_version: 3.3.5
|
232
248
|
signing_key:
|
233
249
|
specification_version: 4
|
234
250
|
summary: A wrapper gem for the Braze REST API.
|