docomo-nlu 0.3.1 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.ruby.yml +5 -9
  3. data/Gemfile.lock +110 -120
  4. data/docomo-nlu.gemspec +4 -4
  5. data/lib/docomo_nlu/management.rb +1 -0
  6. data/lib/docomo_nlu/management/aiml_base.rb +1 -1
  7. data/lib/docomo_nlu/management/ng_word.rb +2 -1
  8. data/lib/docomo_nlu/management/ok_ng_base.rb +78 -0
  9. data/lib/docomo_nlu/management/ok_word.rb +2 -1
  10. data/lib/docomo_nlu/spontaneous.rb +3 -3
  11. data/lib/docomo_nlu/version.rb +1 -1
  12. data/vcr/vcr_cassettes/management/ng_word/create.yml +46 -0
  13. data/vcr/vcr_cassettes/management/ng_word/create_400.yml +50 -0
  14. data/vcr/vcr_cassettes/management/ng_word/create_409.yml +48 -0
  15. data/vcr/vcr_cassettes/management/ng_word/delete.yml +38 -0
  16. data/vcr/vcr_cassettes/management/ng_word/download.yml +44 -0
  17. data/vcr/vcr_cassettes/management/ng_word/index_all.yml +44 -0
  18. data/vcr/vcr_cassettes/management/ng_word/index_find.yml +44 -0
  19. data/vcr/vcr_cassettes/management/ng_word/index_where.yml +44 -0
  20. data/vcr/vcr_cassettes/management/ng_word/save.yml +46 -0
  21. data/vcr/vcr_cassettes/management/ng_word/save_400.yml +50 -0
  22. data/vcr/vcr_cassettes/management/ng_word/save_409.yml +48 -0
  23. data/vcr/vcr_cassettes/management/ng_word/show_find.yml +44 -0
  24. data/vcr/vcr_cassettes/management/ok_word/create.yml +46 -0
  25. data/vcr/vcr_cassettes/management/ok_word/create_400.yml +50 -0
  26. data/vcr/vcr_cassettes/management/ok_word/create_409.yml +48 -0
  27. data/vcr/vcr_cassettes/management/ok_word/delete.yml +38 -0
  28. data/vcr/vcr_cassettes/management/ok_word/download.yml +44 -0
  29. data/vcr/vcr_cassettes/management/ok_word/index_all.yml +44 -0
  30. data/vcr/vcr_cassettes/management/ok_word/index_find.yml +44 -0
  31. data/vcr/vcr_cassettes/management/ok_word/index_where.yml +44 -0
  32. data/vcr/vcr_cassettes/management/ok_word/save.yml +46 -0
  33. data/vcr/vcr_cassettes/management/ok_word/save_400.yml +50 -0
  34. data/vcr/vcr_cassettes/management/ok_word/save_409.yml +48 -0
  35. data/vcr/vcr_cassettes/management/ok_word/show_find.yml +44 -0
  36. metadata +45 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 006b3eb5a7e9beadb882d58f66192547d803aa3d5a55734ae7ecf28156212ac8
4
- data.tar.gz: 3de06dc75c3183c467cf1e15071ef4c0fa6418994dac5d11cb6afee234f8db7c
3
+ metadata.gz: 79a56f82e5e24fa7bd29f3b0311abd58c396b6528fc2447bf378900c8d371fca
4
+ data.tar.gz: 484cac8c6f3a91f1b0cfc6ce318ecd905de05871a3e3753435f80491d66ecf11
5
5
  SHA512:
6
- metadata.gz: 7daf93bde6c23c08e97941bc867043ab75d960c46f69139945b4b06636ab745d03b94817e303ecd252dd1176c8a326dd2c88c14344af457ba078de5d4f991db2
7
- data.tar.gz: 1b9683017105086b4cf9d25a14c30354a40be09545be6f3bf1b0c012ccdbe7e78c2d69accda04effe4149248a6671367fd308b783aaa1903f7da98d365f015fa
6
+ metadata.gz: e4ea5f6da24052fe6e06266498b0e42522b4a09766acd77cf44705a311bdfceee67480c101eb6595756ca535074e9590c740ae41a9dfdb4898936947501aa658
7
+ data.tar.gz: f949da252d0a4bef7b7687b286719ff4f8b649f56d64bd6d03b1e45b4c4567261094c5ad0bd6079054a9ce488bb9f103cb723559665f759f782f8c337df29273
data/.rubocop.ruby.yml CHANGED
@@ -29,12 +29,12 @@ Layout/ExtraSpacing:
29
29
  # special_inside_parentheses (default) と比べて
30
30
  # * 横に長くなりづらい
31
31
  # * メソッド名の長さが変わったときに diff が少ない
32
- Layout/IndentFirstArrayElement:
32
+ Layout/FirstArrayElementIndentation:
33
33
  EnforcedStyle: consistent
34
34
 
35
35
  # ({ と hash を開始した場合に ( の位置にインデントさせる
36
36
  # そもそも {} が必要ない可能性が高いが Style/BracesAroundHashParameters はチェックしないことにしたので
37
- Layout/IndentFirstHashElement:
37
+ Layout/FirstHashElementIndentation:
38
38
  EnforcedStyle: consistent
39
39
 
40
40
  # private/protected は一段深くインデントする
@@ -129,7 +129,7 @@ Metrics/CyclomaticComplexity:
129
129
  # * 警告 120文字
130
130
  # * 禁止 160文字
131
131
  # のイメージ
132
- Metrics/LineLength:
132
+ Layout/LineLength:
133
133
  Max: 160
134
134
  Exclude:
135
135
  - "db/migrate/*.rb"
@@ -149,7 +149,7 @@ Metrics/PerceivedComplexity:
149
149
 
150
150
  # has_ から始まるメソッドは許可する
151
151
  Naming/PredicateName:
152
- NamePrefixBlacklist:
152
+ ForbiddenPrefixes:
153
153
  - "is_"
154
154
  - "have_"
155
155
  NamePrefix:
@@ -160,7 +160,7 @@ Naming/PredicateName:
160
160
  # n(umber) といった 1 文字変数は頻出するし、前置詞(by, to, ...)や
161
161
  # よく知られた省略語 (op: operator とか pk: primary key とか) も妥当。
162
162
  # 変数 s にどんな文字列かを形容したい場合と、不要な場合とがある=無効
163
- Naming/UncommunicativeMethodParamName:
163
+ Naming/MethodParameterName:
164
164
  Enabled: false
165
165
 
166
166
  #################### Performance ###########################
@@ -202,10 +202,6 @@ Style/BlockDelimiters:
202
202
  Exclude:
203
203
  - "spec/**/*_spec.rb"
204
204
 
205
- # option 等、明示的にハッシュにした方が分かりやすい場合もある
206
- Style/BracesAroundHashParameters:
207
- Enabled: false
208
-
209
205
  # scope が違うとか親 module の存在確認が必要とかデメリットはあるが、
210
206
  # namespace 付きのクラスはかなり頻繁に作るので簡単に書きたい。
211
207
  Style/ClassAndModuleChildren:
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docomo-nlu (0.3.1)
5
- activeresource (~> 5.0.0)
4
+ docomo-nlu (0.3.7)
5
+ activeresource (>= 5.0, < 5.2)
6
6
  bundler
7
7
  faraday
8
8
  rake
@@ -11,201 +11,191 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (5.2.3)
15
- actionpack (= 5.2.3)
14
+ actioncable (5.2.6)
15
+ actionpack (= 5.2.6)
16
16
  nio4r (~> 2.0)
17
17
  websocket-driver (>= 0.6.1)
18
- actionmailer (5.2.3)
19
- actionpack (= 5.2.3)
20
- actionview (= 5.2.3)
21
- activejob (= 5.2.3)
18
+ actionmailer (5.2.6)
19
+ actionpack (= 5.2.6)
20
+ actionview (= 5.2.6)
21
+ activejob (= 5.2.6)
22
22
  mail (~> 2.5, >= 2.5.4)
