Sha256: 4d15fb83d4dcb9bc599222267f945eab449ac4711d700e47e9167efd63cf9d06

Contents?: true

Size: 584 Bytes

Versions: 6

Compression:

Stored size: 584 Bytes

Contents

module Ec2onrails
  module Utils
    def self.run(command)
      result = system command
      raise("error, process exited with status #{$?.exitstatus}") unless result
    end
  
    def self.rails_env
      File.read("/etc/ec2onrails/rails_env").strip
    end
    
    def self.hostname
      `hostname -s`.strip
    end
    
    def self.load_config
      config = {}
      begin
        config = eval(File.read("/etc/ec2onrails/config.rb"))
      rescue Exception => e
        puts "ERROR:\n#{e.inspect}\n#{e.backtrace.join("\n")}"
      end
      return config
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
ewoutvonk-ec2onrails-0.9.10.4.001 server/files/usr/local/ec2onrails/lib/utils.rb
gigpark-ec2onrails-0.9.10.3 server/files/usr/local/ec2onrails/lib/utils.rb
pauldowman-ec2onrails-0.9.10.1 server/files/usr/local/ec2onrails/lib/utils.rb
pauldowman-ec2onrails-0.9.10.2 server/files/usr/local/ec2onrails/lib/utils.rb
pauldowman-ec2onrails-0.9.10.3 server/files/usr/local/ec2onrails/lib/utils.rb
pauldowman-ec2onrails-0.9.10.4 server/files/usr/local/ec2onrails/lib/utils.rb