Permalink
Browse files

Remove unused code.

  • Loading branch information...
norman committed Jan 5, 2012
1 parent 262af66 commit c973161c388dbf4e175c59fd8939b794c5f662cb
Showing with 0 additions and 25 deletions.
  1. +0 −25 activesupport/lib/active_support/multibyte/chars.rb
@@ -202,31 +202,6 @@ def translate_offset(byte_offset) #:nodoc:
end
end
def justify(integer, way, padstr=' ') #:nodoc:
raise ArgumentError, "zero width padding" if padstr.length == 0
padsize = integer - size
padsize = padsize > 0 ? padsize : 0
case way
when :right
result = @wrapped_string.dup.insert(0, padding(padsize, padstr))
when :left
result = @wrapped_string.dup.insert(-1, padding(padsize, padstr))
when :center
lpad = padding((padsize / 2.0).floor, padstr)
rpad = padding((padsize / 2.0).ceil, padstr)
result = @wrapped_string.dup.insert(0, lpad).insert(-1, rpad)
end
chars(result)
end
def padding(padsize, padstr=' ') #:nodoc:
if padsize != 0
chars(padstr * ((padsize / Unicode.u_unpack(padstr).size) + 1)).slice(0, padsize)
else
''
end
end
def chars(string) #:nodoc:
self.class.new(string)
end

0 comments on commit c973161

Please sign in to comment.