23
23
  rails-dom-testing (~> 2.0)
24
- actionpack (5.2.3)
25
- actionview (= 5.2.3)
26
- activesupport (= 5.2.3)
27
- rack (~> 2.0)
24
+ actionpack (5.2.6)
25
+ actionview (= 5.2.6)
26
+ activesupport (= 5.2.6)
27
+ rack (~> 2.0, >= 2.0.8)
28
28
  rack-test (>= 0.6.3)
29
29
  rails-dom-testing (~> 2.0)
30
30
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
- actionview (5.2.3)
32
- activesupport (= 5.2.3)
31
+ actionview (5.2.6)
32
+ activesupport (= 5.2.6)
33
33
  builder (~> 3.1)
34
34
  erubi (~> 1.4)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
37
- activejob (5.2.3)
38
- activesupport (= 5.2.3)
37
+ activejob (5.2.6)
38
+ activesupport (= 5.2.6)
39
39
  globalid (>= 0.3.6)
40
- activemodel (5.2.3)
41
- activesupport (= 5.2.3)
40
+ activemodel (5.2.6)
41
+ activesupport (= 5.2.6)
42
42
  activemodel-serializers-xml (1.0.2)
43
43
  activemodel (> 5.x)
44
44
  activesupport (> 5.x)
45
45
  builder (~> 3.1)
46
- activerecord (5.2.3)
47
- activemodel (= 5.2.3)
48
- activesupport (= 5.2.3)
46
+ activerecord (5.2.6)
47
+ activemodel (= 5.2.6)
48
+ activesupport (= 5.2.6)
49
49
  arel (>= 9.0)
50
- activeresource (5.0.0)
51
- activemodel (>= 5.0, < 6)
50
+ activeresource (5.1.1)
51
+ activemodel (>= 5.0, < 7)
52
52
  activemodel-serializers-xml (~> 1.0)
53
- activesupport (>= 5.0, < 6)
54
- activestorage (5.2.3)
55
- actionpack (= 5.2.3)
56
- activerecord (= 5.2.3)
57
- marcel (~> 0.3.1)
58
- activesupport (5.2.3)
53
+ activesupport (>= 5.0, < 7)
54
+ activestorage (5.2.6)
55
+ actionpack (= 5.2.6)
56
+ activerecord (= 5.2.6)
57
+ marcel (~> 1.0.0)
58
+ activesupport (5.2.6)
59
59
  concurrent-ruby (~> 1.0, >= 1.0.2)
60
60
  i18n (>= 0.7, < 2)
61
61
  minitest (~> 5.1)
62
62
  tzinfo (~> 1.1)
63
- addressable (2.6.0)
64
- public_suffix (>= 2.0.2, < 4.0)
63
+ addressable (2.7.0)
64
+ public_suffix (>= 2.0.2, < 5.0)
65
65
  arel (9.0.0)
66
66
  ast (2.4.0)
67
- axiom-types (0.1.1)
68
- descendants_tracker (~> 0.0.4)
69
- ice_nine (~> 0.11.0)
70
- thread_safe (~> 0.3, >= 0.3.1)
71
- builder (3.2.3)
72
- codeclimate-engine-rb (0.4.1)
73
- virtus (~> 1.0)
67
+ builder (3.2.4)
74
68
  coderay (1.1.2)
75
- coercible (1.0.0)
76
- descendants_tracker (~> 0.0.1)
77
- concurrent-ruby (1.1.5)
69
+ concurrent-ruby (1.1.8)
78
70
  crack (0.4.3)
79
71
  safe_yaml (~> 1.0.0)
80
- crass (1.0.4)
81
- descendants_tracker (0.0.4)
82
- thread_safe (~> 0.3, >= 0.3.1)
72
+ crass (1.0.6)
83
73
  diff-lcs (1.3)
84
- equalizer (0.0.11)
85
- erubi (1.8.0)
86
- faraday (0.17.0)
74
+ erubi (1.10.0)
75
+ faraday (1.4.1)
76
+ faraday-excon (~> 1.1)
77
+ faraday-net_http (~> 1.0)
78
+ faraday-net_http_persistent (~> 1.1)
87
79
  multipart-post (>= 1.2, < 3)
80
+ ruby2_keywords (>= 0.0.4)
81
+ faraday-excon (1.1.0)
82
+ faraday-net_http (1.0.1)
83
+ faraday-net_http_persistent (1.1.0)
88
84
  globalid (0.4.2)
89
85
  activesupport (>= 4.2.0)
90
- hashdiff (1.0.0)
91
- i18n (1.6.0)
86
+ hashdiff (1.0.1)
87
+ i18n (1.8.10)
92
88
  concurrent-ruby (~> 1.0)
93
- ice_nine (0.11.2)
94
- jaro_winkler (1.5.3)
95
89
  kwalify (0.7.2)
96
- loofah (2.2.3)
90
+ loofah (2.9.1)
97
91
  crass (~> 1.0.2)
98
92
  nokogiri (>= 1.5.9)
99
93
  mail (2.7.1)
100
94
  mini_mime (>= 0.1.1)
101
- marcel (0.3.3)
102
- mimemagic (~> 0.3.2)
95
+ marcel (1.0.1)
103
96
  method_source (0.9.2)
104
- mimemagic (0.3.3)
105
- mini_mime (1.0.2)
106
- mini_portile2 (2.4.0)
107
- minitest (5.11.3)
97
+ mini_mime (1.1.0)
98
+ mini_portile2 (2.5.1)
99
+ minitest (5.14.4)
108
100
  multipart-post (2.1.1)
109
- nio4r (2.4.0)
110
- nokogiri (1.10.4)
111
- mini_portile2 (~> 2.4.0)
112
- parallel (1.17.0)
113
- parser (2.6.4.1)
101
+ nio4r (2.5.7)
102
+ nokogiri (1.11.4)
103
+ mini_portile2 (~> 2.5.0)
104
+ racc (~> 1.4)
105
+ parallel (1.19.1)
106
+ parser (2.7.1.2)
114
107
  ast (~> 2.4.0)
115
108
  pry (0.11.3)
116
109
  coderay (~> 1.1.0)
117
110
  method_source (~> 0.9.0)
118
111
  psych (3.1.0)
119
- public_suffix (3.1.1)
120
- rack (2.0.7)
112
+ public_suffix (4.0.5)
113
+ racc (1.5.2)
114
+ rack (2.2.3)
121
115
  rack-test (1.1.0)
122
116
  rack (>= 1.0, < 3)
123
- rails (5.2.3)
124
- actioncable (= 5.2.3)
125
- actionmailer (= 5.2.3)
126
- actionpack (= 5.2.3)
127
- actionview (= 5.2.3)
128
- activejob (= 5.2.3)
129
- activemodel (= 5.2.3)
130
- activerecord (= 5.2.3)
131
- activestorage (= 5.2.3)
132
- activesupport (= 5.2.3)
117
+ rails (5.2.6)
118
+ actioncable (= 5.2.6)
119
+ actionmailer (= 5.2.6)
120
+ actionpack (= 5.2.6)
121
+ actionview (= 5.2.6)
122
+ activejob (= 5.2.6)
123
+ activemodel (= 5.2.6)
124
+ activerecord (= 5.2.6)
125
+ activestorage (= 5.2.6)
126
+ activesupport (= 5.2.6)
133
127
  bundler (>= 1.3.0)
134
- railties (= 5.2.3)
128
+ railties (= 5.2.6)
135
129
  sprockets-rails (>= 2.0.0)
136
130
  rails-dom-testing (2.0.3)
137
131
  activesupport (>= 4.2.0)
138
132
  nokogiri (>= 1.6)
139
- rails-html-sanitizer (1.2.0)
140
- loofah (~> 2.2, >= 2.2.2)
141
- railties (5.2.3)
142
- actionpack (= 5.2.3)
143
- activesupport (= 5.2.3)
133
+ rails-html-sanitizer (1.3.0)
134
+ loofah (~> 2.3)
135
+ railties (5.2.6)
136
+ actionpack (= 5.2.6)
137
+ activesupport (= 5.2.6)
144
138
  method_source
145
139
  rake (>= 0.8.7)
146
140
  thor (>= 0.19.0, < 2.0)
147
141
  rainbow (3.0.0)
148
- rake (12.3.3)
149
- reek (5.4.0)
150
- codeclimate-engine-rb (~> 0.4.0)
142
+ rake (13.0.3)
143
+ reek (6.0.0)
151
144
  kwalify (~> 0.7.0)
152
- parser (>= 2.5.0.0, < 2.7, != 2.5.1.1)
145
+ parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
153
146
  psych (~> 3.1.0)
154
147
  rainbow (>= 2.0, < 4.0)
155
- rspec (3.8.0)
156
- rspec-core (~> 3.8.0)
157
- rspec-expectations (~> 3.8.0)
158
- rspec-mocks (~> 3.8.0)
159
- rspec-core (3.8.2)
160
- rspec-support (~> 3.8.0)
161
- rspec-expectations (3.8.4)
148
+ rexml (3.2.5)
149
+ rspec (3.9.0)
150
+ rspec-core (~> 3.9.0)
151
+ rspec-expectations (~> 3.9.0)
152
+ rspec-mocks (~> 3.9.0)
153
+ rspec-core (3.9.2)
154
+ rspec-support (~> 3.9.3)
155
+ rspec-expectations (3.9.2)
162
156
  diff-lcs (>= 1.2.0, < 2.0)
163
- rspec-support (~> 3.8.0)
164
- rspec-mocks (3.8.1)
157
+ rspec-support (~> 3.9.0)
158
+ rspec-mocks (3.9.1)
165
159
  diff-lcs (>= 1.2.0, < 2.0)
166
- rspec-support (~> 3.8.0)
167
- rspec-support (3.8.2)
160
+ rspec-support (~> 3.9.0)
161
+ rspec-support (3.9.3)
168
162
  rspec_junit_formatter (0.4.1)
169
163
  rspec-core (>= 2, < 4, != 2.12.0)
170
- rubocop (0.74.0)
171
- jaro_winkler (~> 1.5.1)
164
+ rubocop (0.83.0)
172
165
  parallel (~> 1.10)
173
- parser (>= 2.6)
166
+ parser (>= 2.7.0.1)
174
167
  rainbow (>= 2.2.2, < 4.0)
168
+ rexml
175
169
  ruby-progressbar (~> 1.7)
176
- unicode-display_width (>= 1.4.0, < 1.7)
177
- rubocop-performance (1.4.1)
170
+ unicode-display_width (>= 1.4.0, < 2.0)
171
+ rubocop-performance (1.5.2)
178
172
  rubocop (>= 0.71.0)
179
173
  rubocop-rspec (1.35.0)
180
174
  rubocop (>= 0.60.0)
181
175
  ruby-progressbar (1.10.1)
182
- rubyzip (2.0.0)
176
+ ruby2_keywords (0.0.4)
177
+ rubyzip (2.3.0)
183
178
  safe_yaml (1.0.5)
184
- sprockets (3.7.2)
179
+ sprockets (4.0.2)
185
180
  concurrent-ruby (~> 1.0)
186
181
  rack (> 1, < 3)
187
- sprockets-rails (3.2.1)
182
+ sprockets-rails (3.2.2)
188
183
  actionpack (>= 4.0)
189
184
  activesupport (>= 4.0)
190
185
  sprockets (>= 3.0.0)
191
- thor (0.20.3)
186
+ thor (1.1.0)
192
187
  thread_safe (0.3.6)
193
- tzinfo (1.2.5)
188
+ tzinfo (1.2.9)
194
189
  thread_safe (~> 0.1)
