# File lib/rudy/cli/base.rb, line 11
11:     def init
12: 
13:       if Drydock.debug?
14:         #Caesars.enable_debug
15:         Rudy.enable_debug
16:       end
17: 
18:       # The CLI wants output!
19:       Rudy::Huxtable.update_logger STDOUT
20: 
21:       # Send The Huxtables the global values from the command-line
22:       Rudy::Huxtable.update_global @global
23: 
24:       # Reload configuration. This must come after update_global 
25:       # so it will catch the @@global.config path (if supplied).
26:       begin
27:         Rudy::Huxtable.update_config
28:       rescue Caesars::SyntaxError => ex
29:         le ex.message
30:         le ex.backtrace if @@global.verbose > 0
31:         exit 81
32:       end
33:       
34:       @@global.nocolor ? String.disable_color : String.enable_color
35:       @@global.auto ? Annoy.enable_skip : Annoy.disable_skip
36:       
37:       # ANSI codes look like garbage in DOS
38:       if Rudy.sysinfo.os.to_s == 'windows'
39:         String.disable_color 
40:         raise Rudy::Error, 'Ruby 1.9 is not supported (yet)' if Rudy.sysinfo.ruby == [1,9,1]
41:       end
42:       
43:       unless @@global.accesskey && @@global.secretkey
44:         le "No AWS credentials. Check your configs!"
45:         le "Try: rudy init"
46:         exit 1
47:       end
48: 
49:       #if @@global.environment =~ /^prod/ && Rudy.debug?
50:       #  li Rudy::Utils.banner("PRODUCTION ACCESS IS DISABLED IN DEBUG MODE")
51:       #  exit 1
52:       #end
53: 
54:       if @@global.verbose >= 4    # -vvvv
55:         format = @@global.format == :json ? :json : :yaml
56:         gcopy = @@global.dup
57:         gcopy.secretkey = "[HIDDEN]"
58:         li "# GLOBALS: ", gcopy.dump(format)
59:       end
60:       
61:       Rudy::Metadata.connect @@global.accesskey, @@global.secretkey, @@global.region
62:       Rudy::AWS::EC2.connect @@global.accesskey, @@global.secretkey, @@global.region
63:     end