barkeep 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c1d538a93aa89e6669467682442091dd61eddc4
4
- data.tar.gz: 02d2cd3bfb771bbbaa843051a39f47d81a3199a5
3
+ metadata.gz: 3bc22ae0334bd062994f2f3ba6f35a7f827fe434
4
+ data.tar.gz: a44a8ee5ba696dfff887227e8e9540c577352eec
5
5
  SHA512:
6
- metadata.gz: f064783e33b5768021a3ab970b97c5bfc5f5df962fc3a14dd7c660aaab43a6e8b80d6752a9abce6095c925aee68cd7e046139b8f9be63e60278da3572e2f05e4
7
- data.tar.gz: 48a15b47f101b868299ef12855b5c40c6facc5bc596fcf8bbbdcceaa7d202f74054af0cc2a7097f6734af9a2e70f3b1dfe60511d457636ba1a6142dc8427e18a
6
+ metadata.gz: 9b695eeb570ab938298fdca879914e9701615e2eb8e5444a5d9a7ed70ff37b41e38dfea8d3ba5d235fb2153a90d0382bcbd7c177d0d0ba2f999c569242e2ee8e
7
+ data.tar.gz: 5caf5c8cd0cef36f1630f4419372f725cc7d760c3eae118ee2da8a70494800cb0a4ea0e22c561eb9c124a8a9559a35e38a57630ce9c3802fe4094c513df85c8b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 0.3.1 - November 20, 2015
2
+
3
+ * Work in situations where you haven't deployed into a git repository
4
+
1
5
  ## Version 0.3.0 - February 20, 2014
2
6
 
3
7
  * Drop the dependency on grit (which is abandoned) in favor of calling git on the command line
data/lib/barkeep.rb CHANGED
@@ -11,7 +11,7 @@ module Barkeep
11
11
  end
12
12
 
13
13
  class Barkeeper
14
-
14
+
15
15
  attr_accessor :renderer
16
16
 
17
17
  def config
@@ -33,7 +33,7 @@ class Barkeeper
33
33
  end
34
34
 
35
35
  def render_toolbar
36
- return unless load? && grit_info.repository?
36
+ return unless load?
37
37
 
38
38
  %(
39
39
  <dl id="barkeep">
@@ -43,7 +43,7 @@ class Barkeeper
43
43
  if renderer.respond_to?(:render_to_string)
44
44
  renderer.send(:render_to_string, {:partial => $2})
45
45
  else
46
- renderer.send(:render, {:partial => $2})
46
+ renderer.send(:render, {:partial => $2})
47
47
  end
48
48
  else
49
49
  send(name)
@@ -62,20 +62,31 @@ class Barkeeper
62
62
  end
63
63
 
64
64
  def branch_info
65
- %(<dt>Branch:</dt><dd><a href="#{branch_link_attributes[:href]}">#{grit_info[:branch]}</a></dd>)
65
+ if grit_info.repository?
66
+ %(<dt>Branch:</dt><dd><a href="#{branch_link_attributes[:href]}">#{grit_info[:branch]}</a></dd>)
67
+ end
66
68
  end
67
69
 
68
70
  def commit_sha_info
69
- %(<dt>Commit:</dt><dd><a href="#{commit_link_attributes[:href]}" title="#{commit_link_attributes[:title]}">#{(grit_info[:commit] || "").slice(0,8)}</a></dd>)
71
+ if grit_info.repository?
72
+ %(<dt>Commit:</dt><dd><a href="#{commit_link_attributes[:href]}" title="#{commit_link_attributes[:title]}">#{(grit_info[:commit] || "").slice(0,8)}</a></dd>)
73
+ elsif File.exist?(Rails.root.join('REVISION'))
74
+ commit = Rails.root.join('REVISION').read.strip
75
+ %(<dt>Commit:</dt><dd><a href="#{commit_link(commit)}">#{commit.slice(0,8)}</a></dd>)
76
+ end
70
77
  end
71
78
 
72
79
  def commit_author_info
73
- %(<dt>Who:</dt><dd>#{grit_info[:last_author]}</dd>)
80
+ if grit_info.repository?
81
+ %(<dt>Who:</dt><dd>#{grit_info[:last_author]}</dd>)
82
+ end
74
83
  end
75
84
 
76
85
  def commit_date_info
77
- short_date = (grit_info[:date].respond_to?(:strftime) ? grit_info[:date].strftime("%d %B, %H:%M") : short_date.to_s)
78
- %(<dt>When:</dt><dd title="#{grit_info[:date].to_s}">#{short_date}</dd>)
86
+ if grit_info.repository?
87
+ short_date = (grit_info[:date].respond_to?(:strftime) ? grit_info[:date].strftime("%d %B, %H:%M") : short_date.to_s)
88
+ %(<dt>When:</dt><dd title="#{grit_info[:date].to_s}">#{short_date}</dd>)
89
+ end
79
90
  end
80
91
 
81
92
  def rpm_request_info
@@ -99,9 +110,13 @@ class Barkeeper
99
110
  }
100
111
  end
101
112
 
113
+ def commit_link(commit_hash)
114
+ "#{github_url}/commit/#{commit_hash}"
115
+ end
116
+
102
117
  def commit_link_attributes
103
118
  {
104
- :href => "#{github_url}/commit/#{grit_info[:commit]}",
119
+ :href => commit_link(grit_info[:commit]),
105
120
  :title => "committed #{grit_info[:date]} by #{grit_info[:last_author]}"
106
121
  }
107
122
  end
@@ -1,3 +1,3 @@
1
1
  module Barkeep
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barkeep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PatientsLikeMe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2015-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.2.0
111
+ rubygems_version: 2.4.5.1
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: an extensible developer's status bar to track your current deployed commit
@@ -116,4 +116,3 @@ summary: an extensible developer's status bar to track your current deployed com
116
116
  test_files:
117
117
  - test/helper.rb
118
118
  - test/test_barkeep.rb
119
- has_rdoc: