Skip to content

Instantly share code, notes, and snippets.

@hanachin
Created November 27, 2012 03:40
Show Gist options
  • Save hanachin/4152216 to your computer and use it in GitHub Desktop.
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
#!/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