promoted-ruby-client 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push-pull-requests_check.yml +16 -0
- data/Gemfile.lock +1 -1
- data/dev.md +1 -1
- data/lib/promoted/ruby/client.rb +8 -0
- data/lib/promoted/ruby/client/request_builder.rb +6 -1
- data/lib/promoted/ruby/client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c49d0a2668c2ac163b2fb9bbfb13fcff75d6a4f558b8e62b633bc590d094c269
|
4
|
+
data.tar.gz: c0bc6218512f2883bd2fcbdfc60d4f5a9da05b93a9872bd60c1ce65bbd1d6ec9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d92f40acf137305cbce1c2e66d3f9b40d9ed5d58f97fc84b0beb2a9ecc7a47671316c012c36279bdbed401f8d1f81001dcbf352f70507593c48d14cbd829e6b1
|
7
|
+
data.tar.gz: 0fddc62d1ea650b98653b8f05680d15e9245d0259c835408113c4b4dbab4baa16360735755656d7fec42466e2254bf3fd69e7187f3dbc44e97f1b435b94afbab
|
@@ -0,0 +1,16 @@
|
|
1
|
+
name: Pull-Requests Check
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
Test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.5.1
|
13
|
+
bundler-cache: true
|
14
|
+
|
15
|
+
- name: Build and test with rspec
|
16
|
+
run: bundle exec rspec spec
|
data/Gemfile.lock
CHANGED
data/dev.md
CHANGED
@@ -4,5 +4,5 @@
|
|
4
4
|
2. Get credentials for deployment from 1password.
|
5
5
|
3. Modify `promoted-ruby-client.gemspec`'s push block.
|
6
6
|
4. Run `gem build promoted-ruby-client.gemspec` to generate `gem`.
|
7
|
-
5. Run (using new output) `gem push promoted-ruby-client-0.1.
|
7
|
+
5. Run (using new output) `gem push promoted-ruby-client-0.1.18.gem`
|
8
8
|
6. Update README with new version.
|
data/lib/promoted/ruby/client.rb
CHANGED
@@ -335,6 +335,14 @@ module Promoted
|
|
335
335
|
delivery_request_params = delivery_request_builder.delivery_request_params
|
336
336
|
delivery_request_params[:client_info][:traffic_type] = Promoted::Ruby::Client::TRAFFIC_TYPE['SHADOW']
|
337
337
|
|
338
|
+
begin
|
339
|
+
@pager.validate_paging(delivery_request_builder.full_insertion, delivery_request_builder.request[:paging])
|
340
|
+
rescue InvalidPagingError => err
|
341
|
+
# Invalid input, log and skip.
|
342
|
+
@logger.warn("Shadow traffic call failed with invalid paging #{err}") if @logger
|
343
|
+
return
|
344
|
+
end
|
345
|
+
|
338
346
|
# Call Delivery API and log/ignore errors.
|
339
347
|
start_time = Time.now
|
340
348
|
response = nil
|
@@ -128,7 +128,12 @@ module Promoted
|
|
128
128
|
|
129
129
|
# Only need a copy if there are properties to compact.
|
130
130
|
compact_insertion = insertion.dup
|
131
|
-
|
131
|
+
|
132
|
+
# Let the custom function work with a deep copy of the properties.
|
133
|
+
# There's really no way to work with a shallow copy and still be able
|
134
|
+
# to restore the correct insertion properties after a call to delivery.
|
135
|
+
new_props = Marshal.load(Marshal.dump(insertion[:properties]))
|
136
|
+
compact_insertion[:properties] = compact_func.call(new_props)
|
132
137
|
compact_insertion.clean!
|
133
138
|
return compact_insertion
|
134
139
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promoted-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- scottmcmaster
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -123,6 +123,7 @@ extensions: []
|
|
123
123
|
extra_rdoc_files:
|
124
124
|
- README.md
|
125
125
|
files:
|
126
|
+
- ".github/workflows/push-pull-requests_check.yml"
|
126
127
|
- ".gitignore"
|
127
128
|
- Gemfile
|
128
129
|
- Gemfile.lock
|