nasturtium 0.1.0 → 0.1.2

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: 846c9e4a10b33c6c7f1eb7ed54d3e6fffc22e5c8883e27de6aeb2fe33fd62892
4
- data.tar.gz: 7fb67a76a990c4be8c121dd2ea31ea6a81c6e66b52cb66122ab165139c78b18a
3
+ metadata.gz: 00fbcc67e682c17e4b44ad8b8d67d0b1ae09245bce3b13047bbc7965182d0316
4
+ data.tar.gz: 35c4853c81836fb2d3e048ba0d9034452574e2de7a3a2584a4a6ecb308eccb95
5
5
  SHA512:
6
- metadata.gz: 530f527fb343370ae535651aee434bdaf7520b282871b2da1a0d6ae847f7b48f15446956061e97da416bce43cb62f2d73c600403ca1f7856b2c089f2271b8d99
7
- data.tar.gz: 45dff29921cfa88502c1db503442e759cfeccd8315ef6f822630b9473e11ff447097672020112b79304bcde4fd3e8fd048f1e95d07a69b913da1793be0dfdd62
6
+ metadata.gz: 5314e8c36ec73652a28a33a24d69f0c99cd70975f43a4eb008f8a75bd98f77c2c2f0ae85e1b2c7603b6900789a481e98ad3aa74301ab34b42c721f5666e32dbf
7
+ data.tar.gz: f5b0478301b6b21dece20e84543c2288c90cd781b9f59abbb58ede58b0c69d7ac923d10ca007ca4776a281c0c035a32a16ae9d15b6be1f9adf887c2b917b6e3c
@@ -5,12 +5,15 @@ on: [push,pull_request]
5
5
  jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby-version: ['3.3.4', '4.0.0']
8
11
  steps:
9
12
  - uses: actions/checkout@v2
10
- - name: Set up Ruby
13
+ - name: Set up Ruby ${{ matrix.ruby-version }}
11
14
  uses: ruby/setup-ruby@v1
12
15
  with:
13
- ruby-version: 3.1.3
16
+ ruby-version: ${{ matrix.ruby-version }}
14
17
  bundler-cache: true
15
18
  - name: Run the default task
16
19
  run: bundle exec rake
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.2] - 2026-06-17
4
+ - Allow Ruby 4.0.0:
5
+ - Relaxed `required_ruby_version` to `>= 2.5.0, < 5.0`
6
+ - Added Ruby 4.0.0 to the CI matrix
7
+ - Bumped `faraday-follow_redirects` upper bound to allow 0.5+ (which lifts the Ruby < 4 cap)
8
+ - Dropped the `bundler` development dependency
9
+ - Fixed `elseif` typo in `Faraday::NasturtiumErrors` middleware that crashed error parsing on non-message error bodies; hardened `error_body` against unexpected shapes
10
+ - Updated tests to match current iNaturalist API responses (taxonomy drift, fuzzy autocomplete, post-endpoint 404s on empty projects)
11
+ - Updated license from NCSA to MIT
12
+
13
+ ## [0.1.1] - 2024-09-11
14
+ - Removed Gemfile.lock
15
+ - Bumped development depency versions to avoid CVE-2024-43398
16
+
3
17
  ## [0.1.0] - 2022-01-20
4
18
 
5
19
  - Initial release
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/nasturtium
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
@@ -527,7 +527,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Specie
527
527
 
528
528
  ## License
529
529
 
