-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from st0012/use-irb-extension-api
Use the IRB extension API to add commands to the console
- Loading branch information
Showing
6 changed files
with
46 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "irb/command" | ||
|
||
module MissionControl::Jobs::Console | ||
class ConnectTo < IRB::Command::Base | ||
category "Mission control jobs" | ||
description "Connect to a job server" | ||
|
||
def execute(server_locator) | ||
server = MissionControl::Jobs::Server.from_global_id(server_locator) | ||
MissionControl::Jobs::Current.server = server | ||
|
||
puts "Connected to #{server_locator}" | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
require "irb/command" | ||
|
||
module MissionControl::Jobs::Console | ||
class JobsHelp < IRB::Command::Base | ||
category "Mission control jobs" | ||
description "Show help for managing jobs" | ||
|
||
def execute(*) | ||
puts "You are currently connected to #{MissionControl::Jobs::Current.server}" if MissionControl::Jobs::Current.server | ||
|
||
puts "You can connect to a job server with" | ||
puts %( connect_to <app_id>:<server_id>\n\n) | ||
|
||
puts "Available job servers:\n" | ||
|
||
MissionControl::Jobs.applications.each do |application| | ||
application.servers.each do |server| | ||
puts " * #{server.to_global_id}" | ||
end | ||
end | ||
end | ||
end | ||
end |
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