monkeylearn 3.3.2 → 3.3.3

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
  SHA256:
3
- metadata.gz: 1b049b5ffe65be202b6e709f4879b91a148f9c1cb0b0cb6596609aa82ba415bf
4
- data.tar.gz: 11910d05f7772d62026bc7ef834546da9d919fd9cdadf5a69dad36f533b27535
3
+ metadata.gz: 7db143a6257ef98574edb308fa0d1dbee9dd7a2437f93b9c28a04964216d1b31
4
+ data.tar.gz: 1fd16fe26ad3b5d42c8a5235f024741538aab0a49eb9b632f7142f6bb9cc0aa8
5
5
  SHA512:
6
- metadata.gz: 6ee4005af09ea9b705cd281a2f07b5b96e1d91bd97febddef9356f18ab146e3de412d82ef12caf21f48a42b766f805ccfee3836a02b38c8587f94213bd5aa440
7
- data.tar.gz: 1a3c47c71ec843f74cd04eb030a8eada785d119ea0fe7d061324e94fef8c886c1bb2d275c2a911589af7da7f7f50a86f2d6e006662cd7ed795b3fcb8fd90943a
6
+ metadata.gz: 2cc69b7651ab9e073e883dab0c09928811f2b589f5b843e0161646a9b90087a2df8f5bc570663291b07e45ba46baae683c23fda299fa5b49894fb566d81d30aa
7
+ data.tar.gz: c7f715032772b90cad291edbb7815a023180727220bf67b829d973030cdbe245ca2a4fd120decbe1ae92491cedf77521c5e09982ff37ef6960ba6f296a9a94fe
data/README.md CHANGED
@@ -451,12 +451,6 @@ Parameters:
451
451
  |*name* |`String` |The name of the new tag. |
452
452
  |*options* |`Hash` |Optional parameters, see below. The hash always expects symbols as keys. |
453
453
 
454
- Optional parameters:
455
-
456
- | Parameter |Type | Description |
457
- |--------------------|-------------------|-----------------------------------------------------------|
458
- |*parent_id* |`Integer` |**DEPRECATED**. The ID of the parent tag.
459
-
460
454
  Example:
461
455
 
462
456
  ```ruby
@@ -485,7 +479,6 @@ Optional parameters:
485
479
  | Parameter |Type | Description |
486
480
  |--------------------|-------------------|-----------------------------------------------------------|
487
481
  |*name* |`String` |The new name of the tag. |
488
- |*parent_id* |`Integer` |**DEPRECATED**. The new parent tag ID.
489
482
 
490
483
  Example:
491
484
 
@@ -138,9 +138,6 @@ module Monkeylearn
138
138
  data = {
139
139
  name: name,
140
140
  }
141
- if options[:parent_id]
142
- data[:parent_id] = options[:parent_id]
143
- end
144
141
  request(:post, build_endpoint(module_id), data)
145
142
  end
146
143
 
@@ -152,7 +149,6 @@ module Monkeylearn
152
149
  endpoint = build_endpoint(module_id, tag_id)
153
150
  data = {
154
151
  name: options[:name],
155
- parent_id: options[:parent_id]
156
152
  }.delete_if { |k,v| v.nil? }
157
153
  request :patch, endpoint, data
158
154
  end
@@ -22,11 +22,11 @@ module Monkeylearn
22
22
  end
23
23
 
24
24
  def retry_if_throttle
25
- ENV['MONKEYLEARN_RETRY_IF_THROTTLE'] || RETRY_IF_THROTTLE
25
+ boolean_setting('MONKEYLEARN_RETRY_IF_THROTTLE', RETRY_IF_THROTTLE)
26
26
  end
27
27
 
28
28
  def auto_batch
29
- ENV['MONKEYLEARN_AUTO_BATCH'] || AUTO_BATCH
29
+ boolean_setting('MONKEYLEARN_AUTO_BATCH', AUTO_BATCH)
30
30
  end
31
31
 
32
32
  def max_batch_size
@@ -36,6 +36,13 @@ module Monkeylearn
36
36
  def default_batch_size
37
37
  DEFAULT_BATCH_SIZE
38
38
  end
39
+
40
+ private
41
+
42
+ def boolean_setting(key, default)
43
+ return default unless ENV.key?(key)
44
+ return !['nil', '', '0', 'off', 'false', 'f'].include?(ENV[key].to_s.downcase)
45
+ end
39
46
  end
40
47
  end
41
48
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['hello@monkeylearn.com']
11
11
  spec.homepage = 'https://github.com/monkeylearn/monkeylearn-ruby'
12
12
 
13
- spec.version = '3.3.2'
13
+ spec.version = '3.3.3'
14
14
 
15
15
  spec.add_dependency 'faraday', '>= 0.9.2', '< 1.0.0'
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monkeylearn
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Monkeylearn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2020-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: 1.3.5
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 2.7.6.2
72
+ rubygems_version: 2.7.6
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Ruby client for the MonkeyLearn API