195
- unicode-display_width (1.6.0)
196
- vcr (4.0.0)
197
- virtus (1.0.5)
198
- axiom-types (~> 0.1)
199
- coercible (~> 1.0)
200
- descendants_tracker (~> 0.0, >= 0.0.3)
201
- equalizer (~> 0.0, >= 0.0.9)
202
- webmock (3.4.2)
190
+ unicode-display_width (1.7.0)
191
+ vcr (5.1.0)
192
+ webmock (3.5.1)
203
193
  addressable (>= 2.3.6)
204
194
  crack (>= 0.3.2)
205
195
  hashdiff
206
- websocket-driver (0.7.1)
196
+ websocket-driver (0.7.3)
207
197
  websocket-extensions (>= 0.1.0)
208
- websocket-extensions (0.1.4)
198
+ websocket-extensions (0.1.5)
209
199
 
210
200
  PLATFORMS
211
201
  ruby
@@ -213,15 +203,15 @@ PLATFORMS
213
203
  DEPENDENCIES
214
204
  docomo-nlu!
215
205
  pry (~> 0.11.3)
216
- rails
206
+ rails (~> 5.2.5)
217
207
  reek
218
208
  rspec
219
209
  rspec_junit_formatter
220
210
  rubocop
221
211
  rubocop-performance
222
212
  rubocop-rspec (~> 1.35.0)
223
- vcr (~> 4.0.0)
224
- webmock (~> 3.4.2)
213
+ vcr (~> 5.1.0)
214
+ webmock (~> 3.5.0)
225
215
 
226
216
  BUNDLED WITH
227
- 2.0.2
217
+ 2.1.4
data/docomo-nlu.gemspec CHANGED
@@ -23,19 +23,19 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_dependency "activeresource", "~> 5.0.0"
26
+ spec.add_dependency "activeresource", ">= 5.0", "< 5.2"
27
27
  spec.add_dependency "bundler"
28
28
  spec.add_dependency "faraday"
29
29
  spec.add_dependency "rake"
30
30
  spec.add_dependency "rubyzip"
31
31
  spec.add_development_dependency "pry", "~> 0.11.3"
32
- spec.add_development_dependency "rails"
32
+ spec.add_development_dependency "rails", "~> 5.2.5"
33
33
  spec.add_development_dependency "reek"
34
34
  spec.add_development_dependency "rspec"
35
35
  spec.add_development_dependency "rspec_junit_formatter"
36
36
  spec.add_development_dependency "rubocop"
37
37
  spec.add_development_dependency "rubocop-performance"
38
38
  spec.add_development_dependency "rubocop-rspec", "~> 1.35.0"
39
- spec.add_development_dependency "vcr", "~> 4.0.0"
40
- spec.add_development_dependency "webmock", "~> 3.4.2"
39
+ spec.add_development_dependency "vcr", "~> 5.1.0"
40
+ spec.add_development_dependency "webmock", "~> 3.5.0"
41
41
  end
@@ -15,6 +15,7 @@ module DocomoNlu
15
15
  autoload :Map, "docomo_nlu/management/map"
16
16
  autoload :NGWord, "docomo_nlu/management/ng_word"
17
17
  autoload :OKWord, "docomo_nlu/management/ok_word"
18
+ autoload :OKNGBase, "docomo_nlu/management/ok_ng_base"
18
19
  autoload :OrganizationMember, "docomo_nlu/management/organization_member"
19
20
  autoload :Organization, "docomo_nlu/management/organization"
20
21
  autoload :PredicateName, "docomo_nlu/management/predicate_name"
@@ -37,7 +37,7 @@ module DocomoNlu
37
37
 
38
38
  def transfer
39
39
  prefix_options[:bot_id] ||= botId
40
- self.class.deploy_request(prefix_options)
40
+ self.class.transfer(prefix_options)
41
41
  end
42
42
 
43
43
  def deploy
@@ -2,9 +2,10 @@
2
2
 
3
3
  module DocomoNlu
4
4
  module Management
5
- class NGWord < Base
5
+ class NGWord < OKNGBase
6
6
  self.element_name = "ngWords"
7
7
  self.prefix = "/management/v2.6/projects/:project_id/bots/:bot_id/"
8
+ self.extention = ".ng"
8
9
  end
9
10
  end
10
11
  end