ruby_speech 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 891276a2d84f160536a3eb7bd4841b96a466a462
4
- data.tar.gz: b97014a5a89012d01a7a7429aa4a0a0055af58e4
3
+ metadata.gz: daffff8bc7ff4b9142bb4c02ebe5a86ea36af289
4
+ data.tar.gz: 27fa66cc2be22d51bb2df0dd0b19d53cfdc37507
5
5
  SHA512:
6
- metadata.gz: 54672c541a1203e51fa9058f7fff47f469854ddb551c90b0c786dd8c370bf2f9177360abe61d2bb357cf6d266b5b84e4e069851c499c7311cce9dc035acf119e
7
- data.tar.gz: 9493a2b75a32fc7d2217708362848f131a69136fdade9f95fd9dff6d9b84c947567f56beb55e4535186a59fa18c66620e7933e44ca44f84d56814754044463fe
6
+ metadata.gz: 0a9e0f01cc3967c4a6b77bbf45c9daae4f26b6e9e3fbae46367c670621ddcd522715d638aff7c325f8ea199a7cac150e541a25e4d868f8fe4c4e5d91c12a5d0b
7
+ data.tar.gz: 3d041f2dfefc467fe83afb05fb7d1c88fda27d96aa6203e598e3fc134969c13e50c91f6ff13e936957434e91b75f40b4aa93d5b63500b8b577d91dd60c6dd040
@@ -3,6 +3,7 @@ language: ruby
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.0
6
7
  - jruby-19mode
7
8
  - rbx-19mode
8
9
  - ruby-head
@@ -1,5 +1,9 @@
1
1
  # [develop](https://github.com/benlangfeld/ruby_speech)
2
2
 
