Created
November 27, 2012 03:40
-
-
Save hanachin/4152216 to your computer and use it in GitHub Desktop.
CodeIQの解答 挑戦者求む!【Ruby】Rubyでちょこっとテキスト処理 by フリーランス suginoy suginoy│CodeIQ https://codeiq.jp/ace/suginoy/q77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ARGV.instance_eval do | |
exit if empty? | |
width = map(&:size).max | |
border = "+#{'-' * width}+" | |
puts border | |
each {|line| | |
puts format("|%-*s|", width, line), border | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment