rinfo 0.1.2 → 0.1.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.
- checksums.yaml +4 -4
- data/.gemrelease +5 -0
- data/MIT-LICENSE +1 -1
- data/README.md +17 -7
- data/lib/rinfo.rb +2 -1
- data/lib/rinfo/version.rb +1 -1
- data/spec/controllers/rinfo_controller_spec.rb +18 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48bf8ab63486dafa4d75ae5648ea021cfc24670e
|
4
|
+
data.tar.gz: 24aca6b70c28dae0ce9acf3f8328a58ef32e5bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aea752affa94e2246eec334ab5d80c4ac95acee8d0a0a660c9be8b9989df98d1265231dd98f1be657c6f9b17007c4073f1eb6181a6adb8fefe6228ba57c716d5
|
7
|
+
data.tar.gz: f1b8a6bbbf7720d10f329cf555676d7a6c1c4b9e749272fbec882eb1ee8800a76dea4e19f10f5757e4c5383dd99639128602201c5d2cb6fdc2a334fb1b7630bf
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -18,18 +18,28 @@ Accessing your `rinfo.json` page will product something like this:
|
|
18
18
|
|
19
19
|
```javascript
|
20
20
|
{
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
deployed_by: "Rafe Colton",
|
22
|
+
deployed_at: "2014-03-17 15:18:35 -0700",
|
23
|
+
rails_env: "development",
|
24
|
+
branch: "master",
|
25
|
+
rev: "018f44579795167c56066c013b4b18e196142ecb"
|
26
26
|
}
|
27
27
|
```
|
28
28
|
|
29
29
|
It's as easy as that!
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
### A Note About Estimation
|
32
|
+
|
33
|
+
It is not always the case that the release information above is
|
34
|
+
available, so sometimes, it has to be estimated. In addition, Rinfo
|
35
|
+
does not make any assumptions about how you deploy your application, and
|
36
|
+
not all deployment methods make it possible to inject your release
|
37
|
+
information at deploy time. Therefore, the following estimations are
|
38
|
+
made at run time:
|
39
|
+
|
40
|
+
* `deployed_by`: estimated as the git config `user.name`, or, if that is
|
41
|
+
not available, the author name on the most recent commit
|
42
|
+
* `deployed_at`: estimated as timestamp of the most recent commit
|
33
43
|
|
34
44
|
## Installation
|
35
45
|
|
data/lib/rinfo.rb
CHANGED
data/lib/rinfo/version.rb
CHANGED
@@ -11,21 +11,21 @@ describe RinfoController, type: :controller do
|
|
11
11
|
Dir.chdir(@tmpdir)
|
12
12
|
|
13
13
|
# initialize a git repository
|
14
|
-
git = Git.init(Dir.pwd)
|
14
|
+
@git = Git.init(Dir.pwd)
|
15
15
|
FileUtils.touch("#{Dir.pwd}/initial-file.txt")
|
16
16
|
@name = 'Spec Ninja'
|
17
|
-
git.config('user.name', @name)
|
18
|
-
git.config('user.email', 'spec_ninja@example.com')
|
19
|
-
git.add
|
20
|
-
git.commit('initial commit')
|
17
|
+
@git.config('user.name', @name)
|
18
|
+
@git.config('user.email', 'spec_ninja@example.com')
|
19
|
+
@git.add
|
20
|
+
@git.commit('initial commit')
|
21
21
|
|
22
22
|
# checkout our desired branch
|
23
23
|
@branch_name = 'foo-bar-branch'
|
24
|
-
git.branch(@branch_name).checkout
|
24
|
+
@git.branch(@branch_name).checkout
|
25
25
|
|
26
26
|
# set the other things we're checking for
|
27
|
-
@rev = git.revparse('HEAD')
|
28
|
-
@date = git.log.first.date
|
27
|
+
@rev = @git.revparse('HEAD')
|
28
|
+
@date = @git.log.first.date
|
29
29
|
end
|
30
30
|
|
31
31
|
before(:each) do
|
@@ -135,5 +135,15 @@ describe RinfoController, type: :controller do
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
138
|
+
|
139
|
+
context 'git config user.name is blank' do
|
140
|
+
before(:each) { @git.config('user.name', '') }
|
141
|
+
after(:each) { @git.config('user.name', @name) }
|
142
|
+
|
143
|
+
it 'displays the author name on the last commit' do
|
144
|
+
get 'info', format: :json
|
145
|
+
response.body.should == rinfo
|
146
|
+
end
|
147
|
+
end
|
138
148
|
end
|
139
149
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafe Colton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -116,6 +116,7 @@ executables:
|
|
116
116
|
extensions: []
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
|
+
- .gemrelease
|
119
120
|
- .gitignore
|
120
121
|
- .rspec
|
121
122
|
- .rubocop.yml
|