lib/simple_deploy/cli/attributes.rb in simple_deploy-0.7.2 vs lib/simple_deploy/cli/attributes.rb in simple_deploy-0.7.3
- old
+ new
@@ -26,47 +26,36 @@
end
valid_options? :provided => @opts,
:required => [:environment, :name]
+ SimpleDeploy.create_config @opts[:environment]
+ SimpleDeploy.logger @opts[:log_level]
+ @stack = Stack.new :name => @opts[:name],
+ :environment => @opts[:environment]
+
@opts[:as_command_args] ? command_args_output : default_output
end
def command_summary
'Show attributes for stack'
end
private
def attribute_data
- rescue_stackster_exceptions_and_exit do
- Hash[stack.attributes.sort]
+ rescue_exceptions_and_exit do
+ Hash[@stack.attributes.sort]
end
end
def command_args_output
puts attribute_data.map { |k, v| "-a #{k}=#{v}" }.join(' ')
end
- def config
- @config ||= Config.new.environment @opts[:environment]
- end
-
def default_output
attribute_data.each_pair { |k, v| puts "#{k}: #{v}" }
end
-
- def logger
- @logger ||= SimpleDeployLogger.new :log_level => @opts[:log_level]
- end
-
- def stack
- @stack = Stack.new :environment => @opts[:environment],
- :name => @opts[:name],
- :config => config,
- :logger => logger
- end
-
end
end
end