monkeylearn 3.3.1 → 3.4.0

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: 7a05f5a59e4f136e3a347364d986ed92070a626dbaf12fd04bc4a2039ad2fd0e
4
- data.tar.gz: 6d70abafe8c514468fb8b131810b2876a9e096d305a47819a77f75363348d80f
3
+ metadata.gz: 63e3444d4228e9b024b646a7f3917f849fe05696dde2d333a1d00dfd9ab3a048
4
+ data.tar.gz: 54cc2f5ed438d93738aa88b25cac7d8a3e96e0673a50cedbe3762d6f2dff9b8e
5
5
  SHA512:
6
- metadata.gz: ba9764d526c8c9b6871e1e0fb57003da5b964757dd5b496016ba5fbf49b1bfedf8b7f5015854d90c38fcdb8e9dc9861e5fb7254dfdb862c27fdc23adb03169be
7
- data.tar.gz: 29f721771589c0532137ff5da8279529349ce576ef26afd3f0aec356d468de83d07f998541a4bbf7abef9cadb3cfb70ea9b77b43e4b6d51ecbdec3b2b6de6373
6
+ metadata.gz: c23ca00b177b97dff06345ec89598fa9782807083c45683c4e119de0998a8b13cc5bb085456a722ae9631e34fce0a19755f67d028743241d1159a882e7afef96
7
+ data.tar.gz: 6bcba0c1f667ac51ce2f04febf2653fb9722f834a6c47d222167d54fb2b1d136070bcf36b35ba281b8d9eb69e258b94465599e663fba32e875923586f66e3413
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
@@ -20,8 +20,8 @@ module Monkeylearn
20
20
  return WorkflowData
21
21
  end
22
22
 
23
- def metadata
24
- return WorkflowMetadata
23
+ def custom_fields
24
+ return WorkflowCustomFields
25
25
  end
26
26
 
27
27
  def build_endpoint(*args)
@@ -29,13 +29,16 @@ module Monkeylearn
29
29
  end
30
30
 
31
31
  def create(name, options = {})
32
+ if options[:db_name]
33
+ warn 'Note: db_name parameter is ignored by the API and will be removed soon'
34
+ end
35
+
32
36
  data = {
33
37
  name: name,
34
38
  description: options[:description],
35
- db_name: options[:db_name],
36
39
  webhook_url: options[:webhook_url],
37
40
  steps: options[:steps],
38
- metadata: options[:metadata],
41
+ custom_fields: options[:custom_fields],
39
42
  sources: options[:sources],
40
43
  actions: options[:actions],
41
44
  }.delete_if { |k,v| v.nil? }
@@ -72,12 +75,12 @@ module Monkeylearn
72
75
  end
73
76
  end
74
77
 
75
- module WorkflowMetadata
78
+ module WorkflowCustomFields
76
79
  class << self
77
80
  include Monkeylearn::Requests
78
81
 
79
82
  def build_endpoint(module_id, *args)
80
- File.join('workflows', module_id, 'metadata', *args.collect { |x| x.to_s }) + '/'
83
+ File.join('workflows', module_id, 'custom-fields', *args.collect { |x| x.to_s }) + '/'
81
84
  end
82
85
 
83
86
  def create(module_id, options = {})
data/monkeylearn.gemspec CHANGED
@@ -10,9 +10,9 @@ 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.1'
13
+ spec.version = '3.4.0'
14
14
 
15
- spec.add_dependency 'faraday', '>= 0.9.2', '<= 0.15.0'
15
+ spec.add_dependency 'faraday', '>= 0.9.2', '< 1.0.0'
16
16
 
17
17
  spec.licenses = ['MIT']
18
18
 
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.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Monkeylearn
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2021-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -17,9 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.2
20
- - - "<="
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.15.0
22
+ version: 1.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +27,9 @@ dependencies:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.9.2
30
- - - "<="
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 0.15.0
32
+ version: 1.0.0
33
33
  description: A simple client for the MonkeyLearn API
34
34
  email:
35
35
  - hello@monkeylearn.com
@@ -53,7 +53,7 @@ homepage: https://github.com/monkeylearn/monkeylearn-ruby
53
53
  licenses:
54
54
  - MIT
55
55
  metadata: {}
56
- post_install_message:
56
+ post_install_message:
57
57
  rdoc_options: []
58
58
  require_paths:
59
59
  - lib
@@ -68,9 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.3.5
70
70
  requirements: []
71
- rubyforge_project:
72
- rubygems_version: 2.7.6
73
- signing_key:
71
+ rubygems_version: 3.2.16
72
+ signing_key:
74
73
  specification_version: 4
75
74
  summary: Ruby client for the MonkeyLearn API
76
75
  test_files: []