tronprint 0.0.15 → 0.0.16
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.
- data/README.rdoc +17 -0
- data/lib/tronprint/rake_tasks/active_record.rb +11 -0
- data/lib/tronprint/version.rb +1 -1
- data/lib/tronprint.rb +0 -7
- data/spec/tronprint_spec.rb +1 -1
- data/tronprint.gemspec +1 -1
- metadata +9 -6
data/README.rdoc
CHANGED
|
@@ -64,6 +64,23 @@ tronprint with a Rails initializer:
|
|
|
64
64
|
:collection => 'tronprint'
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
==== ActiveRecord
|
|
68
|
+
|
|
69
|
+
If you'd like to use your Rails app's existing ActiveRecord datastore for
|
|
70
|
+
storing Tronprint statistics, simply add the following to a new file,
|
|
71
|
+
config/initializers/tronprint.rb:
|
|
72
|
+
|
|
73
|
+
Tronprint.aggregator_options = { :adapter => :active_record }
|
|
74
|
+
|
|
75
|
+
Before you get started with Tronprint on ActiveRecord and you're using a
|
|
76
|
+
relational database, (e.g., mysql) then you need to create the table
|
|
77
|
+
Tronprint will use for storage. The easiest way to do this is add to
|
|
78
|
+
your Rakefile:
|
|
79
|
+
|
|
80
|
+
require 'tronprint/rake_tasks/active_record'
|
|
81
|
+
|
|
82
|
+
Then, run `rake tronprint:moneta`.
|
|
83
|
+
|
|
67
84
|
=== Other Ruby Apps
|
|
68
85
|
|
|
69
86
|
Tronprint will work with any Ruby app, but you have to do a little self-configuration.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
namespace :tronprint do
|
|
2
|
+
desc 'Set up ActiveRecord datastore for Tronprint'
|
|
3
|
+
task :moneta => :environment do
|
|
4
|
+
adapter_options = Tronprint.aggregator_options
|
|
5
|
+
ar = Moneta::Adapters::ActiveRecord.new
|
|
6
|
+
ar.migrate
|
|
7
|
+
puts 'Ensured that Moneta::Adapters::ActiveRecord::Store exists'
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
task 'db:migrate' => 'tronprint:moneta'
|
data/lib/tronprint/version.rb
CHANGED
data/lib/tronprint.rb
CHANGED
|
@@ -7,13 +7,6 @@ if defined?(Rails)
|
|
|
7
7
|
require 'tronprint/rails'
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
# "The Grid: A digital frontier. I tried to picture clusters of information
|
|
11
|
-
# as they moved through the computer. Ships, motorcycles... Were the circuits
|
|
12
|
-
# like freeways? I kept dreaming of a world I'd never see. And then, one day,
|
|
13
|
-
# I got in!"
|
|
14
|
-
#
|
|
15
|
-
# -Floyd
|
|
16
|
-
#
|
|
17
10
|
# Tronprint helps you visualize the carbon footprint of all of those little
|
|
18
11
|
# Ruby processes zooming around on your system in their light cycles. You
|
|
19
12
|
# can then show this footprint to the world of the Users via Rails helpers.
|
data/spec/tronprint_spec.rb
CHANGED
|
@@ -95,7 +95,7 @@ describe Tronprint do
|
|
|
95
95
|
it 'should use MongoHQ if ENV["MONGOHQ_URL"] is set' do
|
|
96
96
|
ENV['MONGOHQ_URL'] = 'mongodb://foo.com/bar'
|
|
97
97
|
Tronprint.default_config[:aggregator_options][:adapter].should == :mongodb
|
|
98
|
-
Tronprint.default_config[:aggregator_options][:
|
|
98
|
+
Tronprint.default_config[:aggregator_options][:uri].should == 'mongodb://foo.com/bar'
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
|
data/tronprint.gemspec
CHANGED
|
@@ -37,6 +37,6 @@ Gem::Specification.new do |s|
|
|
|
37
37
|
s.add_development_dependency 'sandbox'
|
|
38
38
|
s.add_runtime_dependency 'carbon', '~> 1.0.3'
|
|
39
39
|
s.add_runtime_dependency 'i18n'
|
|
40
|
-
s.add_runtime_dependency 'dkastner-moneta'
|
|
40
|
+
s.add_runtime_dependency 'dkastner-moneta', '~> 1.0.3'
|
|
41
41
|
end
|
|
42
42
|
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
version: 0.0.
|
|
8
|
+
- 16
|
|
9
|
+
version: 0.0.16
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Derek Kastner
|
|
@@ -118,11 +118,13 @@ dependencies:
|
|
|
118
118
|
requirement: &id008 !ruby/object:Gem::Requirement
|
|
119
119
|
none: false
|
|
120
120
|
requirements:
|
|
121
|
-
- -
|
|
121
|
+
- - ~>
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
123
|
segments:
|
|
124
|
+
- 1
|
|
124
125
|
- 0
|
|
125
|
-
|
|
126
|
+
- 3
|
|
127
|
+
version: 1.0.3
|
|
126
128
|
type: :runtime
|
|
127
129
|
prerelease: false
|
|
128
130
|
version_requirements: *id008
|
|
@@ -142,6 +144,7 @@ files:
|
|
|
142
144
|
- lib/tronprint/rails/generator.rb
|
|
143
145
|
- lib/tronprint/rails/tronprint_helper.rb
|
|
144
146
|
- lib/tronprint/rails.rb
|
|
147
|
+
- lib/tronprint/rake_tasks/active_record.rb
|
|
145
148
|
- lib/tronprint/version.rb
|
|
146
149
|
- lib/tronprint.rb
|
|
147
150
|
- .document
|
|
@@ -177,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
177
180
|
requirements:
|
|
178
181
|
- - ">="
|
|
179
182
|
- !ruby/object:Gem::Version
|
|
180
|
-
hash:
|
|
183
|
+
hash: 839406187484222147
|
|
181
184
|
segments:
|
|
182
185
|
- 0
|
|
183
186
|
version: "0"
|
|
@@ -186,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
186
189
|
requirements:
|
|
187
190
|
- - ">="
|
|
188
191
|
- !ruby/object:Gem::Version
|
|
189
|
-
hash:
|
|
192
|
+
hash: 839406187484222147
|
|
190
193
|
segments:
|
|
191
194
|
- 0
|
|
192
195
|
version: "0"
|