ruby_speech 1.0.1 → 1.0.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.
data/.gitignore CHANGED
@@ -8,3 +8,4 @@ spec/reports
8
8
  doc
9
9
  .*.swp
10
10
  vendor
11
+ tmp/
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # [develop](https://github.com/benlangfeld/ruby_speech)
2
2
 
3
- # [1.0.1](https://github.com/benlangfeld/ruby_speech/compare/v1.0.1...v1.0.1) - [2012-10-24](https://rubygems.org/gems/ruby_speech/versions/1.0.1)
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
@@ -1,4 +1,4 @@
1
- guard 'rspec', :version => 2, :cli => '--format documentation' do
1
+ guard 'rspec', :cli => '--format documentation' do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
4
  watch('spec/spec_helper.rb') { "spec/" }
@@ -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 << block_return if block_return.is_a?(String)
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)
@@ -17,6 +17,8 @@ module RubySpeech
17
17
 
18
18
  alias_method :nokogiri_children, :children
19
19
 
20
+ alias :to_doc :document
21
+
20
22
  include GenericElement
21
23
 
22
24
  def regexp_content # :nodoc:
@@ -16,6 +16,8 @@ module RubySpeech
16
16
  end
17
17
 
18
18
  include GenericElement
19
+
20
+ alias :to_doc :document
19
21
  end # Element
20
22
  end # SSML
21
23
  end # RubySpeech
@@ -1,3 +1,3 @@
1
1
  module RubySpeech
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -2,7 +2,7 @@ module RubySpeech
2
2
  module XML
3
3
  module Language
4
4
  def language
5
- read_attr :lang
5
+ self['xml:lang']
6
6
  end
7
7
 
8
8
  def language=(l)
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.0"]
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
- Grammar.new.to_doc.to_s.should == expected_doc.to_s
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(:content => "I <3 nachos.")
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
- let(:expected_doc) do
144
- Nokogiri::XML::Document.new.tap do |doc|
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(:content => "I <3 nachos.")
157
+ expected_doc << SSML::Voice.new(:native_content => "I <3 nachos.")
158
158
  end
159
159
  doc.should == expected_doc
160
160
  end
@@ -18,7 +18,7 @@ class SpeechDocMatcher
18
18
  @subject = s
19
19
  else
20
20
  doc = Nokogiri::XML::Document.new
21
- doc << s
21
+ doc << s.to_xml
22
22
  @subject = doc
23
23
  end
24
24
  end
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.1
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-10-24 00:00:00.000000000 Z
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.0'
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.0'
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: -28742056352021306
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: -28742056352021306
338
+ hash: 1835658384396428015
311
339
  requirements: []
312
340
  rubyforge_project: ruby_speech
313
- rubygems_version: 1.8.23
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