plus2_version 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/plus2_version/railtie.rb +10 -0
- data/lib/plus2_version/version.rb +1 -1
- data/lib/plus2_version/version_finder.rb +28 -0
- data/lib/plus2_version.rb +3 -0
- metadata +6 -4
@@ -0,0 +1,28 @@
|
|
1
|
+
module Plus2Version
|
2
|
+
class VersionFinder
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def as_hash
|
6
|
+
{
|
7
|
+
:log => git('log HEAD^.. --shortstat --no-color --decorate').split("\n")
|
8
|
+
}
|
9
|
+
end
|
10
|
+
|
11
|
+
def sha
|
12
|
+
git('rev-parse HEAD').chomp
|
13
|
+
end
|
14
|
+
|
15
|
+
def git(cmd)
|
16
|
+
git = Plus2Version.git_path || 'git'
|
17
|
+
Dir.chdir(Rails.root) do
|
18
|
+
`#{git} #{cmd}`.chomp.tap {|output|
|
19
|
+
output.replace('problem running git') unless $?.success?
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
LoadTimeSha = self.sha
|
26
|
+
LoadTimeLog = self.as_hash
|
27
|
+
end
|
28
|
+
end
|
data/lib/plus2_version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plus2_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lachie Cox
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-05 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -29,8 +29,10 @@ extensions: []
|
|
29
29
|
extra_rdoc_files: []
|
30
30
|
|
31
31
|
files:
|
32
|
+
- lib/plus2_version/railtie.rb
|
32
33
|
- lib/plus2_version/routes.rb
|
33
34
|
- lib/plus2_version/version.rb
|
35
|
+
- lib/plus2_version/version_finder.rb
|
34
36
|
- lib/plus2_version.rb
|
35
37
|
- Readme.md
|
36
38
|
has_rdoc: true
|