Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/rake/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require_relative "thread_history_display"
require_relative "trace_output"
require_relative "win32"
require_relative "console"

module Rake

Expand Down Expand Up @@ -644,6 +645,9 @@ def standard_rake_options # :nodoc:
options.ignore_deprecate = true
}
],
["--console", "-c", "Start an interactive Rake console (IRB)", lambda { |value|
Console.start
}],
])
end

Expand Down
14 changes: 14 additions & 0 deletions lib/rake/console.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true
module Rake
module Console
def self.start
require "irb"

puts "Rake console, version #{Rake::VERSION}"
Rake.application.load_rakefile
ARGV.clear
IRB.start
exit
end
end
end