adhearsion 2.4.0.beta3 → 2.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 +4 -4
- data/CHANGELOG.md +2 -1
- data/adhearsion.gemspec +1 -1
- data/lib/adhearsion/call_controller/output.rb +31 -1
- data/lib/adhearsion/call_controller/output/formatter.rb +6 -0
- data/lib/adhearsion/cli_commands/plugin_command.rb +2 -2
- data/lib/adhearsion/version.rb +1 -1
- data/spec/adhearsion/call_controller/output_spec.rb +56 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61315b79e7d1320dea8413e2b5c26f9b1c953551
|
4
|
+
data.tar.gz: 2935a1722a541274a596fb2a35d5e3e5b7d05a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4210b4cae9891cc1f5f2e6ecca89e7e4b0f371287d0726f3a876b99910e35b887758d1f5ab6e59a2afca1c58c9e270cb4377c531c55d4d79e1c9454773319af
|
7
|
+
data.tar.gz: 8302e6d6500220edd4892b557f79b1c5fcdcaa1d68771a3bb6db2f7094f36912c349c9f297adaeef8b4ba572aa0dadddf2fc2121c09e1dd592d20bff843d625d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# [develop](https://github.com/adhearsion/adhearsion)
|
2
2
|
|
3
|
-
# [2.4.0
|
3
|
+
# [2.4.0](https://github.com/adhearsion/adhearsion/compare/v2.3.5...v2.4.0) - [2013-08-29](https://rubygems.org/gems/adhearsion/versions/2.4.0)
|
4
4
|
* Deprecation: Ruby 1.9.2 support is deprecated and will be dropped in a future version of Adhearsion
|
5
5
|
* Deprecation: Some media options from Punchblock config are now overriden by other core config, and will eventually be removed.
|
6
6
|
* Deprecation: Core implementations of `CallController#ask` and `#menu` are deprecated, and will be replaced in future with those in [adhearsion-asr](http://github.com/adhearsion/adhearsion-asr). See http://adhearsion.com/docs/common_problems#toc_3 for details.
|
@@ -13,6 +13,7 @@
|
|
13
13
|
* Feature: Add `#originate` method to console as alias for `Adhearsion::OutboundCall.originate`
|
14
14
|
* Feature: Allow the console to be disabled using `--no-console`
|
15
15
|
* Feature: Add CLI commands to generate hooks for a plugin to register on [ahnhub.com](http://www.ahnhub.com)
|
16
|
+
* Feature: Add `#say_characters` method and an async cousin, `#say_characters!`
|
16
17
|
* Bugfix: Removed unnecessary Mocha reference from generated plugin
|
17
18
|
* Bugfix: Call loggers are deleted after a call finishes, fixing a memory leak
|
18
19
|
* Bugfix: A menu definition's block context is now available
|
data/adhearsion.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_runtime_dependency 'jruby-openssl' if RUBY_PLATFORM == 'java'
|
30
30
|
s.add_runtime_dependency 'logging', ["~> 1.8"]
|
31
31
|
s.add_runtime_dependency 'pry'
|
32
|
-
s.add_runtime_dependency 'punchblock', ["~> 2.0
|
32
|
+
s.add_runtime_dependency 'punchblock', ["~> 2.0"]
|
33
33
|
s.add_runtime_dependency 'rake'
|
34
34
|
s.add_runtime_dependency 'ruby_speech', ["~> 2.0"]
|
35
35
|
s.add_runtime_dependency 'thor', "~> 0.18.0"
|
@@ -38,6 +38,36 @@ module Adhearsion
|
|
38
38
|
end
|
39
39
|
alias :speak! :say!
|
40
40
|
|
41
|
+
|
42
|
+
# Speak characters using text-to-speech (TTS)
|
43
|
+
#
|
44
|
+
# @example Speak 'abc123' as 'ay bee cee one two three'
|
45
|
+
# say_characters('abc123')
|
46
|
+
#
|
47
|
+
# @param [String, #to_s] characters The string of characters to be spoken
|
48
|
+
# @param [Hash] options A set of options for output
|
49
|
+
#
|
50
|
+
# @raises [PlaybackError] if the given argument could not be played
|
51
|
+
#
|
52
|
+
def say_characters(characters, options = {})
|
53
|
+
player.play_ssml output_formatter.ssml_for_characters(characters), options
|
54
|
+
true
|
55
|
+
end
|
56
|
+
|
57
|
+
# Speak characters using text-to-speech (TTS) and return as soon as it begins
|
58
|
+
#
|
59
|
+
# @example Speak 'abc123' as 'ay bee cee one two three'
|
60
|
+
# say_characters!('abc123')
|
61
|
+
#
|
62
|
+
# @param [String, #to_s] characters The string of characters to be spoken
|
63
|
+
# @param [Hash] options A set of options for output
|
64
|
+
#
|
65
|
+
# @raises [PlaybackError] if the given argument could not be played
|
66
|
+
#
|
67
|
+
def say_characters!(characters, options = {})
|
68
|
+
async_player.play_ssml output_formatter.ssml_for_characters(characters), options
|
69
|
+
end
|
70
|
+
|
41
71
|
#
|
42
72
|
# Plays the specified sound file names. This method will handle Time/DateTime objects (e.g. Time.now),
|
43
73
|
# Fixnums (e.g. 1000), Strings which are valid Fixnums (e.g "123"), and direct sound files. To specify how the Date/Time objects are said
|
@@ -219,7 +249,7 @@ module Adhearsion
|
|
219
249
|
# @raises [PlaybackError] if (one of) the given argument(s) could not be played
|
220
250
|
#
|
221
251
|
def interruptible_play(*outputs)
|
222
|
-
options = process_output_options outputs
|
252
|
+
options = process_output_options outputs
|
223
253
|
outputs.find do |output|
|
224
254
|
digit = stream_file output, '0123456789#*', options
|
225
255
|
return digit if digit
|
data/lib/adhearsion/version.rb
CHANGED
@@ -925,6 +925,62 @@ module Adhearsion
|
|
925
925
|
subject.method(:speak!).should be == subject.method(:say!)
|
926
926
|
end
|
927
927
|
end
|
928
|
+
|
929
|
+
describe "#say_characters" do
|
930
|
+
context "with a string" do
|
931
|
+
let :ssml do
|
932
|
+
RubySpeech::SSML.draw do
|
933
|
+
say_as(interpret_as: 'characters') { "1234#abc" }
|
934
|
+
end
|
935
|
+
end
|
936
|
+
|
937
|
+
it 'plays the correct ssml' do
|
938
|
+
expect_ssml_output ssml
|
939
|
+
subject.say_characters('1234#abc').should be true
|
940
|
+
end
|
941
|
+
end
|
942
|
+
|
943
|
+
context "with a numeric" do
|
944
|
+
let :ssml do
|
945
|
+
RubySpeech::SSML.draw do
|
946
|
+
say_as(interpret_as: 'characters') { "1234" }
|
947
|
+
end
|
948
|
+
end
|
949
|
+
|
950
|
+
it 'plays the correct ssml' do
|
951
|
+
expect_ssml_output ssml
|
952
|
+
subject.say_characters(1234).should be true
|
953
|
+
end
|
954
|
+
end
|
955
|
+
end
|
956
|
+
|
957
|
+
describe "#say_characters!" do
|
958
|
+
context "with a string" do
|
959
|
+
let :ssml do
|
960
|
+
RubySpeech::SSML.draw do
|
961
|
+
say_as(interpret_as: 'characters') { "1234#abc" }
|
962
|
+
end
|
963
|
+
end
|
964
|
+
|
965
|
+
it 'plays the correct ssml' do
|
966
|
+
expect_async_ssml_output ssml
|
967
|
+
subject.say_characters!('1234#abc').should be_a Punchblock::Component::Output
|
968
|
+
end
|
969
|
+
end
|
970
|
+
|
971
|
+
context "with a numeric" do
|
972
|
+
let :ssml do
|
973
|
+
RubySpeech::SSML.draw do
|
974
|
+
say_as(interpret_as: 'characters') { "1234" }
|
975
|
+
end
|
976
|
+
end
|
977
|
+
|
978
|
+
it 'plays the correct ssml' do
|
979
|
+
expect_async_ssml_output ssml
|
980
|
+
subject.say_characters!(1234).should be_a Punchblock::Component::Output
|
981
|
+
end
|
982
|
+
end
|
983
|
+
end
|
928
984
|
end
|
929
985
|
end
|
930
986
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adhearsion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.0
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Phillips
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-08-
|
14
|
+
date: 2013-08-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -179,14 +179,14 @@ dependencies:
|
|
179
179
|
requirements:
|
180
180
|
- - ~>
|
181
181
|
- !ruby/object:Gem::Version
|
182
|
-
version: 2.0
|
182
|
+
version: '2.0'
|
183
183
|
type: :runtime
|
184
184
|
prerelease: false
|
185
185
|
version_requirements: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
187
|
- - ~>
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 2.0
|
189
|
+
version: '2.0'
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: rake
|
192
192
|
requirement: !ruby/object:Gem::Requirement
|
@@ -571,9 +571,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
571
571
|
version: '0'
|
572
572
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
573
573
|
requirements:
|
574
|
-
- - '
|
574
|
+
- - '>='
|
575
575
|
- !ruby/object:Gem::Version
|
576
|
-
version:
|
576
|
+
version: '0'
|
577
577
|
requirements: []
|
578
578
|
rubyforge_project:
|
579
579
|
rubygems_version: 2.0.3
|