rails-analytics 0.0.1 → 0.0.3
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 +4 -4
- data/README.md +2 -2
- data/lib/rails/analytics.rb +4 -1
- data/lib/rails/analytics/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a9c2fc1f7057892f7818e6fdb399c800c93e8df
|
4
|
+
data.tar.gz: 8726d8163e7b45aab3d613507c44d06ccaad1ab4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bda2518ac5852531601587e50083a616f53458e00ff5e88f00a5d24686829c468a6ba2e59b6e7ee0526e28e183efc1ee3d5575d53cd4bc258970fdae62af95d
|
7
|
+
data.tar.gz: c9ff7949fd448637c52757a421d298cdb14e51d6967588f31bbb2e44a27c5e47171cb190ed4b5ff8ed7183779676851e3c32c16d489be6bc92099c4b53c72ef2
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rails::Analytics
|
2
2
|
|
3
|
-
|
3
|
+
Basic analytics gem for Rails
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
If you want to keep track of events in your Rails app
|
22
22
|
|
23
23
|
## Contributing
|
24
24
|
|
data/lib/rails/analytics.rb
CHANGED
@@ -5,6 +5,9 @@ module Rails
|
|
5
5
|
# namespace our plugin and inherit from Rails::Railtie
|
6
6
|
# to get our plugin into the initialization process
|
7
7
|
class Railtie < Rails::Railtie
|
8
|
+
def colorize(text, color_code)
|
9
|
+
"\e[#{color_code}m#{text}\e[0m"
|
10
|
+
end
|
8
11
|
|
9
12
|
# configure our plugin on boot. other extension points such
|
10
13
|
# as configuration, rake tasks, etc, are also available
|
@@ -13,7 +16,7 @@ module Rails
|
|
13
16
|
# subscribe to all rails notifications: controllers, AR, etc.
|
14
17
|
ActiveSupport::Notifications.subscribe do |*args|
|
15
18
|
event = ActiveSupport::Notifications::Event.new(*args)
|
16
|
-
puts "Got notification: #{event.inspect}"
|
19
|
+
puts "Got notification: #{colorize(event.inspect, 32)}"
|
17
20
|
end
|
18
21
|
|
19
22
|
end
|