11: def init
12:
13: if Drydock.debug?
14:
15: Rudy.enable_debug
16: end
17:
18:
19: Rudy::Huxtable.update_logger STDOUT
20:
21:
22: Rudy::Huxtable.update_global @global
23:
24:
25:
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:
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:
50:
51:
52:
53:
54: if @@global.verbose >= 4
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