acfs 1.1.0 → 1.1.1

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
  SHA1:
3
- metadata.gz: b637acde9ee3c465f3f38bf26e85a28313aecc8c
4
- data.tar.gz: 963f476cfc2c5739e9368d331334b6692f83876c
3
+ metadata.gz: c817db357dd15f037cfc22b5259d24543787d0bb
4
+ data.tar.gz: 8d05571a8bdb9ae33e91045c7f6720a5449e9c71
5
5
  SHA512:
6
- metadata.gz: 9174266a276efe19947cc54da57a4080ae6246a4bb30bd54ed7b2c017182198674c94ee66826a0cb2dac4835f2a50f09d43bcf8aec69754a5e170368af178f64
7
- data.tar.gz: a87edaa76f6f8a6b9a2a381ac9a311935975b786f9d321a64a1040de2e8d2dc85e1cf140ee7ac25be3e5576b3680a23145e3dc8aa03191d3882918ff0e38e0a3
6
+ metadata.gz: 840955a85653d562f89d5ad95ed38eca94531dcb7215aa74d340036c13753295d14d290aab2e4ed9232e4428dd6ce25a3b02706fee455694298d243950a83f3c
7
+ data.tar.gz: aaf42e7aae1d406eb64c92854e753edd68c21cdcb1b77f14cd2694574b56fbb4047daae0c16b30d7f1bad926df3a250c828221868c83645e63d0bb8c746d45b3
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.1
4
+
5
+ * `each_item`: Pass collection to provided block (#40)
6
+
3
7
  ## 1.1.0
4
8
 
5
9
  * Add support for Rails 5.1
@@ -193,10 +193,13 @@ class Acfs::Resource
193
193
  #
194
194
  # @yield [item] Callback that will be invoked for each item.
195
195
  # @yieldparam item [self] Resource.
196
+ # @yieldparam collection [Acfs::Collection] Collection.
196
197
  #
197
- def each_item(opts = {}, &block)
198
+ def each_item(opts = {})
198
199
  each_page(opts) do |collection|
199
- collection.each(&block)
200
+ collection.each do |item|
201
+ yield item, collection
202
+ end
200
203
  end
201
204
  end
202
205
 
@@ -2,7 +2,7 @@ module Acfs
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STAGE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
@@ -519,14 +519,21 @@ describe Acfs::Resource::QueryMethods do
519
519
  end
520
520
 
521
521
  it 'should iterate all pages' do
522
- indecies = []
522
+ indices = []
523
523
  model.each_item do |item|
524
524
  expect(item).to be_a MyUser
525
- indecies << item.id
525
+ indices << item.id
526
526
  end
527
527
  Acfs.run
528
528
 
529
- expect(indecies).to eq [1, 2, 3, 4, 5]
529
+ expect(indices).to eq [1, 2, 3, 4, 5]
530
+ end
531
+
532
+ it 'should pass the collection to the provided block' do
533
+ model.each_item do |_item, collection|
534
+ expect(collection).to be_a Acfs::Collection
535
+ end
536
+ Acfs.run
530
537
  end
531
538
  end
532
539
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  version: '0'
229
229
  requirements: []
230
230
  rubyforge_project:
231
- rubygems_version: 2.6.11
231
+ rubygems_version: 2.5.2
232
232
  signing_key:
233
233
  specification_version: 4
234
234
  summary: An abstract API base client for service oriented application.