meter_cat 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -7
- data/Rakefile +1 -0
- data/app/controllers/meter_cat/meters_controller.rb +2 -4
- data/app/models/meter_cat/cache.rb +3 -1
- data/lib/meter_cat/version.rb +1 -1
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +96060 -0
- data/spec/lib/meter_cat/config_spec.rb +1 -1
- data/spec/models/meter_cat/cache_spec.rb +0 -5
- data/spec/spec_helper.rb +6 -0
- data/spec/views/meter_cat/meters/index.html.erb_spec.rb +1 -0
- metadata +43 -5
- data/spec/dummy/db/migrate/20130905081928_create_meter_cat_meters.meter_cat.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e459206d3e6badd9c186fba9cdbf228ae4e9e5d6
|
4
|
+
data.tar.gz: 3705f6fbb22f723edb76109edb98c68b1787cc5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 997dd88448960e30c43f2a28fbb03583667ff694412fddb3169d7fde9c51ff853b0b15ea82c799fd6b3ea2f308b759135298aa3c38583348f43c54a95a511929
|
7
|
+
data.tar.gz: 6bf79b28b3c22f2a5365f451feb58fcf3f225e85d1b985a7765f8486d5e698fa3db70ff699bfae623acad2bd4c9b78f71cc804770ee1b5d718d9d3f0cf88ff96
|
data/README.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/schrodingersbox/meter_cat.svg?branch=master)](https://travis-ci.org/schrodingersbox/meter_cat)
|
2
|
+
[![Coverage Status](https://coveralls.io/repos/schrodingersbox/meter_cat/badge.png?branch=master)](https://coveralls.io/r/schrodingersbox/meter_cat?branch=master)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/schrodingersbox/meter_cat.png)](https://codeclimate.com/github/schrodingersbox/meter_cat)
|
4
|
+
[![Dependency Status](https://gemnasium.com/schrodingersbox/meter_cat.png)](https://gemnasium.com/schrodingersbox/meter_cat)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/meter_cat.png)](http://badge.fury.io/rb/meter_cat)
|
6
|
+
|
1
7
|
# schrodingersbox/meter_cat README
|
2
8
|
|
3
9
|
This Rails engine makes monitoring the usage history of your Rails environment easier.
|
@@ -16,7 +22,7 @@ rather than run a bunch of count queries.
|
|
16
22
|
|
17
23
|
1. Add this to your `Gemfile` and `bundle install`
|
18
24
|
|
19
|
-
gem 'meter_cat'
|
25
|
+
gem 'meter_cat'
|
20
26
|
|
21
27
|
2. Add this to your `config/routes.rb`
|
22
28
|
|
@@ -53,6 +59,14 @@ rather than run a bunch of count queries.
|
|
53
59
|
config.subject = "#{Rails.env.upcase} MeterCat Report"
|
54
60
|
config.mail_days = 7
|
55
61
|
|
62
|
+
config.authenticate_with do
|
63
|
+
warden.authenticate! scope: :user
|
64
|
+
end
|
65
|
+
|
66
|
+
config.authorize_with do
|
67
|
+
redirect_to main_app.root_path unless current_user.try(:admin?)
|
68
|
+
end
|
69
|
+
|
56
70
|
end
|
57
71
|
|
58
72
|
## How To
|
@@ -65,7 +79,7 @@ The easiest way is to call `MeterCat.add`.
|
|
65
79
|
|
66
80
|
You can also optionally pass a value and date.
|
67
81
|
|
68
|
-
MeterCat.add( value = 1, created_on = Date.today )
|
82
|
+
MeterCat.add( :any_name_you_like, value = 1, created_on = Date.today )
|
69
83
|
|
70
84
|
### Set A Meter
|
71
85
|
|
@@ -75,7 +89,7 @@ The easiest way is to call `MeterCat.set`.
|
|
75
89
|
|
76
90
|
You can also optionally pass a value and date.
|
77
91
|
|
78
|
-
MeterCat.set( value = 1, created_on = Date.today )
|
92
|
+
MeterCat.set( :any_name_you_like, value = 1, created_on = Date.today )
|
79
93
|
|
80
94
|
This is useful where you want to record a single value for the day, such as from a daily cron job.
|
81
95
|
|
@@ -166,9 +180,6 @@ Create or add to `config/initializers/meter_cat.rb`
|
|
166
180
|
|
167
181
|
## TODO
|
168
182
|
|
169
|
-
* Badge it up - see split cat
|
170
|
-
|
171
|
-
* Publish as gem
|
172
|
-
|
173
183
|
* Action to bump meter and return an image, default to 1px transparent
|
174
184
|
* Rake task to bump a meter with args
|
185
|
+
* Group report table and descriptions by prefixes ( e.g. foo_a and foo_b = a + b in a foo group )
|
data/Rakefile
CHANGED
@@ -41,15 +41,13 @@ module MeterCat
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def _authenticate!
|
44
|
-
instance_eval(&MeterCat.config.authenticate_with)
|
44
|
+
instance_eval( &MeterCat.config.authenticate_with )
|
45
45
|
end
|
46
46
|
|
47
47
|
def _authorize!
|
48
|
-
instance_eval(&MeterCat.config.authorize_with)
|
48
|
+
instance_eval( &MeterCat.config.authorize_with )
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
51
|
end
|
54
52
|
|
55
53
|
end
|
data/lib/meter_cat/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20130904180803) do
|
15
15
|
|
16
16
|
create_table "meter_cat_meters", force: true do |t|
|
17
17
|
t.string "name", limit: 64, null: false
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|