sasha 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -3
- data/lib/sasha.rb +1 -0
- data/lib/sasha/rails.rb +1 -1
- data/lib/sasha/sinatra.rb +1 -1
- data/lib/sasha/version.rb +1 -1
- data/test/unit/test_controller.rb +2 -2
- metadata +3 -3
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Sasha
|
2
2
|
|
3
|
-
Add your current Git SHA to your Rails app
|
3
|
+
Add your current Git SHA to your Rails or Sinatra app
|
4
4
|
response headers.
|
5
5
|
|
6
6
|
## Requirements
|
7
7
|
|
8
|
-
git
|
8
|
+
That you use git to track your source code
|
9
9
|
|
10
10
|
## Usage
|
11
11
|
|
@@ -34,7 +34,11 @@ Require it on *config.ru* after sinatra/base
|
|
34
34
|
|
35
35
|
## Test it
|
36
36
|
|
37
|
-
$ curl -I http://www.example.net | grep X-Git-
|
37
|
+
$ curl -I http://www.example.net | grep X-Git-Sha
|
38
|
+
|
39
|
+
Your should see something like
|
40
|
+
|
41
|
+
X-Git-Sha: ae4822ddfdfbb27cddcc30b718d6f9bc99138044
|
38
42
|
|
39
43
|
# About the Author
|
40
44
|
|
data/lib/sasha.rb
CHANGED
data/lib/sasha/rails.rb
CHANGED
data/lib/sasha/sinatra.rb
CHANGED
data/lib/sasha/version.rb
CHANGED
@@ -8,13 +8,13 @@ class TestController < ActionController::TestCase
|
|
8
8
|
def test_header_included_in_request
|
9
9
|
Sasha::Git.expects(:current_sha).twice.returns('ABC123ABC123')
|
10
10
|
get 'index'
|
11
|
-
assert_equal 'ABC123ABC123', response.headers[
|
11
|
+
assert_equal 'ABC123ABC123', response.headers[Sasha::HEADER_NAME]
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_warning
|
15
15
|
Sasha::Git.expects(:current_sha).twice.returns(nil)
|
16
16
|
@controller.expects(:warn).once.with(instance_of(String))
|
17
17
|
get 'index'
|
18
|
-
assert_equal nil, response.headers[
|
18
|
+
assert_equal nil, response.headers[Sasha::HEADER_NAME]
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sasha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Padilla
|