fiveruns_tuneup 0.8.10 → 0.8.11

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/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.8.11. Signup and login for the TuneUp hosted service is now only required if the user wants to share a run (privately or publicly).
2
+
1
3
  v0.8.10. Fixed TextMate links to be xhtml strict 1.0 compliant.
2
4
 
3
5
  v0.8.9. Fixed broken rendering of TuneUp stack information when serving xhtml strict pages with a content-type of application/xhtml+xml.
data/Manifest CHANGED
@@ -28,6 +28,7 @@ lib/fiveruns/tuneup/custom_methods.rb
28
28
  lib/fiveruns/tuneup/environment.rb
29
29
  lib/fiveruns/tuneup/instrumentation/action_controller/base.rb
30
30
  lib/fiveruns/tuneup/instrumentation/action_view/base.rb
31
+ lib/fiveruns/tuneup/instrumentation/action_view/partial_template.rb
31
32
  lib/fiveruns/tuneup/instrumentation/active_record/base.rb
32
33
  lib/fiveruns/tuneup/instrumentation/cgi/session.rb
33
34
  lib/fiveruns/tuneup/instrumentation/utilities.rb
@@ -56,6 +57,6 @@ views/tuneup/_link.html.erb
56
57
  views/tuneup/_schema.html.erb
57
58
  views/tuneup/_sql.html.erb
58
59
  views/tuneup/_step.html.erb
59
- views/tuneup/panel/_registered.html.erb
60
- views/tuneup/panel/_unregistered.html.erb
60
+ views/tuneup/panel/_register.html.erb
61
+ views/tuneup/panel/_show.html.erb
61
62
  views/tuneup/sandbox.html.erb
@@ -70,6 +70,7 @@ version: 2.5.1
70
70
  #tuneup #tuneup-data { position: relative;}
71
71
  #tuneup #tuneup-top { position: absolute; top: 0px; right: 10px; padding: 0; margin: 0 0 0 150px; z-index: 11000; }
72
72
  #tuneup #tuneup-top #tuneup-save-link { float: right; line-height: 45px; vertical-align: bottom; text-align: center; font-weight: bold; padding: 0 9px 0 20px; background: url(/images/tuneup/pointer.gif) 0 50% no-repeat; }
73
+ #tuneup #tuneup-back-to-run-link { float: right; line-height: 15px; vertical-align: bottom; text-align: center; padding: 8px; background-color: #333; -moz-border-radius: 5px; margin: 7px 10px 0px 0px; border: 1px solid black;}
73
74
  #tuneup #tuneup-summary {float: right; padding: 9px; width: 400px; padding-bottom: 17px; margin-top: 3px; text-align: center; color: #ddd; -moz-border-radius: 6px 6px 0 0; }
74
75
 
75
76
  #tuneup #tuneup-data:hover #tuneup-summary { /* h */
@@ -1,22 +1,22 @@
1
1
 
2
- # Gem::Specification for Fiveruns_tuneup-0.8.10
2
+ # Gem::Specification for Fiveruns_tuneup-0.8.11
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{fiveruns_tuneup}
7
- s.version = "0.8.10"
7
+ s.version = "0.8.11"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["FiveRuns Development Team"]
13
- s.date = %q{2008-07-02}
13
+ s.date = %q{2008-07-10}
14
14
  s.default_executable = %q{fiveruns_tuneup}
15
15
  s.description = %q{Instrumentation for the FiveRuns TuneUp product.}
16
16
  s.email = %q{dev@fiveruns.com}
17
17
  s.executables = ["fiveruns_tuneup"]
18
- s.extra_rdoc_files = ["bin/fiveruns_tuneup", "CHANGELOG", "lib/bumpspark_helper.rb", "lib/fiveruns/tuneup/asset_tags.rb", "lib/fiveruns/tuneup/configuration.rb", "lib/fiveruns/tuneup/custom_methods.rb", "lib/fiveruns/tuneup/environment.rb", "lib/fiveruns/tuneup/instrumentation/action_controller/base.rb", "lib/fiveruns/tuneup/instrumentation/action_view/base.rb", "lib/fiveruns/tuneup/instrumentation/active_record/base.rb", "lib/fiveruns/tuneup/instrumentation/cgi/session.rb", "lib/fiveruns/tuneup/instrumentation/utilities.rb", "lib/fiveruns/tuneup/multipart.rb", "lib/fiveruns/tuneup/runs.rb", "lib/fiveruns/tuneup/schema.rb", "lib/fiveruns/tuneup/step.rb", "lib/fiveruns/tuneup/urls.rb", "lib/fiveruns/tuneup/version.rb", "lib/fiveruns/tuneup.rb", "lib/fiveruns_tuneup.rb", "lib/tuneup_config.rb", "lib/tuneup_controller.rb", "lib/tuneup_helper.rb", "README.rdoc", "tasks/assets.rake"]
19
- s.files = ["assets/images/arrows.gif", "assets/images/edit.png", "assets/images/fade.png", "assets/images/fade_down.png", "assets/images/head.gif", "assets/images/logo.gif", "assets/images/logo_clear.png", "assets/images/magnify.png", "assets/images/pip.gif", "assets/images/pointer.gif", "assets/images/schema.png", "assets/images/signin.gif", "assets/images/spinner.gif", "assets/images/warning.gif", "assets/javascripts/init.js", "assets/javascripts/prototype.js", "assets/javascripts/tuneup.js", "assets/stylesheets/tuneup.css", "bin/fiveruns_tuneup", "CHANGELOG", "CONTRIBUTORS", "init.rb", "install.rb", "lib/bumpspark_helper.rb", "lib/fiveruns/tuneup/asset_tags.rb", "lib/fiveruns/tuneup/configuration.rb", "lib/fiveruns/tuneup/custom_methods.rb", "lib/fiveruns/tuneup/environment.rb", "lib/fiveruns/tuneup/instrumentation/action_controller/base.rb", "lib/fiveruns/tuneup/instrumentation/action_view/base.rb", "lib/fiveruns/tuneup/instrumentation/active_record/base.rb", "lib/fiveruns/tuneup/instrumentation/cgi/session.rb", "lib/fiveruns/tuneup/instrumentation/utilities.rb", "lib/fiveruns/tuneup/multipart.rb", "lib/fiveruns/tuneup/runs.rb", "lib/fiveruns/tuneup/schema.rb", "lib/fiveruns/tuneup/step.rb", "lib/fiveruns/tuneup/urls.rb", "lib/fiveruns/tuneup/version.rb", "lib/fiveruns/tuneup.rb", "lib/fiveruns_tuneup.rb", "lib/tuneup_config.rb", "lib/tuneup_controller.rb", "lib/tuneup_helper.rb", "Manifest", "rails/init.rb", "Rakefile", "README.rdoc", "tasks/assets.rake", "test/test_helper.rb", "test/tuneup_test.rb", "uninstall.rb", "views/tuneup/_data.html.erb", "views/tuneup/_flash.html.erb", "views/tuneup/_link.html.erb", "views/tuneup/_schema.html.erb", "views/tuneup/_sql.html.erb", "views/tuneup/_step.html.erb", "views/tuneup/panel/_registered.html.erb", "views/tuneup/panel/_unregistered.html.erb", "views/tuneup/sandbox.html.erb", "fiveruns_tuneup.gemspec"]
18
+ s.extra_rdoc_files = ["bin/fiveruns_tuneup", "CHANGELOG", "lib/bumpspark_helper.rb", "lib/fiveruns/tuneup/asset_tags.rb", "lib/fiveruns/tuneup/configuration.rb", "lib/fiveruns/tuneup/custom_methods.rb", "lib/fiveruns/tuneup/environment.rb", "lib/fiveruns/tuneup/instrumentation/action_controller/base.rb", "lib/fiveruns/tuneup/instrumentation/action_view/base.rb", "lib/fiveruns/tuneup/instrumentation/action_view/partial_template.rb", "lib/fiveruns/tuneup/instrumentation/active_record/base.rb", "lib/fiveruns/tuneup/instrumentation/cgi/session.rb", "lib/fiveruns/tuneup/instrumentation/utilities.rb", "lib/fiveruns/tuneup/multipart.rb", "lib/fiveruns/tuneup/runs.rb", "lib/fiveruns/tuneup/schema.rb", "lib/fiveruns/tuneup/step.rb", "lib/fiveruns/tuneup/urls.rb", "lib/fiveruns/tuneup/version.rb", "lib/fiveruns/tuneup.rb", "lib/fiveruns_tuneup.rb", "lib/tuneup_config.rb", "lib/tuneup_controller.rb", "lib/tuneup_helper.rb", "README.rdoc", "tasks/assets.rake"]
19
+ s.files = ["assets/images/arrows.gif", "assets/images/edit.png", "assets/images/fade.png", "assets/images/fade_down.png", "assets/images/head.gif", "assets/images/logo.gif", "assets/images/logo_clear.png", "assets/images/magnify.png", "assets/images/pip.gif", "assets/images/pointer.gif", "assets/images/schema.png", "assets/images/signin.gif", "assets/images/spinner.gif", "assets/images/warning.gif", "assets/javascripts/init.js", "assets/javascripts/prototype.js", "assets/javascripts/tuneup.js", "assets/stylesheets/tuneup.css", "bin/fiveruns_tuneup", "CHANGELOG", "CONTRIBUTORS", "init.rb", "install.rb", "lib/bumpspark_helper.rb", "lib/fiveruns/tuneup/asset_tags.rb", "lib/fiveruns/tuneup/configuration.rb", "lib/fiveruns/tuneup/custom_methods.rb", "lib/fiveruns/tuneup/environment.rb", "lib/fiveruns/tuneup/instrumentation/action_controller/base.rb", "lib/fiveruns/tuneup/instrumentation/action_view/base.rb", "lib/fiveruns/tuneup/instrumentation/action_view/partial_template.rb", "lib/fiveruns/tuneup/instrumentation/active_record/base.rb", "lib/fiveruns/tuneup/instrumentation/cgi/session.rb", "lib/fiveruns/tuneup/instrumentation/utilities.rb", "lib/fiveruns/tuneup/multipart.rb", "lib/fiveruns/tuneup/runs.rb", "lib/fiveruns/tuneup/schema.rb", "lib/fiveruns/tuneup/step.rb", "lib/fiveruns/tuneup/urls.rb", "lib/fiveruns/tuneup/version.rb", "lib/fiveruns/tuneup.rb", "lib/fiveruns_tuneup.rb", "lib/tuneup_config.rb", "lib/tuneup_controller.rb", "lib/tuneup_helper.rb", "Manifest", "rails/init.rb", "Rakefile", "README.rdoc", "tasks/assets.rake", "test/test_helper.rb", "test/tuneup_test.rb", "uninstall.rb", "views/tuneup/_data.html.erb", "views/tuneup/_flash.html.erb", "views/tuneup/_link.html.erb", "views/tuneup/_schema.html.erb", "views/tuneup/_sql.html.erb", "views/tuneup/_step.html.erb", "views/tuneup/panel/_register.html.erb", "views/tuneup/panel/_show.html.erb", "views/tuneup/sandbox.html.erb", "fiveruns_tuneup.gemspec"]
20
20
  s.has_rdoc = true
