idigbio_client 0.1.1 → 0.1.2
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/README.md +2 -2
- data/idigbio_client.gemspec +1 -1
- data/lib/idigbio_client/search.rb +3 -4
- data/lib/idigbio_client/version.rb +1 -1
- 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: ce6d25b4dd4759f93fb02a89be49a1117ed0d14b
|
4
|
+
data.tar.gz: 22921e1e94d501f354a1152d4799c60838e43f65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46e1fd335f457b059b89a271cdf6224fc1b3d4bb7c1275a70be8ed147fc84bab41a5f2a7da7874af283fd87f5e9170d6affdbdd7b11fc2a969a80401536dedd7
|
7
|
+
data.tar.gz: 1d887ca39f87cb56a0b1fd7fcf9213a0510e34c1c6c997d1d9a10777df9a09544b9647599a2db8d9c7d98acf2b8ee4d8e4dc2f6003d857d44d2c82fc2e892dbd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -40,7 +40,7 @@ Client functions can be grouped in 4 categories
|
|
40
40
|
|
41
41
|
### Inspect
|
42
42
|
|
43
|
-
|
43
|
+
Methods in this section supply meta-information important for effective use
|
44
44
|
of the client.
|
45
45
|
|
46
46
|
#### Method `IdigbioClient.types`
|
@@ -100,7 +100,7 @@ require "idigbio_client"
|
|
100
100
|
params = { rq: { genus: "acer" }, limit: 15 }
|
101
101
|
IdigbioClient.search(params: params)
|
102
102
|
|
103
|
-
# setting offset: will
|
103
|
+
# setting offset: will start count for 15 records from 11th result
|
104
104
|
params = { rq: { genus: "acer" }, limit: 15, offset: 10 }
|
105
105
|
IdigbioClient.search(params: params)
|
106
106
|
|
data/idigbio_client.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.required_ruby_version = ">= 1.9.0"
|
9
9
|
gem.name = "idigbio_client"
|
10
10
|
gem.version = IdigbioClient::VERSION
|
11
|
-
gem.authors = ["Greg
|
11
|
+
gem.authors = ["Greg Traub", "Dmitry Mozzherin"]
|
12
12
|
gem.email = ["dmozzherin@gmail.com"]
|
13
13
|
|
14
14
|
gem.summary = "Ruby wrapper for iDigBio API"
|
@@ -6,9 +6,8 @@ module IdigbioClient
|
|
6
6
|
class << self
|
7
7
|
def search(opts)
|
8
8
|
opts = prepare_opts(opts)
|
9
|
-
orig_offset = opts[:params][:offset]
|
10
9
|
resp = paginate(opts)
|
11
|
-
resp[:items] = resp[:items][0...
|
10
|
+
resp[:items] = resp[:items][0...opts[:params][:limit]]
|
12
11
|
block_given? ? yield(resp) : resp
|
13
12
|
end
|
14
13
|
|
@@ -43,8 +42,8 @@ module IdigbioClient
|
|
43
42
|
|
44
43
|
def adjust_params(resp, params)
|
45
44
|
logger_write(resp, params)
|
46
|
-
params[:items_to_go] ||=
|
47
|
-
|
45
|
+
params[:items_to_go] ||= [MAX_LIMIT, resp[:itemCount],
|
46
|
+
params[:limit]].min
|
48
47
|
params[:offset] += resp[:items].size
|
49
48
|
params[:items_to_go] -= resp[:items].size
|
50
49
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idigbio_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Greg
|
7
|
+
- Greg Traub
|
8
8
|
- Dmitry Mozzherin
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|