show_sha 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/app/controllers/sha_controller.rb +16 -3
- data/app/views/sha/index.html.erb +5 -15
- data/show_sha.gemspec +1 -1
- metadata +3 -2
data/CHANGELOG
ADDED
@@ -1,6 +1,19 @@
|
|
1
1
|
class ShaController < ApplicationController
|
2
|
-
|
2
|
+
|
3
|
+
respond_to :html, :xml, :json
|
4
|
+
|
3
5
|
def index
|
4
|
-
|
6
|
+
sha = heroku_SHA || local_SHA
|
7
|
+
@info = {:sha => sha[0,10]}
|
8
|
+
respond_with @info
|
5
9
|
end
|
6
|
-
|
10
|
+
|
11
|
+
private
|
12
|
+
def heroku_SHA
|
13
|
+
ENV["COMMIT_HASH"]
|
14
|
+
end
|
15
|
+
|
16
|
+
def local_SHA
|
17
|
+
`git rev-parse HEAD`
|
18
|
+
end
|
19
|
+
end
|
@@ -1,16 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<title>sha = <%= @sha %></title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #add8e6; text-align: center; font-family: courier}
|
7
|
-
h1 { font-size: 250%; color: #f00; line-height: 1.5em; margin-top: 5em}
|
8
|
-
h2 { font-size: 200%; color: #666; line-height: 1.5em; }
|
9
|
-
</style>
|
10
|
-
</head>
|
1
|
+
<style type="text/css">
|
2
|
+
body { background-color: #add8e6; text-align: center; font-family: courier}
|
3
|
+
h1 { font-size: 250%; color: #f00; line-height: 1.5em; margin-top: 5em}
|
11
4
|
|
12
|
-
|
13
|
-
|
14
|
-
<h2><%= @sha %></h2>
|
15
|
-
</body>
|
16
|
-
</html>
|
5
|
+
</style>
|
6
|
+
<h1><%= @info %></h1>
|
data/show_sha.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: show_sha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alain Ravet
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-29 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -57,6 +57,7 @@ extra_rdoc_files: []
|
|
57
57
|
|
58
58
|
files:
|
59
59
|
- .gitignore
|
60
|
+
- CHANGELOG
|
60
61
|
- Gemfile
|
61
62
|
- MIT-LICENSE
|
62
63
|
- README.markdown
|