tronprint 0.0.2 → 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.
data/README.rdoc CHANGED
@@ -1,9 +1,97 @@
1
- = tronprint
1
+ = Tronprint
2
2
 
3
- Description goes here.
3
+ "The Grid: a digital frontier. I tried to picture clusters of information
4
+ as they moved through the computer. Ships, motorcycles... Were the circuits
5
+ like freeways? I kept dreaming of a world I'd never see. And then, one day,
6
+ I got in!"
7
+
8
+ -Floyd
9
+
10
+ Tronprint helps you visualize the carbon footprint of all of those little
11
+ Ruby processes zooming around on your system in their light cycles. You
12
+ can then show this footprint to the world of the Users via Rails helpers.
13
+
14
+ The emission estimates are calculated using {CM1}[http://carbon.brighterplanet.com],
15
+ {Brighter Planet's}[http://brighterplanet.com] carbon emissions calculation service.
16
+ Specifically, the {computation emitter}[http://carbon.brighterplanet.com/models/computation]
17
+ is used.
18
+
19
+ == Getting Started
20
+
21
+ If you haven't already, go to http://keys.brighterplanet.com and sign up for an
22
+ API key. Non-commercial use of CM1 is free, but commercial use is
23
+ {charged}[http://carbon.brighterplanet.com/pricing] per-query.
24
+
25
+ === Rails
26
+
27
+ Add tronprint to your Gemfile:
28
+
29
+ gem 'tronprint'
30
+
31
+ And install the gem from the command line:
32
+
33
+ bundle update
34
+
35
+ Once you start your Rails app, Tronprint will automatically begin collecting
36
+ usage data. If you have multiple Rails processes running, Tronprint will
37
+ keep track of aggregate statistics for all processes. This is where
38
+ Tronprint.application_name comes into play. By default, your application's
39
+ directory name is used.
40
+
41
+ In order to display your application's footprint, you can use Tronprint's
42
+ built-in view helper: TronprintHelper. Feel free to cache your footprint
43
+ to minimize the number of API requests made to CM1.
44
+
45
+ ==== Heroku
46
+
47
+ The easiest way to get started on Heroku is to sign up for a free MongoHQ
48
+ account to be used for the Tronprint::Aggregator. Since Heroku doesn't
49
+ allow access to the filesystem, Tronprint::Aggregator's default YAML
50
+ storage option will not work. Once you have MongoDB set up, change
51
+ config/tronprint.yml to:
52
+
53
+ ---
54
+ :aggregator_options:
55
+ :adapter: :mongodb
56
+ :host: example.mongohq.com
57
+ :port: 1234
58
+ :db: tronprint
59
+ :collection: tronprint
60
+ :application_name: my_app
61
+
62
+ === Other Ruby Apps
63
+
64
+ Tronprint will work with any Ruby app, but you have to do a little self-configuration.
65
+
66
+ When your application has started, all you have to do is make a call to
67
+ Tronprint.run. This starts up a thread that collects statistics at a
68
+ certain interval and stores the results in a key/value store.
69
+
70
+ To retrieve the footprint, make a call to Tronprint.emission_estimate. This
71
+ returns an instance of {Carbon::EmissionEstimate}[https://github.com/brighterplanet/carbon/blob/master/lib/carbon/emission_estimate.rb].
72
+ It can be converted to a float for the amount in kilograms or other
73
+ methods, such as EmissionEstimate#methodology can provide a link to the
74
+ methodology statement used to derive the estimate.
75
+
76
+ === Aggregator Configuration Notes
77
+
78
+ If you want to hide your aggregator configuration, you can leave the :aggregator_options
79
+ item blank in config/tronprint.yml. In your application, manually set
80
+ Tronprint.aggregator_options to the values you desire.
81
+
82
+ == Configuration
83
+
84
+ There are several properties of Tronprint that can be configured. The configuration
85
+ is persisted in `pwd`/config/tronprint.yml. Here is a list of options that
86
+ can be set:
87
+
88
+ :zip_code:: The ZIP code where the server or host computer resides.
89
+ :brighter_planet_key:: Your Brighter Planet CM1 key. Get one from {keys.brighterplanet.com}[http://keys.brighterplanet.com].
90
+ :application_name:: The name of your application.
91
+ :aggregator_options:: A hash of options to send to the aggregator. A sub-option of :adapter is required. This corresponds to the name of an adapter supported by {moneta}[http://github.com/wycats/moneta]. All other sub-options given are passed on to the moneta adapter's initializer.
4
92
 
5
93
  == Note on Patches/Pull Requests
6
-
94
+
7
95
  * Fork the project.
8
96
  * Make your feature addition or bug fix.
9
97
  * Add tests for it. This is important so I don't break it in a
@@ -14,4 +102,4 @@ Description goes here.
14
102
 
15
103
  == Copyright
16
104
 
17
- Copyright (c) 2010 Derek Kastner. See LICENSE for details.
105
+ Copyright © 2010 Brighter Planet. See LICENSE for details.
data/Rakefile CHANGED
@@ -2,26 +2,10 @@ require 'rubygems'
2
2
  require 'rake'
3
3
 
4
4
  begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = 'tronprint'
8
- gem.summary = 'Ruby process carbon footprinter'
9
- gem.description = 'A gem for monitoring the carbon footprint of your ruby app'
10
- gem.email = 'dkastner@gmail.com'
11
- gem.homepage = 'http://github.com/dkastner/tronprint'
12
- gem.authors = ['Derek Kastner']
13
- gem.add_development_dependency 'cucumber'
14
- gem.add_development_dependency 'jeweler', '~> 1.4.0'
15
- gem.add_development_dependency 'rake'
16
- gem.add_development_dependency 'rspec', '~>2.0'
17
- gem.add_development_dependency 'sandbox'
18
- gem.add_dependency 'carbon', '~> 1.0.3'
19
- gem.add_dependency 'i18n'
20
- gem.add_dependency 'moneta'
21
- end
22
- Jeweler::GemcutterTasks.new
5
+ require 'bueller'
6
+ Bueller::Tasks.new
23
7
  rescue LoadError
24
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
8
+ puts "Bueller (or a dependency) not available. Install it with: gem install bueller"
25
9
  end
26
10
 
27
11
  begin
@@ -42,8 +26,10 @@ require 'rake/rdoctask'
42
26
  Rake::RDocTask.new do |rdoc|
43
27
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
28
 
29
+ rdoc.main = 'README.rdoc'
45
30
  rdoc.rdoc_dir = 'rdoc'
46
31
  rdoc.title = "tronprint #{version}"
47
32
  rdoc.rdoc_files.include('README*')
33
+ rdoc.rdoc_files.include('LICENSE')
48
34
  rdoc.rdoc_files.include('lib/**/*.rb')
49
35
  end
@@ -2,38 +2,56 @@ require 'delegate'
2
2
  require 'moneta'
3
3
 
4
4
  module Tronprint
5
+
6
+ # Tronprint::Aggregator stores aggregate application statistics
7
+ # to some sort of persistent key/value store. By default, this
8
+ # is a YAML file, but any key/value store supported by
9
+ # {moneta}[http://github.com/wycats/moneta] will work.
5
10
  class Aggregator < Delegator
11
+
12
+ # Initialize the Aggregator with the following options:
13
+ # +adapter+:: The underscore-ized name of the moneta class to use.
14
+ #
15
+ # All other options are passed to the moneta adapter.
16
+ # You'll have to read {moneda's source code}[https://github.com/wycats/moneta/tree/master/lib/moneta/adapters]
17
+ # for options needed by your desired adapter.
6
18
  def initialize(options = {})
7
19
  adapter_underscored = options.delete :adapter
8
- adapter_underscored ||= :pstore
20
+ adapter_underscored ||= 'pstore'
21
+ adapter_underscored = adapter_underscored.to_s.downcase
9
22
  begin
10
- require "moneta/#{adapter_underscored.downcase}"
23
+ require "moneta/#{adapter_underscored}"
11
24
  klass = Moneta.const_get adapter_constant(adapter_underscored)
12
25
  rescue LoadError # Bundler hack
13
- require "moneta/adapters/#{adapter_underscored.downcase}"
26
+ require "moneta/adapters/#{adapter_underscored}"
14
27
  klass = Moneta::Adapters.const_get adapter_constant(adapter_underscored)
15
28
  end
16
- args = adapter_underscored == :memory ? [] : [options]
17
- super klass.new(*args)
29
+ args = adapter_underscored == 'memory' ? [] : [options]
30
+ instance = klass.new(*args)
31
+ __setobj__ instance # required in Ruby 1.8.7
32
+ super instance
18
33
  end
19
34
 
20
- def __getobj__
35
+ def __getobj__ # :nodoc:
21
36
  @delegate_sd_obj
22
37
  end
23
- def __setobj__(obj)
38
+ def __setobj__(obj) # :nodoc:
24
39
  @delegate_sd_obj = obj
25
40
  end
26
41
 
42
+ # The class name of the desired moneta adapter
27
43
  def adapter_constant(adapter_underscored)
28
- if adapter_underscored == :pstore
29
- 'PStore'
30
- elsif adapter_underscored == :yaml
31
- 'YAML'
44
+ case adapter_underscored
45
+ when 'pstore' then 'PStore'
46
+ when 'yaml' then 'YAML'
47
+ when 'mongodb' then 'MongoDB'
32
48
  else
33
- adapter_underscored.to_s.split('_').map(&:capitalize).join('')
49
+ adapter_underscored.split('_').map(&:capitalize).join('')
34
50
  end
35
51
  end
36
52
 
53
+ # Increment the total statistic by the given +value+,
54
+ # specified by the given +key+.
37
55
  def update(key, value)
38
56
  old_value = self[key]
39
57
  new_value = old_value ? old_value + value : value
@@ -1,6 +1,9 @@
1
1
  require 'carbon'
2
2
 
3
3
  module Tronprint
4
+
5
+ # Tronprint::Application is the class responsible for
6
+ # obtaining emission estimates from CM1.
4
7
  class Application
5
8
  include Carbon
6
9
 
@@ -11,12 +14,17 @@ module Tronprint
11
14
 
12
15
  attr_accessor :duration, :zip_code, :brighter_planet_key
13
16
 
17
+ # Initialize using Rails' model initializer style.
18
+ #
19
+ # Tronprint::Application.new :duration => 3.0
14
20
  def initialize(attrs = {})
15
21
  attrs.each do |name, value|
16
22
  self.send("#{name}=", value)
17
23
  end
18
24
  end
19
25
 
26
+ # The options accepted are those accepted by
27
+ # {Carbon::EmissionEstimate}[http://rdoc.info/github/brighterplanet/carbon/master/Carbon#emission_estimate-instance_method]
20
28
  def emission_estimate(options = {})
21
29
  super options.merge(:key => brighter_planet_key)
22
30
  end
@@ -1,11 +1,18 @@
1
1
  module Tronprint
2
+
3
+ # Tronprint::CPUMonitor is a thread that monitors aggregate CPU usage.
2
4
  class CPUMonitor < Thread
3
5
  attr_accessor :total_recorded_cpu_time, :aggregator, :application_name
4
6
 
7
+ # Parameters:
8
+ # +aggregator+:: A Tronprint::Aggregator instance.
9
+ # +application_name+:: A unique application name.
10
+ # +options+:: Extra options, such as:
11
+ # --+run+:: Whether to fork the thread and run continuously. +true+ by default.
5
12
  def initialize(aggregator, application_name, options = {})
6
13
  self.aggregator = aggregator
7
14
  self.application_name = application_name
8
- options[:run] ||= true
15
+ options[:run] = true if options[:run].nil?
9
16
  if options[:run]
10
17
  super do
11
18
  while(true) do
@@ -13,27 +20,35 @@ module Tronprint
13
20
  sleep(5)
14
21
  end
15
22
  end
23
+ else
24
+ super() {} # Ruby 1.8 hack
16
25
  end
17
26
  end
18
27
 
28
+ # The key used to store CPU data in the Aggregator.
19
29
  def key
20
30
  [application_name, 'application', 'cpu_time'].join('/')
21
31
  end
22
32
 
33
+ # The process used to collect CPU uptime data and store it.
23
34
  def monitor
24
35
  elapsed_time = elapsed_cpu_time
25
36
  aggregator.update key, elapsed_time
26
37
  self.total_recorded_cpu_time += elapsed_time
27
38
  end
28
39
 
40
+ # The total amount of CPU time used by the current process
41
+ # since the time the process started.
29
42
  def total_cpu_time
30
43
  Process.times.inject(0) { |sum, i| sum += i }
31
44
  end
32
45
 
46
+ # The total amount of CPU time we've recorded for the application.
33
47
  def total_recorded_cpu_time
34
48
  @total_recorded_cpu_time ||= 0.0
35
49
  end
36
50
 
51
+ # The amount of CPU time consumed since the last time we checked.
37
52
  def elapsed_cpu_time
38
53
  total_cpu_time - total_recorded_cpu_time
39
54
  end
@@ -1,5 +1,6 @@
1
1
  require 'rails/generators'
2
2
 
3
+ # Rails generator.
3
4
  class TronprintGenerator < Rails::Generators::Base
4
5
  def create_config_file
5
6
  create_file 'config/tronprint.yml', Tronprint.config.to_yaml
@@ -1,11 +1,17 @@
1
+ # Rails helper for displaying footprint data.
1
2
  module TronprintHelper
3
+
4
+ # The total amount of CO2e generated by the application.
2
5
  def total_footprint
3
6
  emission_estimate.to_f
4
7
  end
8
+ # A URL for the methodology statement of the emissions calculation.
5
9
  def footprint_methodology
6
10
  emission_estimate.methodology
7
11
  end
8
12
 
13
+ # The Carbon::EmissionEstimate object representing the
14
+ # estimate processed by CM1.
9
15
  def emission_estimate
10
16
  @emission_estimate ||= Tronprint.emission_estimate
11
17
  end
@@ -2,8 +2,10 @@ require 'rails'
2
2
  require 'tronprint/rails/tronprint_helper'
3
3
 
4
4
  module Tronprint
5
+
6
+ # Rails plugin class.
5
7
  class Railtie < Rails::Railtie
6
- initializer 'tronprint.run' do
8
+ config.after_initialize do
7
9
  Tronprint.run # if Rails.env.production?
8
10
  end
9
11
 
data/lib/tronprint.rb CHANGED
@@ -7,57 +7,98 @@ 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
+ # Tronprint helps you visualize the carbon footprint of all of those little
18
+ # Ruby processes zooming around on your system in their light cycles. You
19
+ # can then show this footprint to the world of the Users via Rails helpers.
20
+ #
21
+ # The Tronprint module itself provides a method, .emission_estimate, that
22
+ # will tell you the number of kilograms of CO2 (including the equivalent
23
+ # amount of CO2 representing other greenhouse gasses) the current ruby
24
+ # application is generating.
25
+ #
26
+ # The aggregate amount of CO2-generating activity is stored in a user-defined
27
+ # key/value store that will keep track of emissions for any application
28
+ # specified by Tronprint.application_name.
29
+ #
30
+ # == Getting Started
31
+ #
32
+ # See README.rdoc for more information.
10
33
  module Tronprint
11
34
  extend self
12
35
 
13
36
  attr_accessor :aggregator_options, :zip_code, :application_name, :brighter_planet_key
14
37
 
38
+ # Options to send the aggregator. See Tronprint::Aggregator.new
15
39
  def aggregator_options
16
40
  @aggregator_options ||= config[:aggregator_options]
17
41
  end
18
42
 
43
+ # The zip code of the server's hosting location. This affects
44
+ # the total footprint because certain regions rely more heavily
45
+ # on different sources of electricity.
19
46
  def zip_code
20
47
  @zip_code ||= config[:zip_code]
21
48
  end
22
49
 
50
+ # This is your Brighter Planet API key. Get one from
51
+ # {keys.brighterplanet.com}[http://keys.brighterplanet.com]
23
52
  def brighter_planet_key
24
53
  @brighter_planet_key ||= config[:brighter_planet_key]
25
54
  end
26
55
 
56
+ # The name of your application (used to group aggregate data).
57
+ def application_name
58
+ @application_name ||= config[:application_name]
59
+ end
60
+
61
+ # Run the footprinter by starting up a background thread which
62
+ # collects data.
27
63
  def run
28
64
  cpu_monitor
29
65
  end
30
66
 
67
+ # Check whether the data collection thread is running.
31
68
  def running?
32
69
  !@cpu_monitor.nil?
33
70
  end
34
71
 
72
+ # The Tronprint::Aggregator instance.
35
73
  def aggregator
36
74
  @aggregator ||= Aggregator.new aggregator_options
37
75
  end
38
76
 
77
+ # The Tronprint::CPUMonitor instance.
39
78
  def cpu_monitor
40
79
  @cpu_monitor ||= CPUMonitor.new aggregator, application_name
41
80
  end
42
81
 
43
- def application_name
44
- @application_name ||= config[:application_name]
45
- end
46
-
82
+ # Fetch the total amount of CPU time used by the application.
47
83
  def total_duration
48
84
  aggregator[cpu_monitor.key]
49
85
  end
50
86
 
87
+ # The current configuration.
51
88
  def config
52
89
  load_config || default_config
53
90
  end
54
91
 
92
+ # Fetch the configuration stored in config/tronprint.yml.
55
93
  def load_config
56
94
  return @loaded_config unless @loaded_config.nil?
57
95
  path = File.expand_path('config/tronprint.yml', Dir.pwd)
58
96
  @loaded_config = YAML::load_file path if File.exist? path
59
97
  end
60
98
 
99
+ # By default, the YAML adapter is used and aggregate statistics
100
+ # are stored in `pwd`/tronprint_stats.yml. The application name
101
+ # is assumed to be the name of the current directory.
61
102
  def default_config
62
103
  @default_config ||= {
63
104
  :aggregator_options => {
@@ -68,6 +109,9 @@ module Tronprint
68
109
  }
69
110
  end
70
111
 
112
+ # Calculate emissions using aggregated data. A call is made to
113
+ # Brighter Planet's CM1 emission estimate service. Specifically,
114
+ # the call is made to the {computation emitter}[http://carbon.brighterplanet.com/models/computation]
71
115
  def emission_estimate
72
116
  app = Application.new :zip_code => zip_code, :duration => total_duration,
73
117
  :brighter_planet_key => brighter_planet_key
@@ -10,7 +10,7 @@ describe TronprintHelper do
10
10
 
11
11
  describe '#total_footprint' do
12
12
  it 'should return the total footprint' do
13
- Tronprint.stub!(:footprint_amount).and_return 89.4
13
+ helper.stub!(:emission_estimate).and_return 89.4
14
14
  helper.total_footprint.should == 89.4
15
15
  end
16
16
  end
@@ -26,15 +26,6 @@ describe Tronprint do
26
26
  end
27
27
  end
28
28
 
29
- describe '.footprint_amount' do
30
- let(:estimate) { mock Object, :to_f => 100.1 }
31
-
32
- it 'should return the total footprint of the application' do
33
- Tronprint.stub!(:emission_estimate).and_return estimate
34
- Tronprint.footprint_amount.should == 100.1
35
- end
36
- end
37
-
38
29
  describe '.emission_estimate' do
39
30
  it 'should send the zip code and total duration to the application' do
40
31
  Tronprint.instance_variable_set(:@emission_estimate, nil)
@@ -84,7 +75,8 @@ describe Tronprint do
84
75
 
85
76
  describe '.total_duration' do
86
77
  it 'should look up the total for the application' do
87
- Tronprint.instance_variable_set :@cpu_monitor, nil
78
+ mock_cpu = mock Tronprint::CPUMonitor, :key => 'groove/application/cpu_time'
79
+ Tronprint.instance_variable_set :@cpu_monitor, mock_cpu
88
80
  Tronprint.application_name = 'groove'
89
81
  Tronprint.aggregator.update 'groove/application/cpu_time', 5.0
90
82
  Tronprint.total_duration.should == 5.0
data/tronprint.gemspec CHANGED
@@ -1,123 +1,40 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
5
2
 
6
3
  Gem::Specification.new do |s|
7
- s.name = %q{tronprint}
8
- s.version = "0.0.2"
4
+ s.name = 'tronprint'
5
+ s.version = "0.0.3"
9
6
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Derek Kastner"]
12
- s.date = %q{2011-01-12}
7
+ s.authors = ['Derek Kastner']
8
+ s.date = "2011-01-19"
13
9
  s.description = %q{A gem for monitoring the carbon footprint of your ruby app}
14
10
  s.email = %q{dkastner@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
11
+ s.homepage = %q{http://github.com/brighterplanet/tronprint}
12
+
13
+ s.files = Dir.glob('lib/**/*.rb') + [
14
+ '.document',
15
+ '.rspec',
16
+ 'Gemfile',
17
+ 'Rakefile',
18
+ 'tronprint.gemspec',
19
+ 'autotest/discover.rb'
18
20
  ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- "Gemfile",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "autotest/discover.rb",
28
- "features/step_definitions/tronprint_steps.rb",
29
- "features/support/env.rb",
30
- "features/tronprint.feature",
31
- "lib/tronprint.rb",
32
- "lib/tronprint/aggregator.rb",
33
- "lib/tronprint/application.rb",
34
- "lib/tronprint/cpu_monitor.rb",
35
- "lib/tronprint/rails.rb",
36
- "lib/tronprint/rails/generator.rb",
37
- "lib/tronprint/rails/tronprint_helper.rb",
38
- "spec/spec.opts",
39
- "spec/spec_helper.rb",
40
- "spec/tronprint/aggregator_spec.rb",
41
- "spec/tronprint/application_spec.rb",
42
- "spec/tronprint/computer_spec.rb",
43
- "spec/tronprint/cpu_monitor_spec.rb",
44
- "spec/tronprint/rails/tronprint_helper_spec.rb",
45
- "spec/tronprint_spec.rb",
46
- "tronprint.gemspec"
21
+ s.test_files = Dir.glob('spec/**/*') + Dir.glob('features/**/*')
22
+ s.extra_rdoc_files = [
23
+ 'LICENSE',
24
+ 'README.rdoc'
47
25
  ]
48
- s.homepage = %q{http://github.com/dkastner/tronprint}
49
- s.require_paths = ["lib"]
26
+
27
+ s.require_paths = ['lib']
50
28
  s.rubygems_version = %q{1.3.7}
51
29
  s.summary = %q{Ruby process carbon footprinter}
52
- s.test_files = [
53
- "spec/spec_helper.rb",
54
- "spec/tronprint/aggregator_spec.rb",
55
- "spec/tronprint/application_spec.rb",
56
- "spec/tronprint/computer_spec.rb",
57
- "spec/tronprint/cpu_monitor_spec.rb",
58
- "spec/tronprint/rails/tronprint_helper_spec.rb",
59
- "spec/tronprint_spec.rb"
60
- ]
61
-
62
- if s.respond_to? :specification_version then
63
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
64
- s.specification_version = 3
65
30
 
66
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
67
- s.add_runtime_dependency(%q<tronprint>, [">= 0"])
68
- s.add_runtime_dependency(%q<carbon>, ["~> 1.0.3"])
69
- s.add_runtime_dependency(%q<i18n>, [">= 0"])
70
- s.add_runtime_dependency(%q<moneta>, [">= 0"])
71
- s.add_development_dependency(%q<cucumber>, [">= 0"])
72
- s.add_development_dependency(%q<jeweler>, ["~> 1.4.0"])
73
- s.add_development_dependency(%q<rake>, [">= 0"])
74
- s.add_development_dependency(%q<rspec>, ["~> 2.0"])
75
- s.add_development_dependency(%q<sandbox>, [">= 0"])
76
- s.add_development_dependency(%q<cucumber>, [">= 0"])
77
- s.add_development_dependency(%q<jeweler>, ["~> 1.4.0"])
78
- s.add_development_dependency(%q<rake>, [">= 0"])
79
- s.add_development_dependency(%q<rspec>, ["~> 2.0"])
80
- s.add_development_dependency(%q<sandbox>, [">= 0"])
81
- s.add_runtime_dependency(%q<carbon>, ["~> 1.0.3"])
82
- s.add_runtime_dependency(%q<i18n>, [">= 0"])
83
- s.add_runtime_dependency(%q<moneta>, [">= 0"])
84
- else
85
- s.add_dependency(%q<tronprint>, [">= 0"])
86
- s.add_dependency(%q<carbon>, ["~> 1.0.3"])
87
- s.add_dependency(%q<i18n>, [">= 0"])
88
- s.add_dependency(%q<moneta>, [">= 0"])
89
- s.add_dependency(%q<cucumber>, [">= 0"])
90
- s.add_dependency(%q<jeweler>, ["~> 1.4.0"])
91
- s.add_dependency(%q<rake>, [">= 0"])
92
- s.add_dependency(%q<rspec>, ["~> 2.0"])
93
- s.add_dependency(%q<sandbox>, [">= 0"])
94
- s.add_dependency(%q<cucumber>, [">= 0"])
95
- s.add_dependency(%q<jeweler>, ["~> 1.4.0"])
96
- s.add_dependency(%q<rake>, [">= 0"])
97
- s.add_dependency(%q<rspec>, ["~> 2.0"])
98
- s.add_dependency(%q<sandbox>, [">= 0"])
99
- s.add_dependency(%q<carbon>, ["~> 1.0.3"])
100
- s.add_dependency(%q<i18n>, [">= 0"])
101
- s.add_dependency(%q<moneta>, [">= 0"])
102
- end
103
- else
104
- s.add_dependency(%q<tronprint>, [">= 0"])
105
- s.add_dependency(%q<carbon>, ["~> 1.0.3"])
106
- s.add_dependency(%q<i18n>, [">= 0"])
107
- s.add_dependency(%q<moneta>, [">= 0"])
108
- s.add_dependency(%q<cucumber>, [">= 0"])
109
- s.add_dependency(%q<jeweler>, ["~> 1.4.0"])
110
- s.add_dependency(%q<rake>, [">= 0"])
111
- s.add_dependency(%q<rspec>, ["~> 2.0"])
112
- s.add_dependency(%q<sandbox>, [">= 0"])
113
- s.add_dependency(%q<cucumber>, [">= 0"])
114
- s.add_dependency(%q<jeweler>, ["~> 1.4.0"])
115
- s.add_dependency(%q<rake>, [">= 0"])
116
- s.add_dependency(%q<rspec>, ["~> 2.0"])
117
- s.add_dependency(%q<sandbox>, [">= 0"])
118
- s.add_dependency(%q<carbon>, ["~> 1.0.3"])
119
- s.add_dependency(%q<i18n>, [">= 0"])
120
- s.add_dependency(%q<moneta>, [">= 0"])
121
- end
31
+ s.add_development_dependency 'cucumber'
32
+ s.add_development_dependency 'bueller', '~> 0.0.2'
33
+ s.add_development_dependency 'rake'
34
+ s.add_development_dependency 'rspec', '~> 2.0'
35
+ s.add_development_dependency 'sandbox'
36
+ s.add_runtime_dependency 'carbon', '~> 1.0.3'
37
+ s.add_runtime_dependency 'i18n'
38
+ s.add_runtime_dependency 'moneta'
122
39
  end
123
40
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Derek Kastner
@@ -14,11 +14,12 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-12 00:00:00 -05:00
17
+ date: 2011-01-19 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: tronprint
21
+ name: cucumber
22
+ prerelease: false
22
23
  requirement: &id001 !ruby/object:Gem::Requirement
23
24
  none: false
24
25
  requirements:
@@ -27,149 +28,27 @@ dependencies:
27
28
  segments:
28
29
  - 0
29
30
  version: "0"
30
- type: :runtime
31
- prerelease: false
31
+ type: :development
32
32
  version_requirements: *id001
33
33
  - !ruby/object:Gem::Dependency
34
- name: carbon
35
- requirement: &id002 !ruby/object:Gem::Requirement
36
- none: false
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 1
42
- - 0
43
- - 3
44
- version: 1.0.3
45
- type: :runtime
46
- prerelease: false
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: i18n
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 0
57
- version: "0"
58
- type: :runtime
59
- prerelease: false
60
- version_requirements: *id003
61
- - !ruby/object:Gem::Dependency
62
- name: moneta
63
- requirement: &id004 !ruby/object:Gem::Requirement
64
- none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
- version: "0"
71
- type: :runtime
34
+ name: bueller
72
35
  prerelease: false
73
- version_requirements: *id004
74
- - !ruby/object:Gem::Dependency
75
- name: cucumber
76
- requirement: &id005 !ruby/object:Gem::Requirement
77
- none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 0
83
- version: "0"
84
- type: :development
85
- prerelease: false
86
- version_requirements: *id005
87
- - !ruby/object:Gem::Dependency
88
- name: jeweler
89
- requirement: &id006 !ruby/object:Gem::Requirement
36
+ requirement: &id002 !ruby/object:Gem::Requirement
90
37
  none: false
91
38
  requirements:
92
39
  - - ~>
93
40
  - !ruby/object:Gem::Version
94
41
  segments:
95
- - 1
96
- - 4
97
42
  - 0
98
- version: 1.4.0
99
- type: :development
100
- prerelease: false
101
- version_requirements: *id006
102
- - !ruby/object:Gem::Dependency
103
- name: rake
104
- requirement: &id007 !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- segments:
110
43
  - 0
111
- version: "0"
112
- type: :development
113
- prerelease: false
114
- version_requirements: *id007
115
- - !ruby/object:Gem::Dependency
116
- name: rspec
117
- requirement: &id008 !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - ~>
121
- - !ruby/object:Gem::Version
122
- segments:
123
44
  - 2
124
- - 0
125
- version: "2.0"
45
+ version: 0.0.2
126
46
  type: :development
127
- prerelease: false
128
- version_requirements: *id008
129
- - !ruby/object:Gem::Dependency
130
- name: sandbox
131
- requirement: &id009 !ruby/object:Gem::Requirement
132
- none: false
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- segments:
137
- - 0
138
- version: "0"
139
- type: :development
140
- prerelease: false
141
- version_requirements: *id009
142
- - !ruby/object:Gem::Dependency
143
- name: cucumber
144
- requirement: &id010 !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- segments:
150
- - 0
151
- version: "0"
152
- type: :development
153
- prerelease: false
154
- version_requirements: *id010
155
- - !ruby/object:Gem::Dependency
156
- name: jeweler
157
- requirement: &id011 !ruby/object:Gem::Requirement
158
- none: false
159
- requirements:
160
- - - ~>
161
- - !ruby/object:Gem::Version
162
- segments:
163
- - 1
164
- - 4
165
- - 0
166
- version: 1.4.0
167
- type: :development
168
- prerelease: false
169
- version_requirements: *id011
47
+ version_requirements: *id002
170
48
  - !ruby/object:Gem::Dependency
171
49
  name: rake
172
- requirement: &id012 !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
173
52
  none: false
174
53
  requirements:
175
54
  - - ">="
@@ -178,11 +57,11 @@ dependencies:
178
57
  - 0
179
58
  version: "0"
180
59
  type: :development
181
- prerelease: false
182
- version_requirements: *id012
60
+ version_requirements: *id003
183
61
  - !ruby/object:Gem::Dependency
184
62
  name: rspec
185
- requirement: &id013 !ruby/object:Gem::Requirement
63
+ prerelease: false
64
+ requirement: &id004 !ruby/object:Gem::Requirement
186
65
  none: false
187
66
  requirements:
188
67
  - - ~>
@@ -192,11 +71,11 @@ dependencies:
192
71
  - 0
193
72
  version: "2.0"
194
73
  type: :development
195
- prerelease: false
196
- version_requirements: *id013
74
+ version_requirements: *id004
197
75
  - !ruby/object:Gem::Dependency
198
76
  name: sandbox
199
- requirement: &id014 !ruby/object:Gem::Requirement
77
+ prerelease: false
78
+ requirement: &id005 !ruby/object:Gem::Requirement
200
79
  none: false
201
80
  requirements:
202
81
  - - ">="
@@ -205,11 +84,11 @@ dependencies:
205
84
  - 0
206
85
  version: "0"
207
86
  type: :development
208
- prerelease: false
209
- version_requirements: *id014
87
+ version_requirements: *id005
210
88
  - !ruby/object:Gem::Dependency
211
89
  name: carbon
212
- requirement: &id015 !ruby/object:Gem::Requirement
90
+ prerelease: false
91
+ requirement: &id006 !ruby/object:Gem::Requirement
213
92
  none: false
214
93
  requirements:
215
94
  - - ~>
@@ -220,11 +99,11 @@ dependencies:
220
99
  - 3
221
100
  version: 1.0.3
222
101
  type: :runtime
223
- prerelease: false
224
- version_requirements: *id015
102
+ version_requirements: *id006
225
103
  - !ruby/object:Gem::Dependency
226
104
  name: i18n
227
- requirement: &id016 !ruby/object:Gem::Requirement
105
+ prerelease: false
106
+ requirement: &id007 !ruby/object:Gem::Requirement
228
107
  none: false
229
108
  requirements:
230
109
  - - ">="
@@ -233,11 +112,11 @@ dependencies:
233
112
  - 0
234
113
  version: "0"
235
114
  type: :runtime
236
- prerelease: false
237
- version_requirements: *id016
115
+ version_requirements: *id007
238
116
  - !ruby/object:Gem::Dependency
239
117
  name: moneta
240
- requirement: &id017 !ruby/object:Gem::Requirement
118
+ prerelease: false
119
+ requirement: &id008 !ruby/object:Gem::Requirement
241
120
  none: false
242
121
  requirements:
243
122
  - - ">="
@@ -246,8 +125,7 @@ dependencies:
246
125
  - 0
247
126
  version: "0"
248
127
  type: :runtime
249
- prerelease: false
250
- version_requirements: *id017
128
+ version_requirements: *id008
251
129
  description: A gem for monitoring the carbon footprint of your ruby app
252
130
  email: dkastner@gmail.com
253
131
  executables: []
@@ -258,35 +136,34 @@ extra_rdoc_files:
258
136
  - LICENSE
259
137
  - README.rdoc
260
138
  files:
139
+ - lib/tronprint/aggregator.rb
140
+ - lib/tronprint/rails/generator.rb
141
+ - lib/tronprint/rails/tronprint_helper.rb
142
+ - lib/tronprint/application.rb
143
+ - lib/tronprint/cpu_monitor.rb
144
+ - lib/tronprint/rails.rb
145
+ - lib/tronprint.rb
261
146
  - .document
262
147
  - .rspec
263
148
  - Gemfile
264
- - LICENSE
265
- - README.rdoc
266
149
  - Rakefile
267
- - VERSION
150
+ - tronprint.gemspec
268
151
  - autotest/discover.rb
269
- - features/step_definitions/tronprint_steps.rb
270
- - features/support/env.rb
271
- - features/tronprint.feature
272
- - lib/tronprint.rb
273
- - lib/tronprint/aggregator.rb
274
- - lib/tronprint/application.rb
275
- - lib/tronprint/cpu_monitor.rb
276
- - lib/tronprint/rails.rb
277
- - lib/tronprint/rails/generator.rb
278
- - lib/tronprint/rails/tronprint_helper.rb
279
- - spec/spec.opts
280
- - spec/spec_helper.rb
281
- - spec/tronprint/aggregator_spec.rb
152
+ - LICENSE
153
+ - README.rdoc
282
154
  - spec/tronprint/application_spec.rb
155
+ - spec/tronprint/rails/tronprint_helper_spec.rb
283
156
  - spec/tronprint/computer_spec.rb
157
+ - spec/tronprint/aggregator_spec.rb
284
158
  - spec/tronprint/cpu_monitor_spec.rb
285
- - spec/tronprint/rails/tronprint_helper_spec.rb
286
159
  - spec/tronprint_spec.rb
287
- - tronprint.gemspec
160
+ - spec/spec.opts
161
+ - spec/spec_helper.rb
162
+ - features/support/env.rb
163
+ - features/tronprint.feature
164
+ - features/step_definitions/tronprint_steps.rb
288
165
  has_rdoc: true
289
- homepage: http://github.com/dkastner/tronprint
166
+ homepage: http://github.com/brighterplanet/tronprint
290
167
  licenses: []
291
168
 
292
169
  post_install_message:
@@ -318,10 +195,14 @@ signing_key:
318
195
  specification_version: 3
319
196
  summary: Ruby process carbon footprinter
320
197
  test_files:
321
- - spec/spec_helper.rb
322
- - spec/tronprint/aggregator_spec.rb
323
198
  - spec/tronprint/application_spec.rb
199
+ - spec/tronprint/rails/tronprint_helper_spec.rb
324
200
  - spec/tronprint/computer_spec.rb
201
+ - spec/tronprint/aggregator_spec.rb
325
202
  - spec/tronprint/cpu_monitor_spec.rb
326
- - spec/tronprint/rails/tronprint_helper_spec.rb
327
203
  - spec/tronprint_spec.rb
204
+ - spec/spec.opts
205
+ - spec/spec_helper.rb
206
+ - features/support/env.rb
207
+ - features/tronprint.feature
208
+ - features/step_definitions/tronprint_steps.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.2