glimpse-git 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # 1.0
2
+
3
+ * Initial release
4
+
5
+ # 1.0.1
6
+
7
+ * Added support for GIT_SHA and GIT_BRANCH env variables instead of shelling out to fetch them.
data/README.md CHANGED
@@ -47,6 +47,20 @@ You can also manually set each of the following optional options:
47
47
  Glimpse.into Glimpse::Views::Git, :sha => '740f6b7b11b8717efaf51ddb98ce23394544f7e0', :default_branch => 'rails4.0', :branch_name => 'integration'
48
48
  ```
49
49
 
50
+ ## Using Glimpse::Git on Heroku
51
+
52
+ If you try to deploy this to Heroku it won't actually work right away. Heroku
53
+ removes the .git directory which doesn't allow us to fetch the HEAD ref or branch.
54
+
55
+ To solve this, there is a custom buildpack that is forked from the default Ruby
56
+ buildpack that will set `GIT_SHA` and `GIT_BRANCH` for you.
57
+
58
+ To install this buildpack just run:
59
+
60
+ ```
61
+ heroku config:set BUILDPACK_URL=https://github.com/dewski/heroku-buildpack-ruby.git --app appname
62
+ ```
63
+
50
64
  ## Contributing
51
65
 
52
66
  1. Fork it
File without changes
@@ -1,5 +1,5 @@
1
1
  module Glimpse
2
2
  module Git
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -24,12 +24,12 @@ module Glimpse
24
24
 
25
25
  # Fetch the current branch name.
26
26
  def branch_name
27
- @branch_name ||= `git rev-parse --abbrev-ref HEAD`.chomp
27
+ @branch_name ||= ENV['GIT_BRANCH'] || `git rev-parse --abbrev-ref HEAD`.chomp
28
28
  end
29
29
 
30
30
  # Fetch the current sha if one isn't present.
31
31
  def sha
32
- @sha ||= `git rev-parse HEAD`.chomp
32
+ @sha ||= ENV['GIT_SHA'] || `git rev-parse HEAD`.chomp
33
33
  end
34
34
 
35
35
  def short_sha
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimpse-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-09 00:00:00.000000000 Z
12
+ date: 2013-03-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Provide a glimpse into the Git info of your Rails application.
15
15
  email:
@@ -19,12 +19,13 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - .gitignore
22
+ - CHANGELOG.md
22
23
  - Gemfile
23
24
  - LICENSE.txt
24
25
  - README.md
25
26
  - Rakefile
26
27
  - app/views/glimpse/views/_git.html.erb
27
- - glimpse-redis.gemspec
28
+ - glimpse-git.gemspec
28
29
  - lib/glimpse-git.rb
29
30
  - lib/glimpse-git/railtie.rb
30
31
  - lib/glimpse-git/version.rb