21
21
  s.homepage = %q{http://github.com/fiveruns/fiveruns_tuneup}
22
22
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Fiveruns_tuneup", "--main", "README.rdoc"]
@@ -55,13 +55,7 @@ module Fiveruns
55
55
  if options[:file]
56
56
  "Render #{options[:file]}"
57
57
  elsif options[:partial]
58
- # Pre-Rails 2.1, don't record this as it causes duplicate records
59
- if Fiveruns::Tuneup::Version.rails < Fiveruns::Tuneup::Version.new(2,1,0)
60
- record = false
61
- else
62
- # TODO: normalize this partial path
63
- "Render partial #{options[:partial]}"
64
- end
58
+ record = false
65
59
  elsif options[:inline]
66
60
  "Render inline"
67
61
  elsif options[:text]
@@ -0,0 +1,28 @@
1
+ module Fiveruns
2
+ module Tuneup
3
+ module Instrumentation
4
+ module ActionView
5
+ module PartialTemplate
6
+
7
+ def self.included(base)
8
+ Fiveruns::Tuneup.instrument base, InstanceMethods
9
+ end
10
+
11
+ def self.relevant?
12
+ Fiveruns::Tuneup::Version.rails < Fiveruns::Tuneup::Version.new(2,1,0) ? false : true
13
+ end
14
+
15
+ module InstanceMethods
16
+
17
+ def render_with_fiveruns_tuneup(*args, &block)
18
+ Fiveruns::Tuneup.step "Render partial #{path}", :view do
19
+ render_without_fiveruns_tuneup(*args, &block)
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -160,8 +160,11 @@ module Fiveruns
160
160
  Dir[File.join(instrumentation_path, '/*/**/*.rb')].each do |filename|
161
161
  constant_path = filename[(instrumentation_path.size + 1)..-4]
162
162
  constant_name = path_to_constant_name(constant_path)
163
- if (constant = constant_name.constantize rescue nil)
164
- instrumentation = "Fiveruns::Tuneup::Instrumentation::#{constant_name}".constantize
163
+
164
+ instrumentation = "Fiveruns::Tuneup::Instrumentation::#{constant_name}".constantize
165
+ next if instrumentation.respond_to?(:relevant?) && !instrumentation.relevant?
166
+
167
+ if (constant = constant_name.constantize rescue nil)
165
168
  constant.__send__(:include, instrumentation)
166
169
  else
167
170
  log :debug, "#{constant_name} not found; skipping instrumentation."
@@ -75,7 +75,7 @@ module Fiveruns
75
75
 
76
76
  MAJOR = 0
77
77
  MINOR = 8
78
- TINY = 10
78
+ TINY = 11
79
79
 
80
80
  # The current version as a Version instance
81
81
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -13,6 +13,7 @@ class TuneupController < ActionController::Base
13
13
  end
14
14
 
15
15
  def show
16
+ session['fiveruns_tuneup_last_uri'] = params[:uri]
16
17
  debug_rjs = response.template.debug_rjs
17
18
  response.template.debug_rjs = false
18
19
  ActionController::Base.silence do
@@ -29,6 +30,14 @@ class TuneupController < ActionController::Base
29
30
  redirect_to :action => 'show'
30
31
  end
31
32
 
33
+ def register
34
+ render(:update) do |p|
35
+ p['tuneup-panel'].hide
36
+ p.insert_html(:bottom, 'tuneup-content', :partial => 'tuneup/panel/register.html.erb')
37
+ end
38
+ end
39
+
40
+
32
41
  def signin
33
42
  if api_key = retrieve_api_key
34
43
  @config['api_key'] = api_key
@@ -36,7 +45,8 @@ class TuneupController < ActionController::Base
36
45
  end
37
46
  render :update do |page|
38
47
  if api_key
39
- page << tuneup_reload_panel
48
+ page.replace('tuneup-save-link', link_to_upload)
49
+ page << redisplay_last_run(false)
40
50
  else
41
51
  page << tuneup_show_flash(:error,
42
52
  :header => "TuneUp encountered an error",
@@ -93,7 +103,7 @@ class TuneupController < ActionController::Base
93
103
 
94
104
  def collect(state)
95
105
  Fiveruns::Tuneup.collecting = state
96
- render(:update) { |p| p['tuneup-panel'].replace(render(:partial => 'tuneup/panel/registered.html.erb')) }
106
+ render(:update) { |p| p['tuneup-panel'].replace(render(:partial => 'tuneup/panel/show.html.erb')) }
97
107
  end
98
108
 
99
109
  def find_config
data/lib/tuneup_helper.rb CHANGED
@@ -68,9 +68,23 @@ module TuneupHelper #:nodoc:
68
68
  end
69
69
 
70
70
  def link_to_upload
71
- %|<a onclick="new TuneUpSandbox.Ajax.Request('/tuneup/upload?uri=#{CGI.escape(params[:uri])}', {asynchronous:true, evalScripts:true, onComplete:function(request){ TuneUp.Spinner.stop(); TuneUpSandbox.$('tuneup-top').show();}, onLoading:function(request){TuneUpSandbox.$('tuneup-top').hide(); TuneUp.Spinner.start()}}); return false;" id="tuneup-save-link" href="#">Share this Run</a>|
71
+ if @config.state == :registered
72
+ %|<a onclick="new TuneUpSandbox.Ajax.Request('/tuneup/upload?uri=#{CGI.escape(session['fiveruns_tuneup_last_uri'])}', {asynchronous:true, evalScripts:true, onComplete:function(request){ TuneUp.Spinner.stop(); TuneUpSandbox.$('tuneup-top').show();}, onLoading:function(request){TuneUpSandbox.$('tuneup-top').hide(); TuneUp.Spinner.start()}}); return false;" id="tuneup-save-link" href="#">Share this Run</a>|
73
+ else
74
+ %|<a onclick="new TuneUpSandbox.Ajax.Request('/tuneup/register', {asynchronous:true, evalScripts:true}); return false;" id="tuneup-save-link" href="#">Login to Share this Run</a>|
75
+ end
76
+ end
77
+
78
+ def link_to_show
79
+ %|<a id="tuneup-back-to-run-link" onclick="#{redisplay_last_run} return false;" href="#">&lt;&lt;&lt; Back to Run</a>|
72
80
  end
73
81
 
82
+ def redisplay_last_run(namespaced=true)
83
+ namespace_js = lambda { |fun| namespaced ? "TuneUpSandbox.#{fun}" : fun }
84
+ "#{namespace_js['$']}('tuneup-panel').show(); #{namespace_js['$']}('tuneup-signin-form').remove();"
85
+ end
86
+
87
+
74
88
  def additional_step_links(step)
75
89
  returning '' do |text|
76
90
  text << sql_link(step) if step.sql
@@ -159,7 +173,7 @@ module TuneupHelper #:nodoc:
159
173
  def tuneup_reload_panel
160
174
  update_page do |page|
161
175
  page['tuneup-flash'].removeClassName('tuneup-show');
162
- page['tuneup-content'].replace_html(render(:partial => "tuneup/panel/#{@config.state}.html.erb"))
176
+ page['tuneup-content'].replace_html(render(:partial => "tuneup/panel/show.html.erb"))
163
177
  page << 'TuneUp.adjustAbsoluteElements(_document.body);'
164
178
  page << 'TuneUp.adjustFixedElements();'
165
179
  end
@@ -0,0 +1,14 @@
1
+ <form id='tuneup-signin-form' onsubmit="new TuneUpSandbox.Ajax.Request('/tuneup/signin', {asynchronous:true, evalScripts:true, onComplete:function(request){TuneUp.Spinner.stop()}, onLoading:function(request){TuneUp.Spinner.start()}, parameters:TuneUpSandbox.Form.serialize(this)}); return false;" method="post" action="/tuneup/signin">
2
+ <p class='tuneup-full'>
3
+ <%= link_to_show %>
4
+ <label for='email'>Email</label>
5
+ <%= text_field_tag :email, nil, :size => 20 %>
6
+
7
+ <label for='password'>Password</label>
8
+ <%= password_field_tag %>
9
+
10
+ <button><%= image_tag '/images/tuneup/signin.gif', :alt => 'Sign In' %></button>
11
+ or
12
+ <%= link_to "Sign Up for an Account", tuneup_signup_url, :target => '_blank' %>
13
+ </p>
14
+ </form>
@@ -1,4 +1,5 @@
1
1
  <div id='tuneup-panel'>
2
+ <% puts "blank data? #{tuneup_data.blank?} collecting? #{tuneup_collecting?}" %>
2
3
  <%= render(:partial => 'data.html.erb') if !tuneup_data.blank? && tuneup_collecting? %>
3
4
  <%= render :partial => 'link.html.erb' %>
4
5
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiveruns_tuneup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.10
4
+ version: 0.8.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - FiveRuns Development Team
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-02 00:00:00 -05:00
12
+ date: 2008-07-10 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -37,6 +37,7 @@ extra_rdoc_files:
37
37
  - lib/fiveruns/tuneup/environment.rb
38
38
  - lib/fiveruns/tuneup/instrumentation/action_controller/base.rb
39
39
  - lib/fiveruns/tuneup/instrumentation/action_view/base.rb
40
+ - lib/fiveruns/tuneup/instrumentation/action_view/partial_template.rb
40
41
  - lib/fiveruns/tuneup/instrumentation/active_record/base.rb
41
42
  - lib/fiveruns/tuneup/instrumentation/cgi/session.rb
42
43
  - lib/fiveruns/tuneup/instrumentation/utilities.rb
@@ -84,6 +85,7 @@ files:
84
85
  - lib/fiveruns/tuneup/environment.rb
85
86
  - lib/fiveruns/tuneup/instrumentation/action_controller/base.rb
86
87
  - lib/fiveruns/tuneup/instrumentation/action_view/base.rb
88
+ - lib/fiveruns/tuneup/instrumentation/action_view/partial_template.rb
87
89
  - lib/fiveruns/tuneup/instrumentation/active_record/base.rb
88
90
  - lib/fiveruns/tuneup/instrumentation/cgi/session.rb
89
91
  - lib/fiveruns/tuneup/instrumentation/utilities.rb
@@ -112,8 +114,8 @@ files:
112
114
  - views/tuneup/_schema.html.erb
113
115
  - views/tuneup/_sql.html.erb
114
116
  - views/tuneup/_step.html.erb
115
- - views/tuneup/panel/_registered.html.erb
116
- - views/tuneup/panel/_unregistered.html.erb
117
+ - views/tuneup/panel/_register.html.erb
118
+ - views/tuneup/panel/_show.html.erb
117
119
  - views/tuneup/sandbox.html.erb
118
120
  - fiveruns_tuneup.gemspec
119
121
  has_rdoc: true
@@ -1,13 +0,0 @@
1
- <form onsubmit="new TuneUpSandbox.Ajax.Request('/tuneup/signin', {asynchronous:true, evalScripts:true, onComplete:function(request){TuneUp.Spinner.stop()}, onLoading:function(request){TuneUp.Spinner.start()}, parameters:TuneUpSandbox.Form.serialize(this)}); return false;" method="post" action="/tuneup/signin">
2
- <p class='tuneup-full'>
3
- <label for='email'>Email</label>
4
- <%= text_field_tag :email, nil, :size => 20 %>
5
-
6
- <label for='password'>Password</label>
7
- <%= password_field_tag %>
8
-
9
- <button><%= image_tag '/images/tuneup/signin.gif', :alt => 'Sign In' %></button>
10
- or
11
- <%= link_to "Sign Up for an Account", tuneup_signup_url %>
12
- </p>
13
- </form>