code_version 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/controllers/code_version/code_versions_controller.rb +11 -6
- data/config/routes.rb +1 -1
- data/lib/code_version/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24ded9236a6e12600e615a3f18fd027997e92e7d
|
4
|
+
data.tar.gz: 46f95e2082b73d5fbf7bdff76a635188655a0091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62743528cb80799ede477e99c48391d6e514e76db17cd7a78a4417fd05661858658224609537591d0e98ee43cdebae4897112dee20965ef1097ec173d01357ac
|
7
|
+
data.tar.gz: 7a814d454183e537adf6ef3059b2e6470ede13341377220cceae3a441589d57ba3800a20ae251789b38b74ce32ed52ff9d47e5f9e0d91d91c08e3f04bd07ad26
|
data/README.md
CHANGED
@@ -3,13 +3,13 @@ The mountable rails engine that provide api call to get the git commit number on
|
|
3
3
|
|
4
4
|
## Usage
|
5
5
|
After install you can go to the url to get a git commit number of code that deploy on server.
|
6
|
-
Url example: http://your_domain/
|
6
|
+
Url example: http://your_domain/api/metadata
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'code_version', '~> 0.1.
|
12
|
+
gem 'code_version', '~> 0.1.5'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -21,7 +21,7 @@ And mount rails engine routes to your application routes by putting
|
|
21
21
|
```ruby
|
22
22
|
Rails.application.routes.draw do
|
23
23
|
...
|
24
|
-
mount CodeVersion::Engine => "/
|
24
|
+
mount CodeVersion::Engine => "api/metadata"
|
25
25
|
...
|
26
26
|
end
|
27
27
|
```
|
@@ -1,15 +1,20 @@
|
|
1
1
|
module CodeVersion
|
2
|
-
class CodeVersionsController <
|
2
|
+
class CodeVersionsController < ActionController::Base
|
3
3
|
def show
|
4
4
|
file_path = "#{Rails.root}/REVISION"
|
5
5
|
info = {}
|
6
|
+
|
6
7
|
if File.exists? file_path
|
7
|
-
|
8
|
-
|
9
|
-
end
|
8
|
+
info["deploy_time"] = File.mtime(file_path)
|
9
|
+
info["git_commit_hash"] = File.open(file_path).each_line.first.to_s.chomp
|
10
10
|
else
|
11
|
-
|
12
|
-
|
11
|
+
info["deploy_time"] = "NOT_FOUND"
|
12
|
+
info["git_commit_hash"] = "NOT_FOUND"
|
13
|
+
end
|
14
|
+
|
15
|
+
info["environment"] = Rails.env
|
16
|
+
|
17
|
+
|
13
18
|
render :json => info
|
14
19
|
end
|
15
20
|
end
|
data/config/routes.rb
CHANGED
data/lib/code_version/version.rb
CHANGED