-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an interactive console for users as well (#21803)
* Add an interactive console for users as well * Proposed documentation * Apply copy suggestions. * Format copy. --------- Co-authored-by: Roger Oba <rogerluan.oba@gmail.com>
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'irb' | ||
|
||
module Fastlane | ||
# Opens an interactive developer console | ||
class Console | ||
def self.execute(args, options) | ||
ARGV.clear | ||
IRB.setup(nil) | ||
@irb = IRB::Irb.new(nil) | ||
IRB.conf[:MAIN_CONTEXT] = @irb.context | ||
IRB.conf[:PROMPT][:FASTLANE] = IRB.conf[:PROMPT][:SIMPLE].dup | ||
IRB.conf[:PROMPT][:FASTLANE][:RETURN] = "%s\n" | ||
@irb.context.prompt_mode = :FASTLANE | ||
@irb.context.workspace = IRB::WorkSpace.new(binding) | ||
trap('INT') do | ||
@irb.signal_handle | ||
end | ||
|
||
UI.message('Welcome to fastlane interactive!') | ||
|
||
catch(:IRB_EXIT) { @irb.eval_input } | ||
end | ||
end | ||
end |