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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2cabc9fa3074e1eed3fd795eaa180a0e47ee18b8eceacb8c3516a347670a5d7
4
- data.tar.gz: 8c32e19fe9227fe327ec3995e384477e087ed7d5b4ed48bb5dd0b6a78fdf7ac2
3
+ metadata.gz: c49d0a2668c2ac163b2fb9bbfb13fcff75d6a4f558b8e62b633bc590d094c269
4
+ data.tar.gz: c0bc6218512f2883bd2fcbdfc60d4f5a9da05b93a9872bd60c1ce65bbd1d6ec9
5
5
  SHA512:
6
- metadata.gz: daa95d7fa296498252bd833106fddd6f08c21c1ce3fcc3aa8afa2e79d30d04e914bdc978cafa13d436b5364d91d9467f568d210d86d5d948a0500be3de7b2c8a
7
- data.tar.gz: 757d9829c35ab58512093f0940f1f5d02aef11b23f94523a09878eeb82b717f047e83936b867aa60f34fa8ce9da2aca45d1be8ecf8bb9cad6b4c8de5b047b723
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- promoted-ruby-client (0.1.17)
4
+ promoted-ruby-client (0.1.18)
5
5
  concurrent-ruby (~> 1)
6
6
  faraday (>= 0.9.0)
7
7
  faraday_middleware (>= 0.9.0)
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.17.gem`
7
+ 5. Run (using new output) `gem push promoted-ruby-client-0.1.18.gem`
8
8
  6. Update README with new version.
@@ -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
- compact_insertion[:properties] = compact_func.call(insertion[:properties])
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
@@ -1,7 +1,7 @@
1
1
  module Promoted
2
2
  module Ruby
3
3
  module Client
4
- VERSION = "0.1.17"
4
+ VERSION = "0.1.18"
5
5
  end
6
6
  end
7
7
  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.17
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-07-29 00:00:00.000000000 Z
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