Class: CodeVersion::CodeVersionsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- CodeVersion::CodeVersionsController
- Defined in:
- app/controllers/code_version/code_versions_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/code_version/code_versions_controller.rb', line 3 def show file_path = "#{Rails.root}/REVISION" info = {} if File.exists? file_path info["deploy_time"] = File.mtime(file_path) info["git_commit_hash"] = File.open(file_path).each_line.first.to_s.chomp else info["deploy_time"] = "NOT_FOUND" info["git_commit_hash"] = "NOT_FOUND" end info["environment"] = Rails.env render :json => info end |