mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
d140b03053
commit
66abeb0370
1 changed files with 20 additions and 0 deletions
20
lib/un.rb
20
lib/un.rb
|
@ -23,6 +23,7 @@
|
||||||
# ruby -run -e wait_writable -- [OPTION] FILE
|
# ruby -run -e wait_writable -- [OPTION] FILE
|
||||||
# ruby -run -e mkmf -- [OPTION] EXTNAME [OPTION]
|
# ruby -run -e mkmf -- [OPTION] EXTNAME [OPTION]
|
||||||
# ruby -run -e httpd -- [OPTION] [DocumentRoot]
|
# ruby -run -e httpd -- [OPTION] [DocumentRoot]
|
||||||
|
# ruby -run -e colorize -- FILE
|
||||||
# ruby -run -e help [COMMAND]
|
# ruby -run -e help [COMMAND]
|
||||||
|
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
|
@ -373,6 +374,25 @@ def httpd
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Colorize ruby code.
|
||||||
|
#
|
||||||
|
# ruby -run -e colorize -- FILE
|
||||||
|
#
|
||||||
|
|
||||||
|
def colorize
|
||||||
|
begin
|
||||||
|
require "irb/color"
|
||||||
|
rescue LoadError
|
||||||
|
raise "colorize requires irb 1.1.0 or later"
|
||||||
|
end
|
||||||
|
setup do |argv, |
|
||||||
|
argv.each do |file|
|
||||||
|
puts IRB::Color.colorize_code File.read(file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Display help message.
|
# Display help message.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue