ruby_badger 4.2.2 → 4.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +6 -1
- data/app/helpers/ruby_badger/application_helper.rb +14 -4
- data/lib/ruby_badger/version.rb +1 -1
- data/spec/dummy/log/test.log +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 389380a9907fcd45d232765dc266ff5542d08676c6c684a85c108a2517ca4394
|
4
|
+
data.tar.gz: 10b0d9fff940261cab9f17e5620b7cfdd10e6fe657b87ccd3eb6cdaf0cc1372a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1e5d6657a82085632f168d8ca1910bd7b71ee3f077102a4f1e5e2506fa025535d810681c937e5dcba84447a5efb9ada43bf95ec29e9926c547e1384482c8854
|
7
|
+
data.tar.gz: 39ede298ac6c4d26d70d38ff40bf1b082d02858fcb9031a686c063bf8e95e4148023c009e0f735d0eea576ff176279ad563eb4c222d20175601b4ac9b623e4ff
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby_badger (4.2.
|
4
|
+
ruby_badger (4.2.3)
|
5
5
|
rails (~> 4.2, >= 4.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -165,15 +165,15 @@ PLATFORMS
|
|
165
165
|
|
166
166
|
DEPENDENCIES
|
167
167
|
bundler (~> 1.8, >= 1.8)
|
168
|
-
capybara
|
169
|
-
factory_bot_rails
|
170
|
-
fuubar
|
168
|
+
capybara (~> 2.18.0, >= 2.18)
|
169
|
+
factory_bot_rails (~> 4.8.2, >= 4.8)
|
170
|
+
fuubar (~> 2.3.1, >= 2.3)
|
171
171
|
jquery-rails
|
172
172
|
rails
|
173
173
|
rake (~> 12.3.0, >= 12.3)
|
174
|
-
rspec-rails
|
174
|
+
rspec-rails (~> 3.7.2, >= 3.7)
|
175
175
|
ruby_badger!
|
176
|
-
sass-rails
|
176
|
+
sass-rails (~> 5.0.7, >= 5.0)
|
177
177
|
sqlite3
|
178
178
|
|
179
179
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Get a nice, clean badge displaying your Rails Environment or other helpful info. Want to display last deploy date? Or maybe the status of some app wide settings? Throw it in RubyBadger! He just doesn't care!
|
4
4
|
|
5
|
-
This is my fork/gem of [honey_badger](https://github.com/rsanheim/honey_badger) gem. This exists because honey_badger has gone dormant and hasn't been patched in many years. Although this one is not an actively changing gem, Pull requests are accepted.
|
5
|
+
This is my fork/gem of [honey_badger](https://github.com/rsanheim/honey_badger) gem. This exists because honey_badger has gone dormant and hasn't been patched in many years. Although this one is not an actively changing gem, Pull requests are accepted.
|
6
6
|
|
7
7
|
# Usage (requires Rails 4.2 and Bundler > 1.8)
|
8
8
|
|
@@ -22,6 +22,11 @@ Or pass in an array to display more than one interesting fact in your badge (eac
|
|
22
22
|
|
23
23
|
<%= ruby_badger ["eats larva", "skin is loose"] %>
|
24
24
|
|
25
|
+
To get the current get branch information: (default is false)
|
26
|
+
|
27
|
+
<%= ruby_badger(nil, true) %> # for default env text + git info
|
28
|
+
<%= ruby_badger(["eats larva", "skin is loose"], true) %> # for custom text + git info
|
29
|
+
|
25
30
|
Add the require for the css in your application.css (using Rails 3.1 sprockets awesomeness):
|
26
31
|
|
27
32
|
/*
|
@@ -1,10 +1,20 @@
|
|
1
1
|
module RubyBadger
|
2
2
|
module ApplicationHelper
|
3
|
-
def ruby_badger(text=
|
4
|
-
content_tag :div, :
|
5
|
-
|
6
|
-
|
3
|
+
def ruby_badger(text = nil, git_info = false)
|
4
|
+
content_tag :div, class: "corner-banner ruby-badger #{Rails.env}" do
|
5
|
+
text = Rails.env if text.blank?
|
6
|
+
if text.instance_of?(Array)
|
7
|
+
text << [git_branch_info] if git_info
|
8
|
+
text.join('<br/>').html_safe
|
9
|
+
else
|
10
|
+
text += '<br/>' << git_branch_info if git_info
|
11
|
+
text.html_safe
|
12
|
+
end
|
7
13
|
end
|
8
14
|
end
|
15
|
+
|
16
|
+
def git_branch_info
|
17
|
+
`git rev-parse --abbrev-ref HEAD`.chomp
|
18
|
+
end
|
9
19
|
end
|
10
20
|
end
|
data/lib/ruby_badger/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -10,3 +10,12 @@ Started GET "/assets/ruby_badger.css" for 127.0.0.1 at 2018-03-09 10:56:08 -0600
|
|
10
10
|
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
11
11
|
Started GET "/assets/ruby_badger.css" for 127.0.0.1 at 2018-03-09 10:56:21 -0600
|
12
12
|
[1m[35m (0.1ms)[0m rollback transaction
|
13
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
14
|
+
Started GET "/assets/ruby_badger.css" for 127.0.0.1 at 2018-03-09 11:15:59 -0600
|
15
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
17
|
+
Started GET "/assets/ruby_badger.css" for 127.0.0.1 at 2018-03-09 11:16:16 -0600
|
18
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
19
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
20
|
+
Started GET "/assets/ruby_badger.css" for 127.0.0.1 at 2018-03-09 11:31:28 -0600
|
21
|
+
[1m[35m (0.1ms)[0m rollback transaction
|