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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62fa6773f6c3978b6f0178460be1ab11cbc74e0b
4
- data.tar.gz: 306805ac056273c5a5f70776fc2796e9adb1444a
3
+ metadata.gz: ce6d25b4dd4759f93fb02a89be49a1117ed0d14b
4
+ data.tar.gz: 22921e1e94d501f354a1152d4799c60838e43f65
5
5
  SHA512:
6
- metadata.gz: 3ff4f93d2833bbda8c75e810a997b9f37c90f88b21619aa4545dc33e0aced10ba5136279eadcf671f3e5cd0ad6ec115bfbdfc12cd573f7e3f57965a8bfd94937
7
- data.tar.gz: 3be8cf4fc68036a5bdae33d5d4066d7357d9fba5dcadc0ac661d85323cdef563d5d266869ee82c954aeaa7dba3533388e16b8b517accaabfb97f511b5dd86c6e
6
+ metadata.gz: 46e1fd335f457b059b89a271cdf6224fc1b3d4bb7c1275a70be8ed147fc84bab41a5f2a7da7874af283fd87f5e9170d6affdbdd7b11fc2a969a80401536dedd7
7
+ data.tar.gz: 1d887ca39f87cb56a0b1fd7fcf9213a0510e34c1c6c997d1d9a10777df9a09544b9647599a2db8d9c7d98acf2b8ee4d8e4dc2f6003d857d44d2c82fc2e892dbd
@@ -1,6 +1,10 @@
1
1
  gn_crossmap CHANGELOG
2
2
  =====================
3
3
 
4
+ 0.1.2
5
+ -----
6
+ - [Dmitry Mozzherin][dimus] - offset does not influence limit of returned records
7
+
4
8
  0.1.1
5
9
  -----
6
10
  - [Dmitry Mozzherin][dimus] - fixes in README and gemfile
data/README.md CHANGED
@@ -40,7 +40,7 @@ Client functions can be grouped in 4 categories
40
40
 
41
41
  ### Inspect
42
42
 
43
- Methos in this section supply metainformation important for effective use
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 return only 5 records, assuming 10 were done before
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
 
@@ -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 T.", "Dmitry Mozzherin"]
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...(opts[:params][:limit] - orig_offset)]
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
- [MAX_LIMIT, resp[:itemCount], params[:limit]].min - params[:offset]
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
@@ -1,6 +1,6 @@
1
1
  # Ruby wrapper for iDigBio API
2
2
  module IdigbioClient
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
 
5
5
  def self.version
6
6
  VERSION
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Greg T.
7
+ - Greg Traub
8
8
  - Dmitry Mozzherin
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-05-20 00:00:00.000000000 Z
12
+ date: 2015-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client