lib/ruby-app/application_defaults.rb in ruby-app-0.1.10 vs lib/ruby-app/application_defaults.rb in ruby-app-0.1.11
- old
+ new
@@ -1,7 +1,9 @@
# -*- encoding : utf-8 -*-
+$app_started_at = Time.now
+
module Application::Defaults
def tmp_dir
@gem_tmp_dir ||= File.join(root, %w{tmp})
end
@@ -58,13 +60,24 @@
end
def bundler_group
end
+ def started_at
+ $app_started_at
+ end
+
def error_mailer
ErrorMailer
end
+ def revision
+ @_revision ||= File.read(File.join(root, %w[REVISION]))[0..5] rescue nil
+ end
+
+ def hostname
+ @_hostname ||= `hostname`.chop
+ end
end
Application.extend(Application::Defaults)
App = Application unless defined?(App)