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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/acfs/resource/query_methods.rb +5 -2
- data/lib/acfs/version.rb +1 -1
- data/spec/acfs/resource/query_methods_spec.rb +10 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c817db357dd15f037cfc22b5259d24543787d0bb
|
4
|
+
data.tar.gz: 8d05571a8bdb9ae33e91045c7f6720a5449e9c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 840955a85653d562f89d5ad95ed38eca94531dcb7215aa74d340036c13753295d14d290aab2e4ed9232e4428dd6ce25a3b02706fee455694298d243950a83f3c
|
7
|
+
data.tar.gz: aaf42e7aae1d406eb64c92854e753edd68c21cdcb1b77f14cd2694574b56fbb4047daae0c16b30d7f1bad926df3a250c828221868c83645e63d0bb8c746d45b3
|
data/CHANGELOG.md
CHANGED
@@ -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 = {}
|
198
|
+
def each_item(opts = {})
|
198
199
|
each_page(opts) do |collection|
|
199
|
-
collection.each
|
200
|
+
collection.each do |item|
|
201
|
+
yield item, collection
|
202
|
+
end
|
200
203
|
end
|
201
204
|
end
|
202
205
|
|
data/lib/acfs/version.rb
CHANGED
@@ -519,14 +519,21 @@ describe Acfs::Resource::QueryMethods do
|
|
519
519
|
end
|
520
520
|
|
521
521
|
it 'should iterate all pages' do
|
522
|
-
|
522
|
+
indices = []
|
523
523
|
model.each_item do |item|
|
524
524
|
expect(item).to be_a MyUser
|
525
|
-
|
525
|
+
indices << item.id
|
526
526
|
end
|
527
527
|
Acfs.run
|
528
528
|
|
529
|
-
expect(
|
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.
|
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-
|
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.
|
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.
|