32: def initialize(name=nil, option={}, argv=[], *args)
33: name ||= (self.class.to_s.split(/::/)).last.downcase
34: option = OpenStruct.new(option) if option.is_a? Hash
35: @name, @option, @argv = name.to_sym, option, argv
36: a, s, r = @@global.accesskey, @@global.secretkey, @@global.region
37: @@sdb ||= Rudy::AWS::SDB.new(a, s, r)
38:
39:
40:
41: @routine = fetch_routine_config @name rescue {}
42:
43: ld "Routine: #{@routine.inspect}"
44:
45: if @routine
46:
47:
48: @before, @after = @routine.delete(:before), @routine.delete(:after)
49: end
50:
51:
52: unless defined?(@@lbox)
53: host, opts = @@global.localhost, { :user => Rudy.sysinfo.user }
54: @@lbox = Rudy::Routines::Handlers::RyeTools.create_box host, opts
55: end
56:
57: disable_run if @@global.testrun
58:
59:
60:
61: $global = @@global.dup.freeze unless $global
62: $option = option.dup.freeze unless $option
63:
64:
65:
66:
67:
68: init(*args) if respond_to? :init
69: end