inat-get 0.9.2.2 → 0.9.2.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: dca5faeb3dda0d46d729973f6cd74de2e20b6d7b25f712d22cc8dc272ac2289a
4
- data.tar.gz: 1acea274e4347d173b7a1d1db335f48a7864f25bb8059bf2654893ebf21e88ca
3
+ metadata.gz: 487c7043dbfd21d4d899bc1caf56dba18247b3d75564d96b7ef4dc3d8b797b53
4
+ data.tar.gz: 98de0f57594b65c2a7cd4d965221a0df4ef8052368cdd0e1d9c396db4d641fdc
5
5
  SHA512:
6
- metadata.gz: 745d8b1d07195ef2609aa3d05915faee8f38d946850852a8d22729b3ae1c1fa31790fec8795e83cf93c2a1976e66f42551c0668b4a2b12247b766dbb3ca84d3f
7
- data.tar.gz: b8d02ea3256fac7c501059f54b31f80fdbbe047ac2b08f9dffc4ee739fedd3091572d715dda687c705e7a7d4627ad5059b82af5df7fe32f6ca2c3b3c8f00b6fc
6
+ metadata.gz: 9719c87ce41e33bf89bb0798ce030400c51fc9f8e7c37c5106ef091df8e3224dc3e61cb22a7875c7983f13a0559ed0daaf4b0b970970e2ea43706c90edf4698d
7
+ data.tar.gz: c2020ceb08590396257cead8a80c32f7255f8677b35dbedc6d57dbc813e88113ae5687ec4bae455e2aeb38a77454c594252c08b1f030cd9d25ae16a8428d97e6
@@ -57,6 +57,10 @@ class INatGet::App::Server::API < INatGet::App::Server
57
57
 
58
58
  def faraday
59
59
  @faraday ||= Faraday::new do |f|
60
+ if (proxy_url = @config.dig(:api, :proxy))
61
+ f.proxy = proxy_url
62
+ end
63
+
60
64
  f.request :retry,
61
65
  max: @config.dig(:api, :retry, :max),
62
66
  interval: IS::Duration::parse(@config.dig(:api, :retry, :interval)),
@@ -36,11 +36,11 @@ module INatGet::App::Setup
36
36
  caching: {
37
37
  api: 100,
38
38
  update: '4h',
39
- refresh: {
39
+ refresh: {
40
40
  interval: '4d',
41
41
  depth: '40d'
42
42
  },
43
- recache: {
43
+ recache: {
44
44
  count: 200,
45
45
  method: 'oldest' # oldest by cached, newest by updated, sample — random
46
46
  },
@@ -160,6 +160,11 @@ module INatGet::App::Setup
160
160
  options[:config] = value
161
161
  end
162
162
 
163
+ o.on '-p', '--proxy URI', String, 'Use proxy by URI.' do |value|
164
+ options[:api] ||= {}
165
+ options[:proxy] ||= value
166
+ end
167
+
163
168
  o.on '-l', '--log-level LEVEL', [ 'fatal', 'error', 'warn', 'info', 'debug' ], 'Log level (fatal, error, warn, info or debug).' do |value|
164
169
  options[:logs] ||= {}
165
170
  options[:logs][:screen] ||= {}
@@ -192,7 +197,7 @@ module INatGet::App::Setup
192
197
  options[:logs][:file][:wrk] = 'debug'
193
198
  end
194
199
 
195
- o.on '-o', '--offline', 'Offline mode: no updates, use local database only.' do
200
+ o.on '-o', '--offline', 'Offline mode: no updates, use local database only.' do
196
201
  options[:offline] = true
197
202
  end
198
203
 
@@ -267,7 +272,7 @@ module INatGet::App::Setup
267
272
  if File.exist?(list_file)
268
273
  unwrap_file_list File.readlines(list_file, chomp: true)
269
274
  else
270
- $stderr.puts "❌ \e[1mList file not found:\e[0m #{ list_file }\e[1m. Stopped!\e[0m"
275
+ $stderr.puts "❌ \e[1mList file not found:\e[0m #{ list_file }\e[1m. Stopped!\e[0m"
271
276
  exit Errno::ENOENT::Errno
272
277
  end
273
278
  else
@@ -296,4 +301,3 @@ module INatGet::App::Setup
296
301
  end
297
302
 
298
303
  end
299
-
data/lib/inat-get/info.rb CHANGED
@@ -5,7 +5,7 @@ module INatGet; end
5
5
  module INatGet::Info
6
6
 
7
7
  NAME = 'inat-get'
8
- VERSION = '0.9.2.2'
8
+ VERSION = '0.9.2.4'
9
9
  VERSION_ALIAS = 'Parus major'
10
10
 
11
11
  AUTHOR = 'Ivan Shikhalev'
@@ -19,5 +19,5 @@ module INatGet::Info
19
19
  DESCRIPTION = 'iNaturalist API query builder and analytics tool'
20
20
 
21
21
  HOMEPAGE = 'https://github.com/inat-get/inat-get'
22
-
22
+
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inat-get
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2.2
4
+ version: 0.9.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Shikhalev