module PryRailsDiffRoutes::Util
Public Instance Methods
arrow_key(key)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 13 def arrow_key(key) key.ljust(12, ' ') + '->' end
bold(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 29 def bold(text) "\e[1m#{text}\e[0m" end
bold_green(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 41 def bold_green(text) "\e[1;32m#{text}\e[0m" end
bold_red(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 33 def bold_red(text) "\e[1;31m#{text}\e[0m" end
bold_yellow(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 37 def bold_yellow(text) "\e[1;33m#{text}\e[0m" end
dim_format(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 17 def dim_format(text) text.sub(/(\(.:format\))$/, "\e[2m\\1\e[0m") end
highlight_green(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 25 def highlight_green(text) "\e[1;42m#{text}\e[0m" end
highlight_red(text)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 21 def highlight_red(text) "\e[1;41m#{text}\e[0m" end
pad_lines(text="", pad_length=0)
click to toggle source
# File lib/pry_rails_diff_routes/util.rb, line 9 def pad_lines(text="", pad_length=0) text.gsub(/^(.*)$/, ' ' * 2 * pad_length + "\\1") end