ruby_speech 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,45 @@
1
+ def be_a_valid_ssml_document
2
+ SSMLMatcher.new
3
+ end
4
+
5
+ class SSMLMatcher
6
+ attr_reader :subject
7
+
8
+ def subject=(s)
9
+ if s.is_a? Nokogiri::XML::Document
10
+ @subject = s
11
+ else
12
+ doc = Nokogiri::XML::Document.new
13
+ doc << s
14
+ @subject = doc
15
+ end
16
+ end
17
+
18
+ def failure_message
19
+ " expected #{subject} to be a valid SSML document\n#{errors}"
20
+ end
21
+
22
+ def negative_failure_message
23
+ " expected #{subject} not to be a valid SSML document"
24
+ end
25
+
26
+ def description
27
+ "to be a valid SSML document"
28
+ end
29
+
30
+ def matches?(s)
31
+ self.subject = s
32
+ SSML_SCHEMA.valid? subject
33
+ end
34
+
35
+ def does_not_match?(s)
36
+ !matches? s
37
+ end
38
+
39
+ private
40
+
41
+ def errors
42
+ SSML_SCHEMA.validate(subject).map(&:message).join "\n"
43
+ end
44
+
45
+ end
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_speech
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Ben Langfeld
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-07-02 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: niceogiri
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 0
31
+ - 4
32
+ version: 0.0.4
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: activesupport
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 3
45
+ - 0
46
+ - 7
47
+ version: 3.0.7
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bundler
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 1
60
+ - 0
61
+ - 0
62
+ version: 1.0.0
63
+ type: :development
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rspec
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ segments:
74
+ - 2
75
+ - 3
76
+ - 0
77
+ version: 2.3.0
78
+ type: :development
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: ci_reporter
82
+ prerelease: false
83
+ requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ segments:
89
+ - 1
90
+ - 6
91
+ - 3
92
+ version: 1.6.3
93
+ type: :development
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ name: yard
97
+ prerelease: false
98
+ requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ segments:
104
+ - 0
105
+ - 6
106
+ - 0
107
+ version: 0.6.0
108
+ type: :development
109
+ version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
111
+ name: rake
112
+ prerelease: false
113
+ requirement: &id007 !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ segments:
119
+ - 0
120
+ version: "0"
121
+ type: :development
122
+ version_requirements: *id007
123
+ - !ruby/object:Gem::Dependency
124
+ name: mocha
125
+ prerelease: false
126
+ requirement: &id008 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ segments:
132
+ - 0
133
+ version: "0"
134
+ type: :development
135
+ version_requirements: *id008
136
+ - !ruby/object:Gem::Dependency
137
+ name: i18n
138
+ prerelease: false
139
+ requirement: &id009 !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ segments:
145
+ - 0
146
+ version: "0"
147
+ type: :development
148
+ version_requirements: *id009
149
+ description: Prepare SSML and GRXML documents with ease
150
+ email:
151
+ - ben@langfeld.me
152
+ executables: []
153
+
154
+ extensions: []
155
+
156
+ extra_rdoc_files: []
157
+
158
+ files:
159
+ - .gitignore
160
+ - .rspec
161
+ - CHANGELOG.md
162
+ - Gemfile
163
+ - LICENSE.md
164
+ - README.md
165
+ - Rakefile
166
+ - assets/synthesis-core.xsd
167
+ - assets/synthesis.xsd
168
+ - assets/xml.xsd
169
+ - lib/ruby_speech.rb
170
+ - lib/ruby_speech/ssml.rb
171
+ - lib/ruby_speech/ssml/break.rb
172
+ - lib/ruby_speech/ssml/element.rb
173
+ - lib/ruby_speech/ssml/emphasis.rb
174
+ - lib/ruby_speech/ssml/prosody.rb
175
+ - lib/ruby_speech/ssml/say_as.rb
176
+ - lib/ruby_speech/ssml/speak.rb
177
+ - lib/ruby_speech/ssml/voice.rb
178
+ - lib/ruby_speech/version.rb
179
+ - lib/ruby_speech/xml.rb
180
+ - lib/ruby_speech/xml/language.rb
181
+ - ruby_speech.gemspec
182
+ - spec/ruby_speech/ssml/break_spec.rb
183
+ - spec/ruby_speech/ssml/emphasis_spec.rb
184
+ - spec/ruby_speech/ssml/prosody_spec.rb
185
+ - spec/ruby_speech/ssml/say_as_spec.rb
186
+ - spec/ruby_speech/ssml/speak_spec.rb
187
+ - spec/ruby_speech/ssml/voice_spec.rb
188
+ - spec/ruby_speech/ssml_spec.rb
189
+ - spec/spec_helper.rb
190
+ - spec/support/matchers.rb
191
+ has_rdoc: true
192
+ homepage: https://github.com/mojolingo/ruby_speech
193
+ licenses: []
194
+
195
+ post_install_message:
196
+ rdoc_options: []
197
+
198
+ require_paths:
199
+ - lib
200
+ required_ruby_version: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ segments:
206
+ - 0
207
+ version: "0"
208
+ required_rubygems_version: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ segments:
214
+ - 0
215
+ version: "0"
216
+ requirements: []
217
+
218
+ rubyforge_project: ruby_speech
219
+ rubygems_version: 1.3.7
220
+ signing_key:
221
+ specification_version: 3
222
+ summary: A ruby library for TTS & ASR document preparation
223
+ test_files:
224
+ - spec/ruby_speech/ssml/break_spec.rb
225
+ - spec/ruby_speech/ssml/emphasis_spec.rb
226
+ - spec/ruby_speech/ssml/prosody_spec.rb
227
+ - spec/ruby_speech/ssml/say_as_spec.rb
228
+ - spec/ruby_speech/ssml/speak_spec.rb
229
+ - spec/ruby_speech/ssml/voice_spec.rb
230
+ - spec/ruby_speech/ssml_spec.rb
231
+ - spec/spec_helper.rb
232
+ - spec/support/matchers.rb