From 287a34ae0dfc23e4158f67cb7783d239f202c368 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Mar 2009 03:56:38 +0000 Subject: * {ext,lib,test}/**/*.rb: removed trailing spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/yaml/baseemitter.rb | 20 ++++++++++---------- lib/yaml/constants.rb | 4 ++-- lib/yaml/dbm.rb | 4 ++-- lib/yaml/encoding.rb | 4 ++-- lib/yaml/error.rb | 2 +- lib/yaml/rubytypes.rb | 10 +++++----- lib/yaml/stream.rb | 2 +- lib/yaml/stringio.rb | 2 +- lib/yaml/tag.rb | 8 ++++---- lib/yaml/types.rb | 6 +++--- 10 files changed, 31 insertions(+), 31 deletions(-) (limited to 'lib/yaml') 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 ) -- cgit v1.2.3