josevalim-rails-footnotes 3.4.1 → 3.5.0
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 +54 -0
- data/README +16 -8
- data/lib/rails-footnotes/footnotes.rb +7 -2
- data/lib/rails-footnotes/notes/controller_note.rb +3 -1
- data/lib/rails-footnotes/notes/rpm_note.rb +24 -0
- data/lib/rails-footnotes/notes/session_note.rb +2 -2
- data/lib/rails-footnotes/notes/view_note.rb +8 -2
- data/test/footnotes_test.rb +5 -5
- data/test/notes/abstract_note_test.rb +1 -1
- metadata +4 -5
data/CHANGELOG
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
== Footnotes v3.5
|
|
2
|
+
* Added NewRelic RPM footnote (cortesy of kbrock)
|
|
3
|
+
* Several bug fixes (cortesy of kbrock, ivanoats and kristopher)
|
|
4
|
+
|
|
5
|
+
== Footnotes v3.4
|
|
6
|
+
* Rails 2.3 compatible.
|
|
7
|
+
|
|
8
|
+
== Footnotes v3.3.1
|
|
9
|
+
* Changed prefix to support %s and %d;
|
|
10
|
+
* Created gemspec;
|
|
11
|
+
* Some code refactoring (called eval just once instead of three times).
|
|
12
|
+
|
|
13
|
+
== Footnotes v3.3
|
|
14
|
+
* Rails Edge (aka 2.2) compatibility;
|
|
15
|
+
* Initial Ruby 1.9 compatibility.
|
|
16
|
+
|
|
17
|
+
== Footnotes v3.2.2
|
|
18
|
+
* Added trace to QueriesNote;
|
|
19
|
+
* Fixed incompatibility with Ultrasphinx (thanks to mhartl);
|
|
20
|
+
* Added W3C compatibility (thanks to tapajos);
|
|
21
|
+
* Added support to other log mechanisms in LogNote.
|
|
22
|
+
|
|
23
|
+
== Footnotes v3.2.1
|
|
24
|
+
* Added some tests;
|
|
25
|
+
* Redefined Footnotes CSS and Javascripts to use concise names.
|
|
26
|
+
|
|
27
|
+
== Footnotes v3.2
|
|
28
|
+
* Now you can easily add your own notes;
|
|
29
|
+
* Added numbers to tabs;
|
|
30
|
+
* Added Queries note;
|
|
31
|
+
* Added MySQL Query Analyzer.
|
|
32
|
+
|
|
33
|
+
== Footnotes v3.1
|
|
34
|
+
* Code refactoring (using modules, except backtracer);
|
|
35
|
+
* Ability to cherry pick notes;
|
|
36
|
+
* Working on Rails 2.1.
|
|
37
|
+
|
|
38
|
+
== Footnotes v3.0
|
|
39
|
+
* Some code refactoring;
|
|
40
|
+
* Stylesheets bug fixed: was showing not only css in Stylesheets div;
|
|
41
|
+
* Logtail fix: working with Rails 2.0 logger and in all OS, since it's Regexp based;
|
|
42
|
+
* Rails 1.2 (except backtrace) and 2.0 compatible;
|
|
43
|
+
* RoutingNavigator (based on Rick Olson plugin);
|
|
44
|
+
* FilterChain.
|
|
45
|
+
|
|
46
|
+
== Textmate Footnotes v2.0
|
|
47
|
+
Copyright (c) 2006 InquiryLabs, Inc.
|
|
48
|
+
http://inquirylabs.com/
|
|
49
|
+
|
|
50
|
+
Description:
|
|
51
|
+
Creates clickable footnotes on each rendered page, as well as clickable
|
|
52
|
+
links in the backtrace should an error occur in your Rails app. Links take
|
|
53
|
+
you to the right place inside TextMate.
|
|
54
|
+
Enable only the TextMate on Macs in development mode
|
data/README
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Rails Footnotes
|
|
2
2
|
License: MIT
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5
|
|
4
4
|
|
|
5
5
|
You can also read this README in pretty html at the GitHub project Wiki page
|
|
6
6
|
|
|
7
|
-
http://github.com/josevalim/rails-footnotes
|
|
7
|
+
http://wiki.github.com/josevalim/rails-footnotes
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Description
|
|
@@ -46,6 +46,7 @@ If you are running on Rails 2.2 or Rails 2.1 you should do:
|
|
|
46
46
|
Where you should replace VERSION_NUMBER for "v3.3.2" for Rails 2.2 and "v3.2.2"
|
|
47
47
|
for Rails 2.1 (without the quotes).
|
|
48
48
|
|
|
49
|
+
|
|
49
50
|
Configuration
|
|
50
51
|
-------------
|
|
51
52
|
|
|
@@ -53,7 +54,7 @@ If you are not using Textmate as text editor, in your environment.rb or
|
|
|
53
54
|
in an initializer do:
|
|
54
55
|
|
|
55
56
|
if defined?(Footnotes)
|
|
56
|
-
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
|
57
|
+
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
|
57
58
|
end
|
|
58
59
|
|
|
59
60
|
Where you are going to choose a prefix compatible with your text editor. The %s is
|
|
@@ -127,21 +128,28 @@ Then put in your environment:
|
|
|
127
128
|
Footnotes::Filter.notes += [:current_user]
|
|
128
129
|
|
|
129
130
|
|
|
131
|
+
Colaborators
|
|
132
|
+
------------
|
|
133
|
+
|
|
134
|
+
* http://github.com/kbrock
|
|
135
|
+
* http://github.com/ivanoats
|
|
136
|
+
* http://github.com/kristopher
|
|
137
|
+
|
|
138
|
+
|
|
130
139
|
Bugs and Feedback
|
|
131
140
|
-----------------
|
|
132
141
|
|
|
133
142
|
If you discover any bugs, please send an e-mail to jose.valim@gmail.com
|
|
134
|
-
If you just want to give some positive feedback or drop a line, that's fine too!
|
|
143
|
+
If you just want to give some positive feedback or drop a line, that's fine too!
|
|
135
144
|
|
|
136
|
-
Copyright (c) 2009 José Valim
|
|
137
|
-
http://www.pagestacker.com/
|
|
145
|
+
Copyright (c) 2009 José Valim (jose.valim@gmail.com)
|
|
138
146
|
http://josevalim.blogspot.com/
|
|
139
147
|
|
|
140
148
|
|
|
141
149
|
Version 2.0
|
|
142
150
|
-----------
|
|
143
151
|
|
|
144
|
-
Until version 2.0, this plugin was created and maintained by:
|
|
152
|
+
Until version 2.0, this plugin was created and maintained by Duane Johnson:
|
|
145
153
|
|
|
146
|
-
|
|
154
|
+
Copyright (c) 2006 InquiryLabs, Inc.
|
|
147
155
|
http://blog.inquirylabs.com/
|
|
@@ -5,12 +5,17 @@ module Footnotes
|
|
|
5
5
|
@@klasses = []
|
|
6
6
|
|
|
7
7
|
# Default link prefix is textmate
|
|
8
|
-
@@prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
|
8
|
+
@@prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
|
9
9
|
|
|
10
10
|
# Edit notes
|
|
11
11
|
@@notes = [ :controller, :view, :layout, :stylesheets, :javascripts ]
|
|
12
12
|
# Show notes
|
|
13
|
-
@@notes += [ :session, :cookies, :params, :filters, :routes, :env, :
|
|
13
|
+
@@notes += [ :session, :cookies, :params, :filters, :routes, :env, :log, :general ]
|
|
14
|
+
if defined?(NewRelic)
|
|
15
|
+
@@notes << :rpm
|
|
16
|
+
else
|
|
17
|
+
@@notes << :queries
|
|
18
|
+
end
|
|
14
19
|
|
|
15
20
|
# :no_style => If you don't want the style to be appended to your pages
|
|
16
21
|
# :notes => Class variable that holds the notes to be processed
|
|
@@ -23,7 +23,9 @@ module Footnotes
|
|
|
23
23
|
# Some controller classes come with the Controller:: module and some don't
|
|
24
24
|
# (anyone know why? -- Duane)
|
|
25
25
|
def controller_filename
|
|
26
|
-
|
|
26
|
+
controller_name=@controller.class.to_s.underscore
|
|
27
|
+
controller_name='application' if controller_name=='application_controller'
|
|
28
|
+
File.join(File.expand_path(RAILS_ROOT), 'app', 'controllers', "#{controller_name}.rb").sub('/controllers/controllers/', '/controllers/')
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
def controller_text
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require "#{File.dirname(__FILE__)}/abstract_note"
|
|
2
|
+
|
|
3
|
+
module Footnotes
|
|
4
|
+
module Notes
|
|
5
|
+
class RpmNote < AbstractNote
|
|
6
|
+
def initialize(controller)
|
|
7
|
+
@rpm_id=NewRelic::Agent.instance.transaction_sampler.current_sample_id
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def row
|
|
11
|
+
:edit
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def link
|
|
15
|
+
#{:controller => 'newrelic', :action => 'show_sample_detail', :id => @rpm_id}
|
|
16
|
+
"/newrelic/show_sample_detail/#{@rpm_id}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def valid?
|
|
20
|
+
!NewRelic::Config.instance['skip_developer_route']
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -4,7 +4,7 @@ module Footnotes
|
|
|
4
4
|
module Notes
|
|
5
5
|
class SessionNote < AbstractNote
|
|
6
6
|
def initialize(controller)
|
|
7
|
-
@session = (controller.session
|
|
7
|
+
@session = (controller.session || {}).symbolize_keys
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def content
|
|
@@ -12,4 +12,4 @@ module Footnotes
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
|
-
end
|
|
15
|
+
end
|
|
@@ -17,13 +17,19 @@ module Footnotes
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def valid?
|
|
20
|
-
prefix? &&
|
|
20
|
+
prefix? && first_render?
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
protected
|
|
24
|
+
|
|
25
|
+
def first_render?
|
|
26
|
+
@template.instance_variable_get(:@_first_render)
|
|
27
|
+
end
|
|
28
|
+
|
|
24
29
|
def filename
|
|
25
|
-
@template.
|
|
30
|
+
@filename ||= @template.instance_variable_get(:@_first_render).filename
|
|
26
31
|
end
|
|
32
|
+
|
|
27
33
|
end
|
|
28
34
|
end
|
|
29
35
|
end
|
data/test/footnotes_test.rb
CHANGED
|
@@ -70,11 +70,11 @@ class FootnotesTest < Test::Unit::TestCase
|
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def test_footnotes_prefix
|
|
73
|
-
assert_equal 'txmt://open?url=file://%s&line=%d&column=%d', Footnotes::Filter.prefix
|
|
74
|
-
assert_equal 'txmt://open?url=file://file&line=0&column=0', Footnotes::Filter.prefix('file', 0, 0)
|
|
75
|
-
assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', 10, 10)
|
|
76
|
-
assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', 10, 10, 10)
|
|
77
|
-
assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', '10', '10')
|
|
73
|
+
assert_equal 'txmt://open?url=file://%s&line=%d&column=%d', Footnotes::Filter.prefix
|
|
74
|
+
assert_equal 'txmt://open?url=file://file&line=0&column=0', Footnotes::Filter.prefix('file', 0, 0)
|
|
75
|
+
assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', 10, 10)
|
|
76
|
+
assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', 10, 10, 10)
|
|
77
|
+
assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', '10', '10')
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def test_notes_are_initialized
|
|
@@ -63,7 +63,7 @@ class AbstractNoteTest < Test::Unit::TestCase
|
|
|
63
63
|
def test_footnotes_prefix
|
|
64
64
|
Footnotes::Filter.prefix = ''
|
|
65
65
|
assert !@note.send(:prefix?)
|
|
66
|
-
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
|
66
|
+
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
|
67
67
|
assert @note.send(:prefix?)
|
|
68
68
|
end
|
|
69
69
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: josevalim-rails-footnotes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "Jos\xC3\xA9 Valim"
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-05-01 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
@@ -22,6 +22,7 @@ extensions: []
|
|
|
22
22
|
extra_rdoc_files:
|
|
23
23
|
- README
|
|
24
24
|
files:
|
|
25
|
+
- CHANGELOG
|
|
25
26
|
- MIT-LICENSE
|
|
26
27
|
- README
|
|
27
28
|
- Rakefile
|
|
@@ -42,12 +43,10 @@ files:
|
|
|
42
43
|
- lib/rails-footnotes/notes/params_note.rb
|
|
43
44
|
- lib/rails-footnotes/notes/queries_note.rb
|
|
44
45
|
- lib/rails-footnotes/notes/routes_note.rb
|
|
46
|
+
- lib/rails-footnotes/notes/rpm_note.rb
|
|
45
47
|
- lib/rails-footnotes/notes/session_note.rb
|
|
46
48
|
- lib/rails-footnotes/notes/stylesheets_note.rb
|
|
47
49
|
- lib/rails-footnotes/notes/view_note.rb
|
|
48
|
-
- test/footnotes_test.rb
|
|
49
|
-
- test/test_helper.rb
|
|
50
|
-
- test/notes/abstract_note_test.rb
|
|
51
50
|
has_rdoc: true
|
|
52
51
|
homepage: http://github.com/josevalim/rails-footnotes
|
|
53
52
|
post_install_message:
|