530
- The gem is available as open source under the terms of the [NCSA/Illinois](https://opensource.org/licenses/NCSA).
530
+ The gem is available as open source under the terms of the [MIT license](https://opensource.org/licenses/NCSA).
531
531
 
532
532
  ## Code of Conduct
533
533
 
@@ -1,24 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nasturtium
4
- # Custom error class for rescuing from all Bonamia errors
4
+ # Custom error class for rescuing from all iNaturalist errors
5
5
  class Error < StandardError; end
6
6
 
7
- # Raised when Bionomia returns the HTTP status code 400
7
+ # Raised when iNaturalist returns the HTTP status code 400
8
8
  class BadRequest < Error; end
9
9
 
10
- # Raised when Bionomia returns the HTTP status code 404
10
+ # Raised when iNaturalist returns the HTTP status code 404
11
11
  class NotFound < Error; end
12
12
 
13
- # Raised when Bionomia returns the HTTP status code 500
13
+ # Raised when iNaturalist returns the HTTP status code 500
14
14
  class InternalServerError < Error; end
15
15
 
16
- # Raised when Bionomia returns the HTTP status code 502
16
+ # Raised when iNaturalist returns the HTTP status code 502
17
17
  class BadGateway < Error; end
18
18
 
19
- # Raised when Bionomia returns the HTTP status code 503
19
+ # Raised when iNaturalist returns the HTTP status code 503
20
20
  class ServiceUnavailable < Error; end
21
21
 
22
- # Raised when Bionomia returns the HTTP status code 504
22
+ # Raised when iNaturalist returns the HTTP status code 504
23
23
  class GatewayTimeout < Error; end
24
- end
24
+ end
@@ -40,24 +40,15 @@ module Faraday
40
40
  end
41
41
 
42
42
  def error_body(body)
43
- if !body.nil? && !body.empty? && body.is_a?(String)
44
- if json?(body)
45
- body = ::MultiJson.load(body)
46
- if body["message"].nil?
47
- body = nil
48
- elseif body["message"].length == 1
49
- body = body["message"]
50
- else
51
- body = body["message"].collect { |x| x["message"] }.join("; ")
52
- end
53
- end
54
- end
43
+ return nil if body.nil? || !body.is_a?(String) || body.empty?
44
+ return ": #{body}" unless json?(body)
55
45
 
56
- if body.nil?
57
- nil
58
- else
59
- ": #{body}"
60
- end
46
+ parsed = ::MultiJson.load(body)
47
+ msg = parsed["message"] || parsed["error"]
48
+ return nil if msg.nil?
49
+
50
+ msg = msg.collect { |x| x.is_a?(Hash) ? x["message"] : x.to_s }.join("; ") if msg.is_a?(Array)
51
+ ": #{msg}"
61
52
  end
62
53
 
63
54
  def error_message_500(response, body = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nasturtium
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/nasturtium.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "erb"
4
- #require 'nokogiri'
5
4
  require 'open-uri'
6
5
  require_relative "nasturtium/error"
7
6
  require_relative "nasturtium/version"
data/nasturtium.gemspec CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.summary = "Nasturtium Client"
12
12
  s.description = "Nasturtium is a low-level wrapper around the iNaturalist API."
13
13
  s.homepage = "https://github.com/SpeciesFileGroup/nasturtium"
14
- s.license = "NCSA"
15
- s.required_ruby_version = ">= 2.4.0"
14
+ s.license = "MIT"
15
+ s.required_ruby_version = [">= 2.5.0", "< 5.0"]
16
16
 
17
17
  # s.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
18
18
 
@@ -32,23 +32,17 @@ Gem::Specification.new do |s|
32
32
  # Uncomment to register a new dependency of your gem
33
33
  # s.add_dependency "example-gem", "~> 1.0"
34
34
 
35
- s.add_development_dependency "bundler", "~> 2.1", ">= 2.1.4"
36
- # s.add_development_dependency "codecov", "~> 0.5.0"
37
- # s.add_development_dependency "json", "~> 2.3", ">= 2.3.1"
38
35
  s.add_development_dependency "rake", "~> 13.0", ">= 13.0.1"
39
- # s.add_development_dependency "standard", "~> 1.0"
40
- # s.add_development_dependency "simplecov", "~> 0.21.2"
41
36
  s.add_development_dependency "test-unit", "~> 3.3", ">= 3.3.6"
42
37
  s.add_development_dependency "vcr", "~> 6.0"
43
38
  s.add_development_dependency "webmock", "~> 3.18"
39
+ s.add_development_dependency "rexml", "~> 3.3", ">= 3.3.6"
40
+ #s.add_development_dependency "byebug"
44
41
 
45
42
  s.add_runtime_dependency "faraday", "~> 2.2"
46
- s.add_runtime_dependency "faraday-follow_redirects", ">= 0.1", "< 0.4"
43
+ s.add_runtime_dependency "faraday-follow_redirects", ">= 0.1", "< 0.6"
47
44
  s.add_runtime_dependency "multi_json", "~> 1.15"
48
45
 
49
- # TODO: comment out
50
- s.add_development_dependency "byebug"
51
-
52
46
  # s.add_runtime_dependency "thor", "~> 1.0", ">= 1.0.1"
53
47
 
54
48
  # For more information and examples about making a new gem, checkout our
metadata CHANGED
@@ -1,35 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nasturtium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
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: 2023-09-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.1'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 2.1.4
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '2.1'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 2.1.4
33
12
  - !ruby/object:Gem::Dependency
34
13
  name: rake
35
14
  requirement: !ruby/object:Gem::Requirement
@@ -98,6 +77,26 @@ dependencies:
98
77
  - - "~>"
99
78
  - !ruby/object:Gem::Version
100
79
  version: '3.18'
80
+ - !ruby/object:Gem::Dependency
81
+ name: rexml
82
+ requirement: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '3.3'
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 3.3.6
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.3'
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 3.3.6
101
100
  - !ruby/object:Gem::Dependency
102
101
  name: faraday
103
102
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +120,7 @@ dependencies:
121
120
  version: '0.1'
122
121
  - - "<"
123
122
  - !ruby/object:Gem::Version
124
- version: '0.4'
123
+ version: '0.6'
125
124
  type: :runtime
126
125
  prerelease: false
127
126
  version_requirements: !ruby/object:Gem::Requirement
@@ -131,7 +130,7 @@ dependencies:
131
130
  version: '0.1'
132
131
  - - "<"
133
132
  - !ruby/object:Gem::Version
134
- version: '0.4'
133
+ version: '0.6'
135
134
  - !ruby/object:Gem::Dependency
136
135
  name: multi_json
137
136
  requirement: !ruby/object:Gem::Requirement
@@ -146,20 +145,6 @@ dependencies:
146
145
  - - "~>"
147
146
  - !ruby/object:Gem::Version
148
147
  version: '1.15'
149
- - !ruby/object:Gem::Dependency
150
- name: byebug
151
- requirement: !ruby/object:Gem::Requirement
152
- requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- version: '0'
156
- type: :development
157
- prerelease: false
158
- version_requirements: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- version: '0'
163
148
  description: Nasturtium is a low-level wrapper around the iNaturalist API.
164
149
  email:
165
150
  - gdower@illinois.edu
@@ -172,7 +157,6 @@ files:
172
157
  - CHANGELOG.md
173
158
  - CODE_OF_CONDUCT.md
174
159
  - Gemfile
175
- - Gemfile.lock
176
160
  - LICENSE.txt
177
161
  - README.md
178
162
  - Rakefile
@@ -188,12 +172,11 @@ files:
188
172
  - nasturtium.gemspec
189
173
  homepage: https://github.com/SpeciesFileGroup/nasturtium
190
174
  licenses:
191
- - NCSA
175
+ - MIT
192
176
  metadata:
193
177
  homepage_uri: https://github.com/SpeciesFileGroup/nasturtium
194
178
  source_code_uri: https://github.com/SpeciesFileGroup/nasturtium
195
- changelog_uri: https://github.com/SpeciesFileGroup/nasturtium/releases/tag/v0.1.0
196
- post_install_message:
179
+ changelog_uri: https://github.com/SpeciesFileGroup/nasturtium/releases/tag/v0.1.2
197
180
  rdoc_options: []
198
181
  require_paths:
199
182
  - lib
@@ -201,15 +184,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
184
  requirements:
202
185
  - - ">="
203
186
  - !ruby/object:Gem::Version
204
- version: 2.4.0
187
+ version: 2.5.0
188
+ - - "<"
189
+ - !ruby/object:Gem::Version
190
+ version: '5.0'
205
191
  required_rubygems_version: !ruby/object:Gem::Requirement
206
192
  requirements:
207
193
  - - ">="
208
194
  - !ruby/object:Gem::Version
209
195
  version: '0'
210
196
  requirements: []
211
- rubygems_version: 3.4.19
212
- signing_key:
197
+ rubygems_version: 4.0.3
213
198
  specification_version: 4
214
199
  summary: Nasturtium Client
215
200
  test_files: []
data/Gemfile.lock DELETED
@@ -1,53 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- nasturtium (0.1.0)
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.7.10)
18
- faraday-net_http (>= 2.0, < 3.1)
19
- ruby2_keywords (>= 0.0.4)
20
- faraday-follow_redirects (0.3.0)
21
- faraday (>= 1, < 3)
22
- faraday-net_http (3.0.2)
23
- hashdiff (1.0.1)
24
- minitest (5.15.0)
25
- multi_json (1.15.0)
26
- power_assert (2.0.1)
27
- public_suffix (5.0.1)
28
- rake (13.0.6)
29
- rexml (3.2.5)
30
- ruby2_keywords (0.0.5)
31
- test-unit (3.5.3)
32
- power_assert
33
- vcr (6.0.0)
34
- webmock (3.18.1)
35
- addressable (>= 2.8.0)
36
- crack (>= 0.3.2)
37
- hashdiff (>= 0.4.0, < 2.0.0)
38
-
39
- PLATFORMS
40
- x86_64-linux
41
-
42
- DEPENDENCIES
43
- bundler (~> 2.1, >= 2.1.4)
44
- byebug
45
- nasturtium!
46
- minitest (~> 5.0)
47
- rake (~> 13.0)
48
- test-unit (~> 3.3, >= 3.3.6)
49
- vcr (~> 6.0)
50
- webmock (~> 3.18)
51
-
52
- BUNDLED WITH
53
- 2.3.24