3
+ # [2.3.1](https://github.com/benlangfeld/ruby_speech/compare/v2.3.0...v2.3.1) - [2014-02-24](https://rubygems.org/gems/ruby_speech/versions/2.3.1)
4
+ * Bugfix: Phone number grammar should only allow a single instance of '*'/'x'
5
+ * Bugfix: Concatenating documents containing strings across the border inserts appropriate spacing (#21).
6
+
3
7
  # [2.3.0](https://github.com/benlangfeld/ruby_speech/compare/v2.2.2...v2.3.0) - [2013-09-30](https://rubygems.org/gems/ruby_speech/versions/2.3.0)
4
8
  * Feature: Allow generation of a boolean, date, digits, currency, number, phone or time grammar including from URIs
5
9
  * Bugfix: Ensure that rule refs can be reused when inlining grammars
@@ -105,12 +105,16 @@ module RubySpeech
105
105
  new_doc = Nokogiri::XML::Document.new
106
106
  self.class.new(new_doc).tap do |new_element|
107
107
  new_doc.root = new_element.node
108
+ string_types = [String, Nokogiri::XML::Text]
109
+ include_spacing = string_types.include?(self.nokogiri_children.last.class) && string_types.include?(other.nokogiri_children.first.class)
108
110
  if Nokogiri.jruby?
109
111
  new_element.add_child self.clone.nokogiri_children
112
+ new_element << " " if include_spacing
110
113
  new_element.add_child other.clone.nokogiri_children
111
114
  else
112
115
  # TODO: This is yucky because it requires serialization
113
116
  new_element.add_child self.nokogiri_children.to_xml
117
+ new_element << " " if include_spacing
114
118
  new_element.add_child other.nokogiri_children.to_xml
115
119
  end
116
120
  end
@@ -146,12 +146,21 @@ module RubySpeech::GRXML::Builtins
146
146
  RubySpeech::GRXML.draw mode: :dtmf, root: 'number' do
147
147
  rule id: 'number', scope: 'public' do
148
148
  item repeat: '1-' do
149
- one_of do
150
- 0.upto(9) { |d| item { d.to_s } }
151
- item { '*' }
149
+ ruleref uri: '#digit'
150
+ end
151
+ item repeat: '0-1' do
152
+ item { '*' }
153
+ item repeat: '0-' do
154
+ ruleref uri: '#digit'
152
155
  end
153
156
  end
154
157
  end
158
+
159
+ rule id: 'digit' do
160
+ one_of do
161
+ 0.upto(9) { |d| item { d.to_s } }
162
+ end
163
+ end
155
164
  end
156
165
  end
157
166
 
@@ -1,3 +1,3 @@
1
1
  module RubySpeech
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
@@ -143,11 +143,11 @@ describe RubySpeech::GRXML::Builtins do
143
143
  it { should match('0').and_interpret_as('dtmf-0') }
144
144
  it { should match('0123').and_interpret_as('dtmf-0 dtmf-1 dtmf-2 dtmf-3') }
145
145
  it { should match('0123*456').and_interpret_as('dtmf-0 dtmf-1 dtmf-2 dtmf-3 dtmf-star dtmf-4 dtmf-5 dtmf-6') }
146
- it { should match('0123*456*789').and_interpret_as('dtmf-0 dtmf-1 dtmf-2 dtmf-3 dtmf-star dtmf-4 dtmf-5 dtmf-6 dtmf-star dtmf-7 dtmf-8 dtmf-9') }
147
146
 
148
147
  it { should potentially_match('') }
149
148
 
150
149
  it { should not_match('#') }
150
+ it { should not_match('0123*456*789') }
151
151
  end
152
152
 
153
153
  describe "time" do
@@ -182,6 +182,27 @@ module RubySpeech
182
182
  concat.document.root.should == concat
183
183
  concat.to_s.should_not include('default')
184
184
  end
185
+
186
+ context "when concatenating" do
187
+ describe "simple strings" do
188
+ it "inserts a space between them" do
189
+ speak1 = SSML.draw do
190
+ string "Hi, my name"
191
+ end
192
+
193
+ speak2 = SSML.draw do
194
+ string "is Frank"
195
+ end
196
+
197
+ expected_concat = SSML.draw do
198
+ string "Hi, my name is Frank"
199
+ end
200
+
201
+ concat = (speak1 + speak2)
202
+ concat.should == expected_concat
203
+ end
204
+ end
205
+ end
185
206
  end # Speak
186
207
  end # SSML
187
208
  end # RubySpeech
metadata CHANGED
@@ -1,201 +1,201 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Langfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-30 00:00:00.000000000 Z
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.0.7
34
- - - <
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 5.0.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 3.0.7
44
- - - <
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 5.0.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.0.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 1.0.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '2.7'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '2.7'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: ci_reporter
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: 1.6.3
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: 1.6.3
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: yard
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '>='
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: 0.7.0
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: 0.7.0
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rake
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - '>='
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - '>='
114
+ - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: guard
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - '>='
121
+ - - ">="
122
122
  - !ruby/object:Gem::Version
123
123
  version: 0.9.0
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - '>='
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: 0.9.0
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: guard-rspec
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - '>='
135
+ - - ">="
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '>='
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: ruby_gntp
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
- - - '>='
149
+ - - ">="
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - '>='
156
+ - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: guard-rake
161
161
  requirement: !ruby/object:Gem::Requirement
162
162
  requirements:
163
- - - '>='
163
+ - - ">="
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  type: :development
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - '>='
170
+ - - ">="
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: rake-compiler
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - '>='
177
+ - - ">="
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  type: :development
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
- - - '>='
184
+ - - ">="
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: coveralls
189
189
  requirement: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - '>='
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  type: :development
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
- - - '>='
198
+ - - ">="
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0'
201
201
  description: Prepare SSML and GRXML documents with ease
@@ -206,9 +206,9 @@ extensions:
206
206
  - ext/ruby_speech/extconf.rb
207
207
  extra_rdoc_files: []
208
208
  files:
209
- - .gitignore
210
- - .rspec
211
- - .travis.yml
209
+ - ".gitignore"
210
+ - ".rspec"
211
+ - ".travis.yml"
212
212
  - CHANGELOG.md
213
213
  - Gemfile
214
214
  - Guardfile
@@ -306,17 +306,17 @@ require_paths:
306
306
  - lib
307
307
  required_ruby_version: !ruby/object:Gem::Requirement
308
308
  requirements:
309
- - - '>='
309
+ - - ">="
310
310
  - !ruby/object:Gem::Version
311
311
  version: '0'
312
312
  required_rubygems_version: !ruby/object:Gem::Requirement
313
313
  requirements:
314
- - - '>='
314
+ - - ">="
315
315
  - !ruby/object:Gem::Version
316
316
  version: '0'
317
317
  requirements: []
318
318
  rubyforge_project: ruby_speech
319
- rubygems_version: 2.0.3
319
+ rubygems_version: 2.2.0
320
320
  signing_key:
321
321
  specification_version: 4
322
322
  summary: A Ruby library for TTS & ASR document preparation