bok_choy 0.0.3 → 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: 6c0f176e351a57af03be2b64c8f3b41e9dd16514057a230900424f0d08e28609
4
- data.tar.gz: c33e18c4b41338c1d58a916cc501810a4f27db0f1add72e550507a901adb7d2b
3
+ metadata.gz: e973871c42073b45f70862f7e513e04dcfdcc3aa9f22036e27f689e849d3c0e0
4
+ data.tar.gz: f6b2202540eb7bbb7821cb79578bb2aafd42a5368dd3869992f27235098eef48
5
5
  SHA512:
6
- metadata.gz: 579e78cfc22b095fe3b930e3a0ec630ea90668eafd88c2b16efa7766129a8cb0a87e32056575ac934f918167b050ab79169992d284619d21bf501fe8426ae31d
7
- data.tar.gz: f4d2363a3d23cbd93f4b5101752ee2ede20a97710078836e391833167eeda0ff1b12ccbba0d31515f5cce2236164c23006da2c4f9a2fda43aaaf1ef780bfd355
6
+ metadata.gz: 810b566a9758fbaf49da9f36bf85eff97774813cefa0762abf1d2359197bcbfd78a9f221e6926cdb0f787a1197bb798d5d971a82f8d47fb0219167290b98a458
7
+ data.tar.gz: feb4b2af45b1fe162abdf6d5c34eeed9fe0c4577b0f8012bc8f48520b8252ac1b544c06851cde78e0359399541cb498f84aa02464c4c111047459cd3f339f60b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.0.4]
4
+ - Updated license from NCSA to MIT
5
+ - Added item_page endpoint
6
+
3
7
  ## [0.0.3] - 2024-09-11
4
8
  - Removed Gemfile.lock
5
9
  - Bumped development depency versions to avoid CVE-2024-43398
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,7 +11,7 @@ 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"
14
+ s.license = "MIT"
15
15
  s.required_ruby_version = ">= 2.5.0"
16
16
 
17
17
  # s.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
@@ -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.3"
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.3
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
@@ -187,12 +186,11 @@ files:
187
186
  - lib/bok_choy/version.rb
188
187
  homepage: https://github.com/SpeciesFileGroup/bok_choy
189
188
  licenses:
190
- - NCSA
189
+ - MIT
191
190
  metadata:
192
191
  homepage_uri: https://github.com/SpeciesFileGroup/bok_choy
193
192
  source_code_uri: https://github.com/SpeciesFileGroup/bok_choy
194
- changelog_uri: https://github.com/SpeciesFileGroup/bok_choy/releases/tag/v0.0.3
195
- post_install_message:
193
+ changelog_uri: https://github.com/SpeciesFileGroup/bok_choy/releases/tag/v0.0.4
196
194
  rdoc_options: []
197
195
  require_paths:
198
196
  - lib
@@ -207,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
205
  - !ruby/object:Gem::Version
208
206
  version: '0'
209
207
  requirements: []
210
- rubygems_version: 3.5.11
211
- signing_key:
208
+ rubygems_version: 3.6.7
212
209
  specification_version: 4
213
210
  summary: BHL Names Client
214
211
  test_files: []