active-profiling 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ doc/
12
12
  *.rbc
13
13
  .rbx
14
14
  Gemfile.lock
15
+ Gemfile.local
data/Gemfile CHANGED
@@ -2,3 +2,11 @@
2
2
  source "http://rubygems.org"
3
3
 
4
4
  gemspec
5
+
6
+ gem "rdoc", "~> 3.12"
7
+ gem "rake", "~> 10.0"
8
+
9
+ if File.exists?('Gemfile.local')
10
+ instance_eval File.read('Gemfile.local')
11
+ end
12
+
data/README.rdoc CHANGED
@@ -90,19 +90,24 @@ ignore it with your SCM.
90
90
  In +application_local.rb+, you can set up additional application settings
91
91
  like so:
92
92
 
93
+ # You can now flip this line on and off to enable or disable
94
+ # ActiveProfiling.
93
95
  Bundler.require(:profiling, Rails.env) if defined?(Bundler)
94
96
 
95
97
  module FooBarApp
96
98
  class Application < Rails::Application
97
99
  # config.log_level = :debug
98
- config.active_profiling.profiler.enabled = false
99
- config.active_profiling.profiler.output = :file
100
- config.active_profiling.profiler.printer = :graph_html
101
- config.active_profiling.profiler.printer_options = {
102
- :min_percent => 1,
103
- :print_file => true
104
- }
105
- config.active_profiling.gc_statistics.enabled = true
100
+
101
+ if defined?(ActiveProfiling)
102
+ config.active_profiling.profiler.enabled = false
103
+ config.active_profiling.profiler.output = :file
104
+ config.active_profiling.profiler.printer = :graph_html
105
+ config.active_profiling.profiler.printer_options = {
106
+ :min_percent => 1,
107
+ :print_file => true
108
+ }
109
+ config.active_profiling.gc_statistics.enabled = true
110
+ end
106
111
 
107
112
  # etc...
108
113
  end
data/Rakefile CHANGED
@@ -2,23 +2,12 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'rubygems'
5
-
6
- gem 'rdoc', '~> 3.12'
7
-
8
5
  require 'rubygems/package_task'
9
6
  require 'rake/testtask'
10
7
  require 'rdoc/task'
11
8
  require 'bundler/gem_tasks'
12
9
 
13
- if RUBY_VERSION >= '1.9'
14
- begin
15
- gem 'psych'
16
- rescue Exception => e
17
- # it's okay, fall back on the bundled psych
18
- end
19
- end
20
-
21
- $:.push 'lib'
10
+ $:.push File.expand_path(File.dirname(__FILE__), 'lib')
22
11
 
23
12
  version = ActiveProfiling::VERSION
24
13
 
@@ -21,7 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.require_paths = ["lib"]
22
22
 
23
23
  s.add_dependency("rails", [">= 3.0"])
24
- s.add_dependency("rdoc")
25
- s.add_dependency("rake", ["~> 0.9"])
26
24
  end
27
25
 
@@ -6,10 +6,11 @@ module ActiveProfiling
6
6
  logger.send("#{config.profiler.log_level}?")
7
7
 
8
8
  report = self.indent(event.payload[:profiler_output])
9
+ title = event.payload[:title]
9
10
 
10
11
  logger.send(
11
12
  config.profiler.log_level,
12
- "#{color("Profiler Output", YELLOW, true)}\n#{report}"
13
+ "#{color("Profiler Output: #{title}", YELLOW, true)}\n#{report}"
13
14
  )
14
15
  end
15
16
 
@@ -49,7 +49,8 @@ module ActiveProfiling
49
49
  str.rewind
50
50
 
51
51
  ActiveSupport::Notifications.instrument('profiler_output.active_profiling', {
52
- :profiler_output => str.read
52
+ :profiler_output => str.read,
53
+ :title => options[:title] || args.first
53
54
  })
54
55
  when :file
55
56
  path, file_name = if args.first
@@ -1,4 +1,4 @@
1
1
 
2
2
  module ActiveProfiling
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
metadata CHANGED
@@ -1,64 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-profiling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
4
  prerelease:
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - J Smith
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-18 00:00:00.000000000 Z
12
+ date: 2012-12-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
22
- type: :runtime
23
- prerelease: false
24
15
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
16
  requirements:
27
17
  - - ! '>='
28
18
  - !ruby/object:Gem::Version
29
19
  version: '3.0'
30
- - !ruby/object:Gem::Dependency
31
- name: rdoc
32
- requirement: !ruby/object:Gem::Requirement
33
20
  none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
21
+ name: rails
38
22
  type: :runtime
39
23
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: rake
48
24
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
25
  requirements:
51
- - - ~>
26
+ - - ! '>='
52
27
  - !ruby/object:Gem::Version
53
- version: '0.9'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
28
+ version: '3.0'
57
29
  none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '0.9'
62
30
  description: A Rails profiling suite.
63
31
  email: dark.panda@gmail.com
64
32
  executables: []
@@ -86,17 +54,17 @@ rdoc_options: []
86
54
  require_paths:
87
55
  - lib
88
56
  required_ruby_version: !ruby/object:Gem::Requirement
89
- none: false
90
57
  requirements:
91
58
  - - ! '>='
92
59
  - !ruby/object:Gem::Version
93
60
  version: '0'
94
- required_rubygems_version: !ruby/object:Gem::Requirement
95
61
  none: false
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
63
  requirements:
97
64
  - - ! '>='
98
65
  - !ruby/object:Gem::Version
99
66
  version: '0'
67
+ none: false
100
68
  requirements: []
101
69
  rubyforge_project:
102
70
  rubygems_version: 1.8.23