alive_state 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/alive_state.rb +1 -0
- data/lib/alive_state/configure.rb +1 -1
- data/lib/alive_state/default.rb +5 -0
- data/lib/alive_state/info.rb +38 -0
- data/lib/alive_state/middleware.rb +1 -0
- data/lib/alive_state/version.rb +1 -1
- data/spec/lib/info_spec.rb +15 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69dd30f20ea7b65fe725211131cef1b71c5946b5
|
4
|
+
data.tar.gz: 49540e42baa065b1541bc1add1941ff397aaa3d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95d21b7bdbfd6bdd9a314ca49b76b9f77fb881ca39996c87fb5da4501499863eba1c9bbfb0333877578579a23cfed81e8a75c94b3664752f0de1ca0b254655fd
|
7
|
+
data.tar.gz: cfd5caae08fc53520b5d4fbf489bb29b2fcd93eb55947a6db02e77650b5270c6c65ae968b85a1275b36cbf935606f11becbb51b5ad7abf90f7463ef09fab9d35
|
data/README.md
CHANGED
data/lib/alive_state.rb
CHANGED
data/lib/alive_state/default.rb
CHANGED
@@ -3,6 +3,7 @@ module AliveState
|
|
3
3
|
PATH = 'status'.freeze
|
4
4
|
FORMAT = 'json'.freeze
|
5
5
|
InsertMiddleware = true.freeze
|
6
|
+
VERSION = ''.freeze
|
6
7
|
|
7
8
|
class << self
|
8
9
|
def options
|
@@ -20,6 +21,10 @@ module AliveState
|
|
20
21
|
def insert_middleware
|
21
22
|
InsertMiddleware
|
22
23
|
end
|
24
|
+
|
25
|
+
def version
|
26
|
+
VERSION
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module AliveState
|
2
|
+
module Info
|
3
|
+
class << self
|
4
|
+
def version
|
5
|
+
@version ||= read_file
|
6
|
+
end
|
7
|
+
|
8
|
+
def reversion
|
9
|
+
@reversion ||= read_git
|
10
|
+
end
|
11
|
+
|
12
|
+
def version_format
|
13
|
+
[self.version, self.reversion].join(' ').strip
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
def read_file
|
18
|
+
File.read(AliveState.config.version).strip
|
19
|
+
rescue
|
20
|
+
''
|
21
|
+
end
|
22
|
+
|
23
|
+
def read_git
|
24
|
+
raw = ''
|
25
|
+
cmd = 'git log --pretty=format:%h -n 1'
|
26
|
+
IO.popen(cmd, 'r') do |stdout|
|
27
|
+
stdout.each do |row|
|
28
|
+
raw << row
|
29
|
+
end
|
30
|
+
end
|
31
|
+
raw.chomp
|
32
|
+
rescue
|
33
|
+
''
|
34
|
+
end
|
35
|
+
# end private
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/alive_state/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AliveState::Info do
|
4
|
+
describe "version" do
|
5
|
+
it "returns info version" do
|
6
|
+
expect(AliveState::Info.version).not_to be_nil
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "reversion" do
|
11
|
+
it "returns info reversion" do
|
12
|
+
expect(AliveState::Info.reversion).not_to be_nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alive_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ogom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,11 +56,13 @@ files:
|
|
56
56
|
- lib/alive_state/application.rb
|
57
57
|
- lib/alive_state/configure.rb
|
58
58
|
- lib/alive_state/default.rb
|
59
|
+
- lib/alive_state/info.rb
|
59
60
|
- lib/alive_state/middleware.rb
|
60
61
|
- lib/alive_state/rails.rb
|
61
62
|
- lib/alive_state/registry.rb
|
62
63
|
- lib/alive_state/version.rb
|
63
64
|
- spec/alive_state_spec.rb
|
65
|
+
- spec/lib/info_spec.rb
|
64
66
|
- spec/lib/version_spec.rb
|
65
67
|
- spec/spec_helper.rb
|
66
68
|
homepage: http://ogom.github.io/alive_state
|
@@ -89,5 +91,6 @@ specification_version: 4
|
|
89
91
|
summary: Alive Application State.
|
90
92
|
test_files:
|
91
93
|
- spec/alive_state_spec.rb
|
94
|
+
- spec/lib/info_spec.rb
|
92
95
|
- spec/lib/version_spec.rb
|
93
96
|
- spec/spec_helper.rb
|