voicebase-client-ruby 1.2.1 → 1.2.2
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +5 -2
- data/README.md +13 -6
- data/lib/voicebase/json/word.rb +3 -3
- data/lib/voicebase/v2/client.rb +1 -1
- data/lib/voicebase/version.rb +1 -1
- data/voicebase-client-ruby.gemspec +1 -1
- metadata +7 -8
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d460286c7fb5ebb801e74e3f45e7f8613f3c582
|
4
|
+
data.tar.gz: 56e8c7d51810d18f01139a4977f3fa5d7c94ad0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 425aca1bc7b4af3547901267f1fe103b54cd891b2da5b68e4e58ed97ab3b814a506aa52593f10a5fd5c4f26290b39424a970d487b26428aa9c34b855f6581ee0
|
7
|
+
data.tar.gz: 2512ce349d53ece41d6a45b39b8592a7f9dc8284100ac0124ce5b330e87abc9e0121f47da6c07e8366b56841a659e0375b5fb4c390f470ab89fc6994f0caa65d
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# Voicebase Client Ruby
|
2
2
|
|
3
|
+
[](https://travis-ci.org/usertesting/voicebase-client-ruby)
|
4
|
+
|
3
5
|
This is a Ruby client to the VoiceBase API Version [1.x](http://www.voicebase.com/developers/), see [API documentation](https://s3.amazonaws.com/vb-developers/VB-api-devguide-v1.1.5.pdf), and [2.x](https://apis.voicebase.com). Some portions of this gem were derived from [voicebase-client-ruby](https://github.com/popuparchive/voicebase-client-ruby).
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
Add this line to your application's Gemfile
|
9
|
+
Add this line to your application's `Gemfile`:
|
8
10
|
|
9
11
|
```ruby
|
10
12
|
gem 'voicebase-client-ruby', github: "usertesting/voicebase-client-ruby"
|
@@ -14,6 +16,13 @@ And then execute:
|
|
14
16
|
|
15
17
|
$ bundle
|
16
18
|
|
19
|
+
This gem is compatible with Ruby versions:
|
20
|
+
|
21
|
+
* 2.0.x
|
22
|
+
* 2.1.x
|
23
|
+
* 2.2.x
|
24
|
+
* 2.3.x
|
25
|
+
|
17
26
|
## Usage
|
18
27
|
|
19
28
|
### VoiceBase API V1.x:
|
@@ -38,11 +47,10 @@ client.upload_media({
|
|
38
47
|
error_callback: "http://my.example.com/error"
|
39
48
|
})
|
40
49
|
|
41
|
-
response = get_transcript(external_id: 'abcd1234' format: "json")
|
50
|
+
response = client.get_transcript(external_id: 'abcd1234' format: "json")
|
42
51
|
if response.success?
|
43
52
|
transcript_json = JSON.parse(response.transcript)
|
44
53
|
end
|
45
|
-
|
46
54
|
```
|
47
55
|
|
48
56
|
For VoiceBase API V2.x:
|
@@ -51,7 +59,7 @@ For VoiceBase API V2.x:
|
|
51
59
|
require 'voicebase'
|
52
60
|
|
53
61
|
client = VoiceBase::Client.new({
|
54
|
-
api_version: "2.0
|
62
|
+
api_version: "2.0",
|
55
63
|
auth_key: "my-voicebase-key",
|
56
64
|
auth_secret: "my-voicebase-secret",
|
57
65
|
})
|
@@ -83,11 +91,10 @@ client.get_transcript({
|
|
83
91
|
|
84
92
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
85
93
|
|
86
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
94
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
87
95
|
|
88
96
|
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
89
97
|
|
90
98
|
## Contributing
|
91
99
|
|
92
100
|
Bug reports and pull requests are welcome on GitHub at https://github.com/usertesting/voicebase-client-ruby.
|
93
|
-
|
data/lib/voicebase/json/word.rb
CHANGED
@@ -53,11 +53,11 @@ module VoiceBase
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def to_hash
|
56
|
-
{"p"
|
56
|
+
{ "p" => sequence, "c" => confidence, "s" => start_time, "e" => end_time, "w" => word }
|
57
57
|
end
|
58
58
|
|
59
59
|
def to_json
|
60
|
-
{"p"
|
60
|
+
{ "p" => sequence, "c" => confidence, "s" => start_time, "e" => end_time, "w" => word }.to_json
|
61
61
|
end
|
62
62
|
end
|
63
|
-
end
|
63
|
+
end
|
data/lib/voicebase/v2/client.rb
CHANGED
@@ -20,7 +20,7 @@ module VoiceBase
|
|
20
20
|
'Accept' => 'application/json'
|
21
21
|
}
|
22
22
|
), api_version)
|
23
|
-
@token = VoiceBase::Client::Token.new(response.tokens.
|
23
|
+
@token = VoiceBase::Client::Token.new(response.tokens.any? && response.tokens.first.fetch("token"))
|
24
24
|
rescue NoMethodError => ex
|
25
25
|
raise VoiceBase::AuthenticationError, response.status_message
|
26
26
|
end
|
data/lib/voicebase/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voicebase-client-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen Fesslmeier
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -86,16 +86,16 @@ dependencies:
|
|
86
86
|
name: activesupport
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- - "
|
89
|
+
- - "~>"
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
91
|
+
version: '4'
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- - "
|
96
|
+
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '
|
98
|
+
version: '4'
|
99
99
|
description: Ruby client for VoiceBase API Version 1.x and 2.x that will make both
|
100
100
|
API versions available at the same time.
|
101
101
|
email:
|
@@ -108,7 +108,6 @@ files:
|
|
108
108
|
- ".gitignore"
|
109
109
|
- ".rspec"
|
110
110
|
- ".ruby-gemset"
|
111
|
-
- ".ruby-version"
|
112
111
|
- ".travis.yml"
|
113
112
|
- Gemfile
|
114
113
|
- LICENSE
|
@@ -151,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
150
|
version: '0'
|
152
151
|
requirements: []
|
153
152
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.5.1
|
155
154
|
signing_key:
|
156
155
|
specification_version: 4
|
157
156
|
summary: Ruby client for VoiceBase API Version 1.x and 2.x.
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.2.4
|