summaryrefslogtreecommitdiff
path: root/lib/yaml
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
commit287a34ae0dfc23e4158f67cb7783d239f202c368 (patch)
tree5e35d5b41aae961b37cf6632f60c42f51c7aa775 /lib/yaml
parent9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff)
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r--lib/yaml/baseemitter.rb20
-rw-r--r--lib/yaml/constants.rb4
-rw-r--r--lib/yaml/dbm.rb4
-rw-r--r--lib/yaml/encoding.rb4
-rw-r--r--lib/yaml/error.rb2
-rw-r--r--lib/yaml/rubytypes.rb10
-rw-r--r--lib/yaml/stream.rb2
-rw-r--r--lib/yaml/stringio.rb2
-rw-r--r--lib/yaml/tag.rb8
-rw-r--r--lib/yaml/types.rb6
10 files changed, 31 insertions, 31 deletions
diff --git a/lib/yaml/baseemitter.rb b/lib/yaml/baseemitter.rb
index 4bdc796cbf..59d9eddc76 100644
--- a/lib/yaml/baseemitter.rb
+++ b/lib/yaml/baseemitter.rb
@@ -42,7 +42,7 @@ module YAML
'|'
else
'>'
- end
+ end
indt = $&.to_i if block =~ /\d+/
if valx =~ /(\A\n*[ \t#]|^---\s+)/
indt = options(:Indent) unless indt.to_i > 0
@@ -64,8 +64,8 @@ module YAML
valx = fold( YAML::escape( valx, esc_skip ) + "\"" ).chomp
self << '"' + indent_text( valx, indt, false )
else
- if block[0] == ?>
- valx = fold( valx )
+ if block[0] == ?>
+ valx = fold( valx )
end
#p [block, indt]
self << block + indent_text( valx, indt )
@@ -84,7 +84,7 @@ module YAML
# Emit double-quoted string
#
def double( value )
- "\"#{YAML.escape( value )}\""
+ "\"#{YAML.escape( value )}\""
end
#
@@ -150,8 +150,8 @@ module YAML
@seq_map = false
else
# FIXME
- # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
- # @headless = 1
+ # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
+ # @headless = 1
# end
defkey = @options.delete( :DefaultKey )
@@ -174,7 +174,7 @@ module YAML
self << "\n"
indent!
end
- self << ": "
+ self << ": "
v[1].to_yaml( :Emitter => self )
}
end
@@ -187,7 +187,7 @@ module YAML
# @seq_map = false
# else
self << "\n"
- indent!
+ indent!
# end
end
@@ -207,8 +207,8 @@ module YAML
self << "[]"
else
# FIXME
- # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
- # @headless = 1
+ # if @buffer.length == 1 and options(:UseHeader) == false and type.length.zero?
+ # @headless = 1
# end
#
diff --git a/lib/yaml/constants.rb b/lib/yaml/constants.rb
index fb833d3077..728d3b7932 100644
--- a/lib/yaml/constants.rb
+++ b/lib/yaml/constants.rb
@@ -13,7 +13,7 @@ module YAML
# Parser tokens
#
WORD_CHAR = 'A-Za-z0-9'
- PRINTABLE_CHAR = '-_A-Za-z0-9!?/()$\'". '
+ PRINTABLE_CHAR = '-_A-Za-z0-9!?/()$\'". '
NOT_PLAIN_CHAR = '\x7f\x0-\x1f\x80-\x9f'
ESCAPE_CHAR = '[\\x00-\\x09\\x0b-\\x1f]'
INDICATOR_CHAR = '*&!|\\\\^@%{}[]='
@@ -27,7 +27,7 @@ module YAML
\x18 \x19 \x1a \e \x1c \x1d \x1e \x1f
}
UNESCAPES = {
- 'a' => "\x07", 'b' => "\x08", 't' => "\x09",
+ 'a' => "\x07", 'b' => "\x08", 't' => "\x09",
'n' => "\x0a", 'v' => "\x0b", 'f' => "\x0c",
'r' => "\x0d", 'e' => "\x1b", '\\' => '\\',
}
diff --git a/lib/yaml/dbm.rb b/lib/yaml/dbm.rb
index 87d6009250..a28fd04f19 100644
--- a/lib/yaml/dbm.rb
+++ b/lib/yaml/dbm.rb
@@ -35,14 +35,14 @@ class DBM < ::DBM
def delete( key )
v = super( key )
if String === v
- v = YAML::load( v )
+ v = YAML::load( v )
end
v
end
def delete_if
del_keys = keys.dup
del_keys.delete_if { |k| yield( k, fetch( k ) ) == false }
- del_keys.each { |k| delete( k ) }
+ del_keys.each { |k| delete( k ) }
self
end
def reject
diff --git a/lib/yaml/encoding.rb b/lib/yaml/encoding.rb
index 57dc553606..98e83c3853 100644
--- a/lib/yaml/encoding.rb
+++ b/lib/yaml/encoding.rb
@@ -23,9 +23,9 @@ module YAML
if $3
["#$3".hex ].pack('U*')
elsif $2
- [$2].pack( "H2" )
+ [$2].pack( "H2" )
else
- UNESCAPES[$1]
+ UNESCAPES[$1]
end
}
end
diff --git a/lib/yaml/error.rb b/lib/yaml/error.rb
index 15865a9aa9..75de0ec18a 100644
--- a/lib/yaml/error.rb
+++ b/lib/yaml/error.rb
@@ -26,7 +26,7 @@ module YAML
#
# YAML Error classes
#
-
+
class Error < StandardError; end
class ParseError < Error; end
class TypeError < StandardError; end
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index ae65b355e1..b2745b4542 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -64,7 +64,7 @@ class Struct
end
if not struct_type
struct_def = [ tag.split( ':', 4 ).last ]
- struct_type = Struct.new( *struct_def.concat( val.keys.collect { |k| k.intern } ) )
+ struct_type = Struct.new( *struct_def.concat( val.keys.collect { |k| k.intern } ) )
end
#
@@ -317,7 +317,7 @@ class Time
utc_same_instant = self.dup.utc
utc_same_writing = Time.utc(year,month,day,hour,min,sec,usec)
difference_to_utc = utc_same_writing - utc_same_instant
- if (difference_to_utc < 0)
+ if (difference_to_utc < 0)
difference_sign = '-'
absolute_difference = -difference_to_utc
else
@@ -388,9 +388,9 @@ class Rational
Rational( val['numerator'], val['denominator'] )
end
end
- def to_yaml( opts = {} )
+ def to_yaml( opts = {} )
YAML::quick_emit( self, opts ) do |out|
- out.map( taguri, nil ) do |map|
+ out.map( taguri, nil ) do |map|
map.add( 'denominator', denominator )
map.add( 'numerator', numerator )
end
@@ -435,7 +435,7 @@ class FalseClass
end
end
-class NilClass
+class NilClass
yaml_as "tag:yaml.org,2002:null"
def to_yaml( opts = {} )
YAML::quick_emit( nil, opts ) do |out|
diff --git a/lib/yaml/stream.rb b/lib/yaml/stream.rb
index 060fbc4200..651a1bbbef 100644
--- a/lib/yaml/stream.rb
+++ b/lib/yaml/stream.rb
@@ -11,7 +11,7 @@ module YAML
@options = opts
@documents = []
end
-
+
def []( i )
@documents[ i ]
end
diff --git a/lib/yaml/stringio.rb b/lib/yaml/stringio.rb
index 8ad949fa2b..b0fda19e28 100644
--- a/lib/yaml/stringio.rb
+++ b/lib/yaml/stringio.rb
@@ -13,7 +13,7 @@ rescue LoadError
end
def pos
@pos
- end
+ end
def eof
@eof
end
diff --git a/lib/yaml/tag.rb b/lib/yaml/tag.rb
index 0fb6bef9a0..add3c49894 100644
--- a/lib/yaml/tag.rb
+++ b/lib/yaml/tag.rb
@@ -4,13 +4,13 @@
# = yaml/tag.rb: methods for associating a taguri to a class.
#
# Author:: why the lucky stiff
-#
+#
module YAML
# A dictionary of taguris which map to
# Ruby classes.
@@tagged_classes = {}
-
- #
+
+ #
# Associates a taguri _tag_ with a Ruby class _cls_. The taguri is used to give types
# to classes when loading YAML. Taguris are of the form:
#
@@ -19,7 +19,7 @@ module YAML
# The +authorityName+ is a domain name or email address. The +date+ is the date the type
# was issued in YYYY or YYYY-MM or YYYY-MM-DD format. The +specific+ is a name for
# the type being added.
- #
+ #
# For example, built-in YAML types have 'yaml.org' as the +authorityName+ and '2002' as the
# +date+. The +specific+ is simply the name of the type:
#
diff --git a/lib/yaml/types.rb b/lib/yaml/types.rb
index 3871c628fe..60aebc0481 100644
--- a/lib/yaml/types.rb
+++ b/lib/yaml/types.rb
@@ -58,7 +58,7 @@ module YAML
#
# YAML Hash class to support comments and defaults
#
- class SpecialHash < ::Hash
+ class SpecialHash < ::Hash
attr_accessor :default
def inspect
self.default.to_s
@@ -112,7 +112,7 @@ module YAML
if ( tmp = self.assoc( k ) ) and not set
tmp[1] = val
else
- self << [ k, val ]
+ self << [ k, val ]
end
val
end
@@ -163,7 +163,7 @@ module YAML
self.assoc( k ).to_a
end
def []=( k, val )
- self << [ k, val ]
+ self << [ k, val ]
val
end
def has_key?( k )