ruby_speech 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -1
- data/Guardfile +1 -1
- data/lib/ruby_speech/generic_element.rb +3 -15
- data/lib/ruby_speech/grxml/element.rb +2 -0
- data/lib/ruby_speech/ssml/element.rb +2 -0
- data/lib/ruby_speech/version.rb +1 -1
- data/lib/ruby_speech/xml/language.rb +1 -1
- data/ruby_speech.gemspec +2 -1
- data/spec/ruby_speech/grxml/grammar_spec.rb +1 -7
- data/spec/ruby_speech/grxml_spec.rb +1 -1
- data/spec/ruby_speech/ssml/speak_spec.rb +2 -8
- data/spec/ruby_speech/ssml_spec.rb +1 -1
- data/spec/support/matchers.rb +1 -1
- metadata +35 -7
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# [develop](https://github.com/benlangfeld/ruby_speech)
|
2
2
|
|
3
|
-
# [1.0.
|
3
|
+
# [1.0.2](https://github.com/benlangfeld/ruby_speech/compare/v1.0.1...v1.0.2) - [2012-12-26](https://rubygems.org/gems/ruby_speech/versions/1.0.2)
|
4
|
+
* Bugfix: Get test suite passing on JRuby
|
5
|
+
|
6
|
+
# [1.0.1](https://github.com/benlangfeld/ruby_speech/compare/v1.0.0...v1.0.1) - [2012-10-24](https://rubygems.org/gems/ruby_speech/versions/1.0.1)
|
4
7
|
* Bugfix: Don't load rubygems because it is evil
|
5
8
|
* Bugfix: Allow setting language (and other) attributes on root of SSML doc when using #draw DSL
|
6
9
|
|
data/Guardfile
CHANGED
@@ -55,7 +55,7 @@ module RubySpeech
|
|
55
55
|
super(self.registered_name, nil, self.namespace) do |new_node|
|
56
56
|
(self.defaults || {}).merge(atts).each_pair { |k, v| new_node.send :"#{k}=", v }
|
57
57
|
block_return = new_node.eval_dsl_block &block
|
58
|
-
new_node
|
58
|
+
new_node.string block_return if block_return.is_a?(String) && block_return.present?
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -83,7 +83,7 @@ module RubySpeech
|
|
83
83
|
# @return [String] the base URI to which relative URLs are resolved
|
84
84
|
#
|
85
85
|
def base_uri
|
86
|
-
read_attr :base
|
86
|
+
read_attr 'xml:base'
|
87
87
|
end
|
88
88
|
|
89
89
|
##
|
@@ -93,12 +93,6 @@ module RubySpeech
|
|
93
93
|
self['xml:base'] = uri
|
94
94
|
end
|
95
95
|
|
96
|
-
def to_doc
|
97
|
-
Nokogiri::XML::Document.new.tap do |doc|
|
98
|
-
doc << self
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
96
|
def +(other)
|
103
97
|
self.class.new(:base_uri => base_uri).tap do |new_element|
|
104
98
|
(self.children + other.children).each do |child|
|
@@ -147,13 +141,7 @@ module RubySpeech
|
|
147
141
|
end
|
148
142
|
|
149
143
|
def string(other)
|
150
|
-
self << other
|
151
|
-
end
|
152
|
-
|
153
|
-
def <<(other)
|
154
|
-
other = encode_special_chars other if other.is_a? String
|
155
|
-
super other
|
156
|
-
self
|
144
|
+
self << Nokogiri::XML::Text.new(other, document)
|
157
145
|
end
|
158
146
|
|
159
147
|
def method_missing(method_name, *args, &block)
|
data/lib/ruby_speech/version.rb
CHANGED
data/ruby_speech.gemspec
CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_runtime_dependency %q<niceogiri>, ["~> 1.
|
21
|
+
s.add_runtime_dependency %q<niceogiri>, ["~> 1.1", ">= 1.1.1"]
|
22
|
+
s.add_runtime_dependency %q<nokogiri>, ["~> 1.5", ">= 1.5.6"]
|
22
23
|
s.add_runtime_dependency %q<activesupport>, [">= 3.0.7"]
|
23
24
|
|
24
25
|
s.add_development_dependency %q<bundler>, [">= 1.0.0"]
|
@@ -122,14 +122,8 @@ module RubySpeech
|
|
122
122
|
end
|
123
123
|
|
124
124
|
describe "#to_doc" do
|
125
|
-
let(:expected_doc) do
|
126
|
-
Nokogiri::XML::Document.new.tap do |doc|
|
127
|
-
doc << Grammar.new
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
125
|
it "should create an XML document from the grammar" do
|
132
|
-
|
126
|
+
subject.to_doc.should == subject.document
|
133
127
|
end
|
134
128
|
end
|
135
129
|
|
@@ -195,7 +195,7 @@ module RubySpeech
|
|
195
195
|
end
|
196
196
|
expected_doc = GRXML::Grammar.new
|
197
197
|
3.times do
|
198
|
-
expected_doc << GRXML::Rule.new(:
|
198
|
+
expected_doc << GRXML::Rule.new(:native_content => "I <3 nachos.")
|
199
199
|
end
|
200
200
|
doc.should == expected_doc
|
201
201
|
end
|
@@ -140,14 +140,8 @@ module RubySpeech
|
|
140
140
|
end
|
141
141
|
|
142
142
|
describe "#to_doc" do
|
143
|
-
|
144
|
-
|
145
|
-
doc << Speak.new
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
it "should create an XML document from the speak" do
|
150
|
-
Speak.new.to_doc.to_s.should == expected_doc.to_s
|
143
|
+
it "should create an XML document from the grammar" do
|
144
|
+
subject.to_doc.should == subject.document
|
151
145
|
end
|
152
146
|
end
|
153
147
|
|
@@ -154,7 +154,7 @@ module RubySpeech
|
|
154
154
|
end
|
155
155
|
expected_doc = SSML::Speak.new
|
156
156
|
2.times do
|
157
|
-
expected_doc << SSML::Voice.new(:
|
157
|
+
expected_doc << SSML::Voice.new(:native_content => "I <3 nachos.")
|
158
158
|
end
|
159
159
|
doc.should == expected_doc
|
160
160
|
end
|
data/spec/support/matchers.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_speech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: niceogiri
|
@@ -18,7 +18,10 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.1'
|
22
|
+
- - ! '>='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 1.1.1
|
22
25
|
type: :runtime
|
23
26
|
prerelease: false
|
24
27
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +29,32 @@ dependencies:
|
|
26
29
|
requirements:
|
27
30
|
- - ~>
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
32
|
+
version: '1.1'
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 1.1.1
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: nokogiri
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.5'
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.5.6
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.5'
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 1.5.6
|
30
58
|
- !ruby/object:Gem::Dependency
|
31
59
|
name: activesupport
|
32
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,7 +326,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
298
326
|
version: '0'
|
299
327
|
segments:
|
300
328
|
- 0
|
301
|
-
hash:
|
329
|
+
hash: 1835658384396428015
|
302
330
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
331
|
none: false
|
304
332
|
requirements:
|
@@ -307,10 +335,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
307
335
|
version: '0'
|
308
336
|
segments:
|
309
337
|
- 0
|
310
|
-
hash:
|
338
|
+
hash: 1835658384396428015
|
311
339
|
requirements: []
|
312
340
|
rubyforge_project: ruby_speech
|
313
|
-
rubygems_version: 1.8.
|
341
|
+
rubygems_version: 1.8.24
|
314
342
|
signing_key:
|
315
343
|
specification_version: 3
|
316
344
|
summary: A ruby library for TTS & ASR document preparation
|