Permalink
Browse files

Merge branch 'release/1.0.1'

  • Loading branch information...
2 parents 8a1d865 + d4554b6 commit a585a41efa5a1db5ddb66da7daa0f4a6b11fb52b @benlangfeld benlangfeld committed Oct 24, 2012
View
@@ -1,14 +1,11 @@
+language: ruby
+
rvm:
- 1.9.2
- - rbx
- - rbx-2.0
- - jruby
+ - 1.9.3
+ - jruby-19mode
+ - rbx-19mode
- ruby-head
notifications:
irc: "irc.freenode.org#adhearsion-dev"
-
-branches:
- only:
- - master
- - develop
View
@@ -1,4 +1,8 @@
-# develop
+# [develop](https://github.com/benlangfeld/ruby_speech)
+
+# [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)
+ * Bugfix: Don't load rubygems because it is evil
+ * Bugfix: Allow setting language (and other) attributes on root of SSML doc when using #draw DSL
# 1.0.0 - 2012-03-13
* Bump major version because we have a stable API
View
@@ -239,7 +239,7 @@ Check out the [YARD documentation](http://rdoc.info/github/benlangfeld/ruby_spee
## Links:
* [Source](https://github.com/benlangfeld/ruby_speech)
-* [Documentation](http://rdoc.info/github/benlangfeld/ruby_speech/master/frames)
+* [Documentation](http://rdoc.info/gems/ruby_speech/frames)
* [Bug Tracker](https://github.com/benlangfeld/ruby_speech/issues)
## Note on Patches/Pull Requests
@@ -43,7 +43,7 @@ def class_from_registration(name)
def import(node)
node = Nokogiri::XML.parse(node, nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS).root unless node.is_a?(Nokogiri::XML::Node)
return node.content if node.is_a?(Nokogiri::XML::Text)
- klass = class_from_registration node.element_name
+ klass = class_from_registration node.node_name
if klass && klass != self
klass.import node
else
@@ -52,22 +52,11 @@ def import(node)
end
def new(atts = {}, &block)
- blk_proc = lambda do |new_node|
+ super(self.registered_name, nil, self.namespace) do |new_node|
(self.defaults || {}).merge(atts).each_pair { |k, v| new_node.send :"#{k}=", v }
block_return = new_node.eval_dsl_block &block
new_node << block_return if block_return.is_a?(String)
end
-
- case RUBY_VERSION.split('.')[0,2].join.to_i
- when 18
- super(self.registered_name, nil, self.namespace).tap do |n|
- blk_proc[n]
- end
- else
- super(self.registered_name, nil, self.namespace) do |n|
- blk_proc[n]
- end
- end
end
end
@@ -87,7 +76,7 @@ def version
end
def version=(other)
- write_attr :version, other
+ self[:version] = other
end
##
@@ -101,7 +90,7 @@ def base_uri
# @param [String] uri the base URI to which relative URLs are resolved
#
def base_uri=(uri)
- write_attr 'xml:base', uri
+ self['xml:base'] = uri
end
def to_doc
@@ -133,9 +122,9 @@ def children(type = nil, attributes = nil)
end.join(',') << ']' if attributes
if namespace_href
- find "ns:#{expression}", :ns => namespace_href
+ xpath "ns:#{expression}", :ns => namespace_href
else
- find expression
+ xpath expression
end
else
super()
@@ -36,7 +36,7 @@ def mode
# @param [String] ia
#
def mode=(ia)
- write_attr :mode, ia
+ self[:mode] = ia
end
##
@@ -53,7 +53,7 @@ def root
# @param [String] ia
#
def root=(ia)
- write_attr :root, ia
+ self[:root] = ia
end
##
@@ -68,7 +68,7 @@ def tag_format
# @param [String] ia
#
def tag_format=(s)
- write_attr :'tag-format', s
+ self['tag-format'] = s
end
##
@@ -104,7 +104,7 @@ def inline
# @return self
#
def inline!
- find("//ns:ruleref", :ns => namespace_href).each do |ref|
+ xpath("//ns:ruleref", :ns => namespace_href).each do |ref|
rule = children(:rule, :id => ref[:uri].sub(/^#/, '')).first
ref.swap rule.nokogiri_children
end
@@ -52,7 +52,7 @@ def weight
#
def weight=(w)
raise ArgumentError, "A Item's weight attribute must be a positive floating point number" unless w.to_s.match(/[^0-9\.]/) == nil and w.to_f >= 0
- write_attr :weight, w
+ self[:weight] = w
end
##
@@ -99,7 +99,7 @@ def repeat=(r)
m < 0 || n < m
end
end
- write_attr :repeat, r
+ self[:repeat] = r
end
##
@@ -117,7 +117,7 @@ def repeat_prob
#
def repeat_prob=(rp)
raise ArgumentError, "A Item's repeat probablity attribute must be a floating point number between 0.0 and 1.0" unless rp.to_s.match(/[^0-9\.]/) == nil and rp.to_f >= 0 and rp.to_f <= 1.0
- write_attr :'repeat-prob', rp
+ self['repeat-prob'] = rp
end
def <<(arg)
@@ -36,7 +36,7 @@ def id
# @param [String] ia
#
def id=(ia)
- write_attr :id, ia
+ self[:id] = ia
end
##
@@ -57,7 +57,7 @@ def scope
#
def scope=(sc)
raise ArgumentError, "A Rule's scope can only be 'public' or 'private'" unless %w{public private}.include?(sc.to_s)
- write_attr :scope, sc
+ self[:scope] = sc
end
def <<(arg)
@@ -34,7 +34,7 @@ def uri
#
def uri=(u)
raise ArgumentError, "A Ruleref can only take uri or special" if special
- write_attr :uri, u
+ self[:uri] = u
end
##
@@ -54,7 +54,7 @@ def special
def special=(sp)
raise ArgumentError, "A Ruleref can only take uri or special" if uri
raise ArgumentError, "The Ruleref#special method only takes :NULL, :VOID, and :GARBAGE" unless %w{NULL VOID GARBAGE}.include? sp.to_s
- write_attr :special, sp
+ self[:special] = sp
end
def <<(*args)
View
@@ -23,8 +23,8 @@ module SSML
SSML_NAMESPACE = 'http://www.w3.org/2001/10/synthesis'
- def self.draw(&block)
- Speak.new.tap do |speak|
+ def self.draw(*args, &block)
+ Speak.new(*args).tap do |speak|
block_return = speak.eval_dsl_block &block
speak << block_return if block_return.is_a?(String)
end
@@ -31,7 +31,7 @@ def src
# @param [String] the source. Must be a valid URI
#
def src=(s)
- write_attr :src, s
+ self[:src] = s
end
def <<(arg)
@@ -27,7 +27,7 @@ def strength
#
def strength=(s)
raise ArgumentError, "You must specify a valid strength (#{VALID_STRENGTHS.map(&:inspect).join ', '})" unless VALID_STRENGTHS.include? s
- write_attr :strength, s
+ self[:strength] = s
end
##
@@ -46,7 +46,7 @@ def time
#
def time=(t)
raise ArgumentError, "You must specify a valid time (positive float value in seconds)" unless t.is_a?(Numeric) && t >= 0
- write_attr :time, "#{t}s"
+ self[:time] = "#{t}s"
end
def <<(*args)
@@ -28,7 +28,7 @@ def level
#
def level=(l)
raise ArgumentError, "You must specify a valid level (#{VALID_LEVELS.map(&:inspect).join ', '})" unless VALID_LEVELS.include? l
- write_attr :level, l
+ self[:level] = l
end
def <<(arg)
@@ -27,7 +27,7 @@ def name
# @param [String] the name token
#
def name=(other)
- write_attr :name, other
+ self[:name] = other
end
def <<(*args)
@@ -40,7 +40,7 @@ def alphabet
# @param [String] other the phonemic/phonetic alphabet
#
def alphabet=(other)
- write_attr :alphabet, other
+ self[:alphabet] = other
end
##
@@ -56,7 +56,7 @@ def ph
# @param [String] other the phoneme/phone string.
#
def ph=(other)
- write_attr :ph, other
+ self[:ph] = other
end
def <<(arg)
@@ -43,7 +43,7 @@ def pitch
def pitch=(p)
hz = p.is_a?(String) && p.include?('Hz') && p.to_f > 0
raise ArgumentError, "You must specify a valid pitch (\"[positive-number]Hz\", #{VALID_PITCHES.map(&:inspect).join ', '})" unless hz || VALID_PITCHES.include?(p)
- write_attr :pitch, p
+ self[:pitch] = p
end
##
@@ -61,7 +61,7 @@ def contour
# @param [String] v
#
def contour=(v)
- write_attr :contour, v
+ self[:contour] = v
end
##
@@ -87,7 +87,7 @@ def range
def range=(p)
hz = p.is_a?(String) && p.include?('Hz') && p.to_f > 0
raise ArgumentError, "You must specify a valid range (\"[positive-number]Hz\", #{VALID_PITCHES.map(&:inspect).join ', '})" unless hz || VALID_PITCHES.include?(p)
- write_attr :range, p
+ self[:range] = p
end
##
@@ -112,7 +112,7 @@ def rate
#
def rate=(v)
raise ArgumentError, "You must specify a valid rate ([positive-number](multiplier), #{VALID_RATES.map(&:inspect).join ', '})" unless (v.is_a?(Numeric) && v >= 0) || VALID_RATES.include?(v)
- write_attr :rate, v
+ self[:rate] = v
end
##
@@ -131,7 +131,7 @@ def duration
#
def duration=(t)
raise ArgumentError, "You must specify a valid duration (positive float value in seconds)" unless t.is_a?(Numeric) && t >= 0
- write_attr :duration, "#{t}s"
+ self[:duration] = "#{t}s"
end
##
@@ -156,7 +156,7 @@ def volume
#
def volume=(v)
raise ArgumentError, "You must specify a valid volume ([positive-number](0.0 -> 100.0), #{VALID_VOLUMES.map(&:inspect).join ', '})" unless (v.is_a?(Numeric) && (0..100).include?(v)) || VALID_VOLUMES.include?(v)
- write_attr :volume, v
+ self[:volume] = v
end
def <<(arg)
@@ -42,7 +42,7 @@ def interpret_as
# @param [String] ia
#
def interpret_as=(ia)
- write_attr :'interpret-as', ia
+ self['interpret-as'] = ia
end
##
@@ -61,7 +61,7 @@ def format
# @param [String] format
#
def format=(format)
- write_attr :format, format
+ self[:format] = format
end
##
@@ -84,7 +84,7 @@ def detail
# @param [String] detail
#
def detail=(detail)
- write_attr :detail, detail
+ self[:detail] = detail
end
def <<(arg)
@@ -26,7 +26,7 @@ def alias
# @param [String] other the string to be spoken instead of the enclosed string
#
def alias=(other)
- write_attr :alias, other
+ self[:alias] = other
end
def <<(arg)
Oops, something went wrong.

0 comments on commit a585a41

Please sign in to comment.