api-ai-ruby 1.2.0 → 1.2.1

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
  SHA1:
3
- metadata.gz: 80d81f092a618acaa74a093158d2a31df3285ad7
4
- data.tar.gz: 4d37dbe4d5852cd4d0c8cf3c55cfdd117b6f11b8
3
+ metadata.gz: 8d8eb3cb912b9b4ea97e7cf1e228e222fe55c79b
4
+ data.tar.gz: a841d4b046350758e633366b427f5a04c501d63d
5
5
  SHA512:
6
- metadata.gz: f4e48a201428311e784ad7a43bb724dc9c83b35877790195d701cf4dd9c83c1f253099e60e7b0b0f099d86d0ca6210485cf534e24bda94555d8431ac1c960bfc
7
- data.tar.gz: cf8f2961d2a94efe4fa1ad04af478d917b89306be8f57a1ebadbf7b88537778cec55c47efa5988841849af26d358aa88c9adeb2859685eadfabb51096685caaf
6
+ metadata.gz: a00820e65bed040550cbc68e87219b03a1974d8ddcbf61e216a721879d63d6cf5cc45a4ffdd0cf6ebd742da7a9a5171d45afb02abcc795e397bd343ecbe9fe8c
7
+ data.tar.gz: 2ee7eecfa121825412a5de7f9030c02c86986ea7c36dc89cdd7f4fcbf774eca85c5986b3043ea7c69bf745e3654f55a1b0c0095cfc0ef47675d0e091e7b67b79
data/README.md CHANGED
@@ -148,7 +148,8 @@ uer.delete('contacts') # will remove user entities for given session
148
148
 
149
149
  #Changelog
150
150
 
151
- * 1.2.0 - added configurable session_id and separate user_entities (post) request
151
+ * 1.2.1 - fixed UTF-8 in text-requests
152
+ * 1.2.0 - added configurable session_id and full userEntities support
152
153
  * 1.1.4 - removed unused dependency and updated default API version
153
154
  * 1.1.3 - fixed non-correctly serialized parameters in new contexts during query send process
154
155
  * 1.1.2 - fixed compatibility with ruby version less then 2.1.6
@@ -1,6 +1,6 @@
1
1
  module ApiAiRuby
2
2
  class Constants
3
- VERSION = '1.2.0'
3
+ VERSION = '1.2.1'
4
4
  DEFAULT_BASE_URL = 'https://api.api.ai/v1/'
5
5
  DEFAULT_API_VERSION = '20150910'
6
6
  DEFAULT_CLIENT_LANG = 'en'
@@ -3,6 +3,7 @@ module ApiAiRuby
3
3
 
4
4
  def initialize(client, options = {})
5
5
  super client, options
6
+ @headers['Content-Type'] = 'application/json; charset=UTF-8'
6
7
  @crud_base_uri = client.api_base_url + 'userEntities'
7
8
  @uri = @crud_base_uri
8
9
  end
@@ -3,6 +3,7 @@ module ApiAiRuby
3
3
  def initialize (client, options={})
4
4
  options[:lang] = client.api_lang
5
5
  super client, options
6
+ @headers['Content-Type'] = 'application/json; charset=UTF-8'
6
7
  end
7
8
  end
8
9
  end
@@ -12,6 +12,10 @@ describe 'api' do
12
12
  expect(response[:result][:action]).to eq 'greeting'
13
13
  end
14
14
 
15
+ it 'should correct work with utf-8 entities' do
16
+ response = @client.text_request '你好'
17
+ expect(response[:result][:resolvedQuery]).to eq '你好'
18
+ end
15
19
  it 'should use input contexts' do
16
20
  response = @client.text_request 'Hello', :resetContexts => true
17
21
  expect(response[:result][:action]).to eq 'greeting'
@@ -36,7 +40,9 @@ describe 'api' do
36
40
  end
37
41
 
38
42
  it 'should send voiceData to API' do
39
- expect(@client.voice_request(File.new(fixture_path + '/hello.wav'))[:result][:resolvedQuery]).to eq 'hello'
43
+ # expect(@client.voice_request(File.new(fixture_path + '/hello.wav'))[:result][:resolvedQuery]).to eq 'hello'
44
+ # asr was disabled for non-premium users
45
+ expect {@client.voice_request(File.new(fixture_path + '/hello.wav'))}.to raise_error(ApiAiRuby::RequestError)
40
46
  end
41
47
 
42
48
  it 'should correctly set contexts with parameters' do
@@ -98,8 +104,5 @@ describe 'api' do
98
104
  @uer.delete('dwarfs')
99
105
  expect{@uer.retrieve('dwarfs')}.to raise_error(ApiAiRuby::RequestError)
100
106
  end
101
-
102
107
  end
103
-
104
-
105
108
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-ai-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - api.ai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-05 00:00:00.000000000 Z
11
+ date: 2016-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: http
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.9.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.4
55
55
  description: Plugin makes it easy to integrate your Ruby application with https://api.ai
@@ -60,7 +60,7 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - ".gitignore"
63
+ - .gitignore
64
64
  - Gemfile
65
65
  - LICENSE
66
66
  - README.md
@@ -95,17 +95,17 @@ require_paths:
95
95
  - lib
96
96
  required_ruby_version: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - "~>"
98
+ - - ~>
99
99
  - !ruby/object:Gem::Version
100
100
  version: '2.0'
101
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ">="
103
+ - - '>='
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.5.1
108
+ rubygems_version: 2.0.14.1
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: ruby SDK for https://api.ai
@@ -118,3 +118,4 @@ test_files:
118
118
  - spec/api-ai-ruby/voice_request_spec.rb
119
119
  - spec/fixtures/hello.wav
120
120
  - spec/helper.rb
121
+ has_rdoc: