Module: Thor::Group::ReplaceHelpOutputWithJets

Included in:
Thor::Group
Defined in:
lib/jets/commands/generate/generate_command.rb

Instance Method Summary collapse

Instance Method Details

#capture_stdout_for_helpObject



81
82
83
84
85
86
87
88
# File 'lib/jets/commands/generate/generate_command.rb', line 81

def capture_stdout_for_help
  stdout_old = $stdout
  io = StringIO.new
  $stdout = io
  yield
  $stdout = stdout_old
  io.string
end

#help(shell) ⇒ Object



74
75
76
77
78
79
# File 'lib/jets/commands/generate/generate_command.rb', line 74

def help(shell)
  out = capture_stdout_for_help do
    super # invoke to get the help output
  end
  puts out.gsub('rails','jets').gsub('Rails','Jets')
end