meter_cat 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1be278011459ec8fdb482b9938f24b8df6eff94c
4
- data.tar.gz: 49c9636cb99a841ac11df761c371c13b595af928
3
+ metadata.gz: e459206d3e6badd9c186fba9cdbf228ae4e9e5d6
4
+ data.tar.gz: 3705f6fbb22f723edb76109edb98c68b1787cc5b
5
5
  SHA512:
6
- metadata.gz: 06f4674f2ed6a9942c9256c77ca344d0b2d9e499bdec28954fabe93820ec7a44b3e2cbf1e3a8df75bff66164ff460d495152bea7da547bcb5e0326cf931c1a59
7
- data.tar.gz: ccdcb7fedd5bdebedff19e7705674a08d8a9b75bd4c4d34ac36f9fbe254d4ca5b53c29c5e0460127449fb0d38e568d1bebea1b6d20359ce9e71fe1735a5a651f
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', :git => 'https://github.com/schrodingersbox/meter_cat.git'
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
@@ -19,4 +19,5 @@ load 'rails/tasks/engine.rake'
19
19
 
20
20
  Bundler::GemHelper.install_tasks
21
21
 
22
+ load 'tasks/meter_cat.rake'
22
23
  load 'tasks/spec_cat.rake'
@@ -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
@@ -5,7 +5,9 @@ module MeterCat
5
5
  include Singleton
6
6
 
7
7
  def initialize
8
- at_exit { MeterCat::Cache.instance.flush_all }
8
+ unless Rails.env.test?
9
+ at_exit { MeterCat::Cache.instance.flush_all }
10
+ end
9
11
  end
10
12
 
11
13
  # Adds the given value to the hash
@@ -1,3 +1,3 @@
1
1
  module MeterCat
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -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: 20130905081928) do
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
Binary file