lib/oats/driver.rb in oats-0.0.1 vs lib/oats/driver.rb in oats-0.0.2
- old
+ new
@@ -43,16 +43,15 @@
# Main method that starts oats execution in either agent or standalone mode.
# Parameters are command-line arguments
# Returns oats_info object containing execution results
def Driver.run(args)
unless ENV['HOSTNAME']
- if ENV['OS'] == 'Windows_NT'
+ if RUBY_PLATFORM =~ /mswin32/
ENV['HOSTNAME'] = ENV['COMPUTERNAME']
else
ENV['HOSTNAME'] = `hostname`.chomp
end
end
- ENV['OS'] ||= `uname`.chomp
Log4r::Logger.root.level = Log4r::DEBUG
Log4r::StdoutOutputter.new('console', :level=>1,
:formatter=>Log4r::PatternFormatter.new(:depth=>50,
:pattern => "%-5l %d %M", :date_pattern=>"%y-%m-%d %H:%M:%S"))
\ No newline at end of file