rails-footnotes 3.7.1.pre → 3.7.1

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/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  Gemfile.lock
7
7
  pkg/*
8
8
  tags
9
+ doc
@@ -1,13 +1,4 @@
1
- Rails Footnotes
2
- License: MIT
3
- Version: 3.7.0
4
-
5
- You can also read this README in pretty html at the GitHub project Wiki page
6
-
7
- http://wiki.github.com/josevalim/rails-footnotes
8
-
9
- Description
10
- -----------
1
+ = Rails Footnotes
11
2
 
12
3
  If you are developing in Rails you should know the plugin! It displays
13
4
  footnotes in your application for easy debugging, such as sessions,
@@ -16,28 +7,25 @@ request parameters, cookies, filter chain, routes, queries, etc.
16
7
  Even more, it contains links to open files directly in your editor including
17
8
  your backtrace lines.
18
9
 
10
+ == Installation
19
11
 
20
- Installation
21
- ------------
22
-
23
- Since this branch aims Rails 3 support, if you want to use it with Rails 2.3 you should check this branch:
12
+ NOTE: Since this branch aims Rails 3 support, if you want to use it with Rails 2.3 you should check this branch:
24
13
 
25
- https://github.com/josevalim/rails-footnotes/tree/rails2
14
+ https://github.com/josevalim/rails-footnotes/tree/rails2
26
15
 
27
16
  Install Rails Footnotes is very easy.
28
17
 
29
- Rails 2.x
18
+ === Rails 3.x
30
19
 
31
- In RAILS_ROOT/config/environments/development.rb (yes, you want it only in development):
20
+ gem 'rails-footnotes', '>= 3.7', :group => :development
32
21
 
33
- gem "rails-footnotes", '< 3.7.0', :group => :development
22
+ === Rails 2.x
34
23
 
35
- Rails 3.x
24
+ In RAILS_ROOT/config/environments/development.rb (yes, you want it only in development):
36
25
 
37
- gem 'rails-footnotes', '>= 3.7', :group => :development
26
+ gem "rails-footnotes", '< 3.7.0', :group => :development
38
27
 
39
- Configuration
40
- -------------
28
+ == Configuration
41
29
 
42
30
  For version greater then 3.7.0
43
31
 
@@ -50,8 +38,7 @@ add something like this to config/initializers/footnotes.rb:
50
38
  # ... other init code
51
39
  end
52
40
 
53
- Hooks
54
- -------------
41
+ === Hooks
55
42
 
56
43
  Footnotes.setup do |config|
57
44
  config.before {|controller, filter| filter.notes = controller.class.name =~ /Message/ && \
@@ -63,7 +50,7 @@ Hooks
63
50
  If you are not using Textmate as text editor, in your environment.rb or
64
51
  in an initializer do:
65
52
 
66
- Footnotes::Filter.prefix = 'mvim://open?url=file://%s&amp;line=%d&amp;column=%d'
53
+ Footnotes::Filter.prefix = 'mvim://open?url=file://%s&amp;line=%d&amp;column=%d'
67
54
 
68
55
  for MacVim
69
56
 
@@ -75,31 +62,27 @@ By default, footnotes are appended at the end of the page with default styleshee
75
62
  to change their position, you can define a div with id "footnotes_holder" or define your own stylesheet
76
63
  by turning footnotes stylesheet off:
77
64
 
78
- Footnotes::Filter.no_style = true
65
+ Footnotes::Filter.no_style = true
79
66
 
80
67
  Another option is to allow multiple notes to be opened at the same time:
81
68
 
82
- Footnotes::Filter.multiple_notes = true
69
+ Footnotes::Filter.multiple_notes = true
83
70
 
84
71
  If you have New Relic RPM installed, you may want to turn off query explains
85
72
  (explains can slows things down)
86
73
 
87
- Footnotes::Notes::QueriesNote.sql_explain = false
74
+ Footnotes::Notes::QueriesNote.sql_explain = false
88
75
 
89
76
  Finally, you can control which notes you want to show. The default are:
90
77
 
91
- Footnotes::Filter.notes = [:session, :cookies, :params, :filters, :routes, :env, :queries, :log, :general]
78
+ Footnotes::Filter.notes = [:session, :cookies, :params, :filters, :routes, :env, :queries, :log, :general]
92
79
 
93
-
94
- Creating your own notes
95
- -----------------------
80
+ == Creating your own notes
96
81
 
97
82
  Create your notes to integrate with Footnotes is easy.
98
83
 
99
84
  1. Create a Footnotes::Notes::YourExampleNote class
100
-
101
85
  2. Implement the necessary methods (check abstract_note.rb file in lib/notes)
102
-
103
86
  3. Append your example note in Footnotes::Filter.notes array (usually at the end of your environment file or in an initializer):
104
87
 
105
88
  For example, to create a note that shows info about the user logged in your application you just have to do:
@@ -139,35 +122,28 @@ Then put in your environment:
139
122
 
140
123
  Footnotes::Filter.notes += [:current_user]
141
124
 
142
-
143
- Colaborators
144
- ------------
125
+ == Colaborators
145
126
 
146
127
  * Leon Li - http://github.com/scorpio
147
128
  * Keenan Brock - http://github.com/kbrock
148
129
  * Ivan Storck - http://github.com/ivanoats
149
130
  * Kris Chamber - http://github.com/kristopher
150
131
 
151
-
152
- Bugs and Feedback
153
- -----------------
132
+ == Bugs and Feedback
154
133
 
155
134
  If you discover any bugs, please send an e-mail to keenan@thebrocks.net
156
135
  If you just want to give some positive feedback or drop a line, that's fine too!
157
136
 
158
-
159
- Version 3.x
160
- -----------
137
+ === Version 3.x
161
138
 
162
139
  This plugin was maintained until version 3.6 by José Valim
163
140
 
164
141
  Copyright (c) 2009 José Valim (jose@plataformatec.com.br)
165
- http://blog.plataformatec.com.br/
142
+ http://blog.plataformatec.com.br
166
143
 
167
- Version 2.0
168
- -----------
144
+ === Version 2.0
169
145
 
170
146
  This plugin was created and maintained until version 2.0 by Duane Johnson:
171
147
 
172
148
  Copyright (c) 2006 InquiryLabs, Inc.
173
- http://blog.inquirylabs.com/
149
+ http://blog.inquirylabs.com
@@ -1,3 +1,3 @@
1
1
  module Footnotes
2
- VERSION = "3.7.1.pre"
2
+ VERSION = "3.7.1"
3
3
  end
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency "rails", ">= 3.0.0"
18
18
 
19
19
  s.add_development_dependency "autotest"
20
- s.add_development_dependency "redgreen"
21
20
  s.add_development_dependency "mocha"
22
21
  s.add_development_dependency "rails", ">= 3.0.0"
23
22
 
@@ -10,6 +10,10 @@ module Footnotes::Notes
10
10
  def self.to_sym; :test; end
11
11
  def valid?; true; end
12
12
  end
13
+
14
+ class NoteXNote < TestNote; end
15
+ class NoteYNote < TestNote; end
16
+ class NoteZNote < TestNote; end
13
17
  end
14
18
 
15
19
  class FootnotesTest < Test::Unit::TestCase
@@ -30,7 +34,7 @@ class FootnotesTest < Test::Unit::TestCase
30
34
  index = @controller.response.body.index(/This is the HTML page/)
31
35
  assert_equal 334, index
32
36
  end
33
-
37
+
34
38
  def test_foonotes_included
35
39
  footnotes_perform!
36
40
  assert_not_equal $html, @controller.response.body
@@ -167,7 +171,18 @@ class FootnotesTest < Test::Unit::TestCase
167
171
  after = " Notes</body>"
168
172
  assert_equal after, @controller.response.body.split("\n")[12]
169
173
  end
170
-
174
+
175
+ def test_hooks
176
+ Footnotes::Filter.notes = [:note_x, :note_y, :note_z]
177
+ Footnotes.setup {|config| config.before {|controller, filter| filter.notes -= [:note_y] }}
178
+ Footnotes::Filter.start!(@controller)
179
+ assert_equal [:note_x, :note_z], Footnotes::Filter.notes
180
+
181
+ Footnotes.setup {|config| config.after {|controller, filter| filter.notes -= [:note_y] }}
182
+ @footnotes.close!(@controller)
183
+ assert_equal [:note_x, :note_z], Footnotes::Filter.notes
184
+ end
185
+
171
186
  protected
172
187
  # First we make sure that footnotes will perform (long life to mocha!)
173
188
  # Then we call add_footnotes!
@@ -204,4 +219,4 @@ $html = <<HTML
204
219
  <p>You will be glad to know that no changes need to be made to any of your CSS files.</p>
205
220
  </body>
206
221
  </html>
207
- HTML
222
+ HTML
data/test/test_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'test/unit'
2
1
  require 'rubygems'
2
+ require 'test/unit'
3
3
  require 'mocha'
4
4
 
5
5
  ENV['RAILS_ENV'] = 'test'
@@ -7,4 +7,5 @@ ENV['RAILS_ENV'] = 'test'
7
7
  require 'active_support'
8
8
  require 'active_support/all' unless Class.respond_to?(:cattr_accessor)
9
9
  require 'rails-footnotes/footnotes'
10
- require 'rails-footnotes/notes/abstract_note'
10
+ require 'rails-footnotes/notes/abstract_note'
11
+ require "rails-footnotes"
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-footnotes
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 3.7.1.pre
4
+ prerelease:
5
+ version: 3.7.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Keenan Brock
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-23 00:00:00 Z
13
+ date: 2011-04-25 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -35,7 +35,7 @@ dependencies:
35
35
  type: :development
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
38
- name: redgreen
38
+ name: mocha
39
39
  prerelease: false
40
40
  requirement: &id003 !ruby/object:Gem::Requirement
41
41
  none: false
@@ -45,28 +45,17 @@ dependencies:
45
45
  version: "0"
46
46
  type: :development
47
47
  version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: mocha
50
- prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
57
- type: :development
58
- version_requirements: *id004
59
48
  - !ruby/object:Gem::Dependency
60
49
  name: rails
61
50
  prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
51
+ requirement: &id004 !ruby/object:Gem::Requirement
63
52
  none: false
64
53
  requirements:
65
54
  - - ">="
66
55
  - !ruby/object:Gem::Version
67
56
  version: 3.0.0
68
57
  type: :development
69
- version_requirements: *id005
58
+ version_requirements: *id004
70
59
  description: Every Rails page has footnotes that gives information about your application and links back to your editor.
71
60
  email:
72
61
  - keenan@thebrocks.net
@@ -82,7 +71,7 @@ files:
82
71
  - Gemfile
83
72
  - Gemfile.lock
84
73
  - MIT-LICENSE
85
- - README
74
+ - README.rdoc
86
75
  - Rakefile
87
76
  - lib/rails-footnotes.rb
88
77
  - lib/rails-footnotes/backtracer.rb
@@ -128,9 +117,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
117
  required_rubygems_version: !ruby/object:Gem::Requirement
129
118
  none: false
130
119
  requirements:
131
- - - ">"
120
+ - - ">="
132
121
  - !ruby/object:Gem::Version
133
- version: 1.3.1
122
+ version: "0"
134
123
  requirements: []
135
124
 
136
125
  rubyforge_project: rails-footnotes