forked from auser/poolparty
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloud-console
executable file
·46 lines (39 loc) · 1.15 KB
/
cloud-console
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "poolparty"
require 'git-style-binary/command'
GitStyleBinary.command do
banner <<-EOS
Usage: #{$0} #{all_options_string}
Open an irb session with the clouds.rb loaded
EOS
short_desc "Open an irb session with clouds.rb loaded"
opt :inst_num, "The number of the instance to run bootstrap on", :type => :int
run do |command|
puts "Loading PoolParty console..."
#exec "#{irb} #{libs} --simple-prompt"
require 'irb/completion'
require command[:clouds_dot_rb]
require "#{File.dirname(__FILE__) + '/../lib/poolparty.rb'}"
require 'irb'
pool.auto_execute = false
IRB.setup(nil)
IRB.conf[:IRB_NAME]="cloud"
IRB.conf[:PROMPT_MODE]=:CLOUD
IRB.conf[:PROMPT][:CLOUD]={
:PROMPT_I => "%N> ",
:PROMPT_S => "%l> ",
:PROMPT_C => "* ",
:PROMPT_N => ">> ",
:RETURN => "=>%s\n" }
irb=IRB::Irb.new
IRB.conf[:IRB_RC].call(irb.context) if IRB.conf[:IRB_RC]
IRB.conf[:MAIN_CONTEXT] = irb.context
trap("SIGINT") do
irb.signal_handle
end
catch(:IRB_EXIT) do
irb.eval_input
end
end
end