punchblock 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/lib/punchblock/component/input.rb +1 -1
- data/lib/punchblock/translator/asterisk/component/output.rb +6 -1
- data/lib/punchblock/version.rb +1 -1
- data/punchblock.gemspec +1 -1
- data/spec/punchblock/component/input_spec.rb +3 -3
- data/spec/punchblock/translator/asterisk/component/output_spec.rb +16 -0
- metadata +5 -5
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# [develop](https://github.com/adhearsion/punchblock)
|
2
2
|
|
3
|
+
# [v1.5.2](https://github.com/adhearsion/punchblock/compare/v1.5.1...v1.5.2) - [2012-10-25](https://rubygems.org/gems/punchblock/versions/1.5.2)
|
4
|
+
* Bugfix: Use correct GRXML content type
|
5
|
+
* Bugfix: Fix UniMRCP for documents containing commas
|
6
|
+
* Bugfix: Bump Celluloid dependency to avoid issues with serialising AMI
|
7
|
+
|
3
8
|
# [v1.5.1](https://github.com/adhearsion/punchblock/compare/v1.5.0...v1.5.1) - [2012-10-11](https://rubygems.org/gems/punchblock/versions/1.5.1)
|
4
9
|
* Update: Bump Celluloid dependency
|
5
10
|
* Bugfix: Input grammars referenced by URL now no longer specify a content type
|
@@ -53,7 +53,7 @@ module Punchblock
|
|
53
53
|
playback opts
|
54
54
|
when :unimrcp
|
55
55
|
send_ref
|
56
|
-
@call.send_agi_action! 'EXEC MRCPSynth', escaped_doc, mrcpsynth_options do |complete_event|
|
56
|
+
@call.send_agi_action! 'EXEC MRCPSynth', escape_commas(escaped_doc), mrcpsynth_options do |complete_event|
|
57
57
|
output_component.send_complete_event! success_reason
|
58
58
|
end
|
59
59
|
when :swift
|
@@ -97,6 +97,11 @@ module Punchblock
|
|
97
97
|
@component_node.ssml.to_s.squish.gsub(/["\\]/) { |m| "\\#{m}" }
|
98
98
|
end
|
99
99
|
|
100
|
+
def escape_commas(text)
|
101
|
+
text.gsub(/,/, '\\,')
|
102
|
+
end
|
103
|
+
|
104
|
+
|
100
105
|
def mrcpsynth_options
|
101
106
|
[].tap do |opts|
|
102
107
|
opts << 'i=any' if [:any, :dtmf].include? @component_node.interrupt_on
|
data/lib/punchblock/version.rb
CHANGED
data/punchblock.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_runtime_dependency %q<state_machine>, ["~> 1.0"]
|
29
29
|
s.add_runtime_dependency %q<future-resource>, ["~> 1.0"]
|
30
30
|
s.add_runtime_dependency %q<has-guarded-handlers>, ["~> 1.3"]
|
31
|
-
s.add_runtime_dependency %q<celluloid>, ["~> 0.12", ">= 0.12.
|
31
|
+
s.add_runtime_dependency %q<celluloid>, ["~> 0.12", ">= 0.12.3"]
|
32
32
|
s.add_runtime_dependency %q<ruby_ami>, ["~> 1.2", ">= 1.2.1"]
|
33
33
|
s.add_runtime_dependency %q<ruby_fs>, ["~> 1.0"]
|
34
34
|
s.add_runtime_dependency %q<ruby_speech>, ["~> 1.0"]
|
@@ -80,7 +80,7 @@ module Punchblock
|
|
80
80
|
describe Input::Grammar do
|
81
81
|
describe "when not passing a content type" do
|
82
82
|
subject { Input::Grammar.new :value => grxml_doc }
|
83
|
-
its(:content_type) { should be == 'application/
|
83
|
+
its(:content_type) { should be == 'application/srgs+xml' }
|
84
84
|
end
|
85
85
|
|
86
86
|
describe 'with a simple grammar' do
|
@@ -94,9 +94,9 @@ module Punchblock
|
|
94
94
|
end
|
95
95
|
|
96
96
|
describe 'with a GRXML grammar' do
|
97
|
-
subject { Input::Grammar.new :value => grxml_doc, :content_type => 'application/
|
97
|
+
subject { Input::Grammar.new :value => grxml_doc, :content_type => 'application/srgs+xml' }
|
98
98
|
|
99
|
-
its(:content_type) { should be == 'application/
|
99
|
+
its(:content_type) { should be == 'application/srgs+xml' }
|
100
100
|
|
101
101
|
let(:expected_message) { "<![CDATA[ #{grxml_doc} ]]>" }
|
102
102
|
|
@@ -162,6 +162,22 @@ module Punchblock
|
|
162
162
|
subject.execute
|
163
163
|
end
|
164
164
|
|
165
|
+
context "when the SSML document contains commas" do
|
166
|
+
let :ssml_doc do
|
167
|
+
RubySpeech::SSML.draw do
|
168
|
+
string "this, here, is a test"
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
it 'should escape TTS strings containing a comma' do
|
173
|
+
mock_call.expects(:send_agi_action!).once.with do |*args|
|
174
|
+
args[0].should be == 'EXEC MRCPSynth'
|
175
|
+
args[1].should match(/this\\, here\\, is a test/)
|
176
|
+
end
|
177
|
+
subject.execute
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
165
181
|
it 'should send a complete event when MRCPSynth completes' do
|
166
182
|
def mock_call.send_agi_action!(*args, &block)
|
167
183
|
block.call Punchblock::Component::Asterisk::AGI::Command::Complete::Success.new(:code => 200, :result => 1)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: punchblock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-10-
|
14
|
+
date: 2012-10-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: niceogiri
|
@@ -119,7 +119,7 @@ dependencies:
|
|
119
119
|
version: '0.12'
|
120
120
|
- - ! '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0.12.
|
122
|
+
version: 0.12.3
|
123
123
|
type: :runtime
|
124
124
|
prerelease: false
|
125
125
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
version: '0.12'
|
131
131
|
- - ! '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.12.
|
133
|
+
version: 0.12.3
|
134
134
|
- !ruby/object:Gem::Dependency
|
135
135
|
name: ruby_ami
|
136
136
|
requirement: !ruby/object:Gem::Requirement
|
@@ -515,7 +515,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
515
515
|
version: '0'
|
516
516
|
segments:
|
517
517
|
- 0
|
518
|
-
hash:
|
518
|
+
hash: 1038933123642374556
|
519
519
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
520
520
|
none: false
|
521
521
|
requirements:
|