bok_choy 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0af780bde560345f4d936f5fcd3efe6ba54f62859352f106a6d46dd1f076118b
4
- data.tar.gz: da3226c89b622eaf26d04bef06f9db84044f2c6e79983ca58e5cb408b792b08e
3
+ metadata.gz: e973871c42073b45f70862f7e513e04dcfdcc3aa9f22036e27f689e849d3c0e0
4
+ data.tar.gz: f6b2202540eb7bbb7821cb79578bb2aafd42a5368dd3869992f27235098eef48
5
5
  SHA512:
6
- metadata.gz: 04e4456d86a9375bb112b89202347ae0314e7d9b9d9262681190a1c9918f66441a9f534b8f4ad16148b0522249d2357d10c2f54ee9245f9d3f7c4c58ac626d1b
7
- data.tar.gz: 0f05e72fec74c81b591e3ad0d9b76c46d56190756be52ba08dc41dfe7513373419e83467e4835fb0cc139bbde08853be9c6fce245a9d59676256926da930c679
6
+ metadata.gz: 810b566a9758fbaf49da9f36bf85eff97774813cefa0762abf1d2359197bcbfd78a9f221e6926cdb0f787a1197bb798d5d971a82f8d47fb0219167290b98a458
7
+ data.tar.gz: feb4b2af45b1fe162abdf6d5c34eeed9fe0c4577b0f8012bc8f48520b8252ac1b544c06851cde78e0359399541cb498f84aa02464c4c111047459cd3f339f60b
@@ -10,7 +10,7 @@ jobs:
10
10
  - name: Set up Ruby
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: 3.1.3
13
+ ruby-version: 3.3.4
14
14
  bundler-cache: true
15
15
  - name: Run the default task
16
16
  run: bundle exec rake
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.4]
4
+ - Updated license from NCSA to MIT
5
+ - Added item_page endpoint
6
+
7
+ ## [0.0.3] - 2024-09-11
8
+ - Removed Gemfile.lock
9
+ - Bumped development depency versions to avoid CVE-2024-43398
10
+
3
11
  ## [0.0.2] - 2024-09-11
4
12
  - Fixed name/description issues
5
13
 
data/LICENSE.txt CHANGED
@@ -1,13 +1,10 @@
1
- Copyright © 2023 Species File Group. All rights reserved.
1
+ The MIT License (MIT)
2
2
 
3
- Developed by: Species File Group
4
- Illinois Natural History Survey
5
- https://github.com/SpeciesFileGroup/bok_choy
3
+ Copyright © 2024 Species File Group
6
4
 
7
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
6
 
9
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
10
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
11
- Neither the names of <Name of Development Group, Name of Institution>, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
10
 
13
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
data/README.md CHANGED
@@ -56,6 +56,13 @@ Get BHL item metadata by item ID:
56
56
  BokChoy.items(73397) # => Hash
57
57
  ```
58
58
 
59
+ ---
60
+ ### [Items page nums](https://bhlnames.globalnames.org/apidoc/index.html#/default/get-refs-by-item-page)
61
+ Get BHL page information by item_id and page_num:
62
+ ```ruby
63
+ BokChoy.item_page(item_id: 15402, page_num: 183) # => Hash
64
+ ```
65
+
59
66
  ---
60
67
  ### [Page reference metadata](https://bhlnames.globalnames.org/apidoc/index.html#/default/get-refs)
61
68
  Get BHL reference metadata by a page ID:
@@ -98,7 +105,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Specie
98
105
 
99
106
  ## License
100
107
 
101
- The gem is available as open source under the terms of the [NCSA/Illinois](https://github.com/SpeciesFileGroup/bok_choy/blob/main/LICENSE.txt) license. You can learn more about the NCSA license on [Wikipedia](https://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License) and compare it with other open source licenses at the [Open Source Initiative](https://opensource.org/license/uoi-ncsa-php/).
108
+ The gem is available as open source under the terms of the [MIT license](https://github.com/SpeciesFileGroup/bok_choy/blob/main/LICENSE.txt). You can learn more about the MIT license on [Wikipedia](https://en.wikipedia.org/wiki/MIT_License) and compare it with other open source licenses at the [Open Source Initiative](https://opensource.org/license/mit/).
102
109
 
103
110
  ## Code of Conduct
104
111
 
data/bok_choy.gemspec CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.summary = "BHL Names Client"
12
12
  s.description = "Bok Choy is a low-level wrapper around the BHLnames API."
13
13
  s.homepage = "https://github.com/SpeciesFileGroup/bok_choy"
14
- s.license = "NCSA"
15
- s.required_ruby_version = ">= 2.4.0"
14
+ s.license = "MIT"
15
+ s.required_ruby_version = ">= 2.5.0"
16
16
 
17
17
  # s.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
18
18
 
@@ -8,6 +8,8 @@ module BokChoy
8
8
  attr_accessor :endpoint
9
9
  attr_accessor :q
10
10
  attr_accessor :verbose
11
+ attr_accessor :item_id
12
+ attr_accessor :page_num
11
13
 
12
14
  attr_accessor :options
13
15
 
@@ -15,6 +17,8 @@ module BokChoy
15
17
  @endpoint = args[:endpoint]
16
18
  @verbose = args[:verbose]
17
19
  @q = args[:q]
20
+ @item_id = args[:item_id]
21
+ @page_num = args[:page_num]
18
22
  @json = args[:json].to_json
19
23
  @options = args[:options] # TODO: not added at bok_choy.rb
20
24
  end
@@ -22,9 +26,12 @@ module BokChoy
22
26
  def perform
23
27
 
24
28
  args = {
25
- json: @json
29
+ json: @json,
30
+ item_id: @item_id,
31
+ page_num: @page_num
26
32
  }
27
33
  opts = args.delete_if { |_k, v| v.nil? }
34
+ opts = args.delete_if { |_k, v| v == 'null' }
28
35
 
29
36
  Faraday::Utils.default_space_encoding = "+"
30
37
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BokChoy
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.4"
5
5
  end
data/lib/bok_choy.rb CHANGED
@@ -50,6 +50,20 @@ module BokChoy
50
50
  Request.new(endpoint: endpoint, verbose: verbose).perform
51
51
  end
52
52
 
53
+ # Get a page by item ID and page number
54
+ #
55
+ # @param item_id [String] A BHL item ID
56
+ # @param page_num [String] A BHL page number
57
+ # @param verbose [Boolean] Print headers to STDOUT
58
+ #
59
+ # @return [Hash] A result hash
60
+ def self.items_page_nums(item_id: nil, page_num: nil, verbose: false)
61
+ raise "Item ID and page number required" if item_id.nil? || page_num.nil?
62
+
63
+ endpoint = "items_page_nums"
64
+ Request.new(endpoint: endpoint, item_id: item_id, page_num: page_num, verbose: verbose).perform
65
+ end
66
+
53
67
  # Get metadata and taxonomic statistics for a BHL item
54
68
  #
55
69
  # @param id [String] A BHL item ID
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bok_choy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Ower, Matt Yoder
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -172,7 +171,6 @@ files:
172
171
  - CHANGELOG.md
173
172
  - CODE_OF_CONDUCT.md
174
173
  - Gemfile
175
- - Gemfile.lock
176
174
  - LICENSE.txt
177
175
  - README.md
178
176
  - Rakefile
@@ -188,12 +186,11 @@ files:
188
186
  - lib/bok_choy/version.rb
189
187
  homepage: https://github.com/SpeciesFileGroup/bok_choy
190
188
  licenses:
191
- - NCSA
189
+ - MIT
192
190
  metadata:
193
191
  homepage_uri: https://github.com/SpeciesFileGroup/bok_choy
194
192
  source_code_uri: https://github.com/SpeciesFileGroup/bok_choy
195
- changelog_uri: https://github.com/SpeciesFileGroup/bok_choy/releases/tag/v0.0.2
196
- post_install_message:
193
+ changelog_uri: https://github.com/SpeciesFileGroup/bok_choy/releases/tag/v0.0.4
197
194
  rdoc_options: []
198
195
  require_paths:
199
196
  - lib
@@ -201,15 +198,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
198
  requirements:
202
199
  - - ">="
203
200
  - !ruby/object:Gem::Version
204
- version: 2.4.0
201
+ version: 2.5.0
205
202
  required_rubygems_version: !ruby/object:Gem::Requirement
206
203
  requirements:
207
204
  - - ">="
208
205
  - !ruby/object:Gem::Version
209
206
  version: '0'
210
207
  requirements: []
211
- rubygems_version: 3.5.11
212
- signing_key:
208
+ rubygems_version: 3.6.7
213
209
  specification_version: 4
214
210
  summary: BHL Names Client
215
211
  test_files: []
data/Gemfile.lock DELETED
@@ -1,57 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- bok_choy (0.0.2)
5
- faraday (~> 2.2)
6
- faraday-follow_redirects (>= 0.1, < 0.4)
7
- multi_json (~> 1.15)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- addressable (2.8.1)
13
- public_suffix (>= 2.0.2, < 6.0)
14
- byebug (11.1.3)
15
- crack (0.4.5)
16
- rexml
17
- faraday (2.11.0)
18
- faraday-net_http (>= 2.0, < 3.4)
19
- logger
20
- faraday-follow_redirects (0.3.0)
21
- faraday (>= 1, < 3)
22
- faraday-net_http (3.3.0)
23
- net-http
24
- hashdiff (1.0.1)
25
- logger (1.6.1)
26
- minitest (5.15.0)
27
- multi_json (1.15.0)
28
- net-http (0.4.1)
29
- uri
30
- power_assert (2.0.1)
31
- public_suffix (5.0.1)
32
- rake (13.0.6)
33
- rexml (3.2.5)
34
- test-unit (3.5.3)
35
- power_assert
36
- uri (0.13.1)
37
- vcr (6.0.0)
38
- webmock (3.18.1)
39
- addressable (>= 2.8.0)
40
- crack (>= 0.3.2)
41
- hashdiff (>= 0.4.0, < 2.0.0)
42
-
43
- PLATFORMS
44
- x86_64-linux
45
-
46
- DEPENDENCIES
47
- bok_choy!
48
- bundler (~> 2.1, >= 2.1.4)
49
- byebug
50
- minitest (~> 5.0)
51
- rake (~> 13.0)
52
- test-unit (~> 3.3, >= 3.3.6)
53
- vcr (~> 6.0)
54
- webmock (~> 3.18)
55
-
56
- BUNDLED WITH
57
- 2.3.24