rails3-footnotes 4.0.0.pre.1 → 4.0.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
== Footnotes v4.0.0.pre.
|
1
|
+
== Footnotes v4.0.0.pre.2 (February 21, 2011)
|
2
|
+
* add a Railtie so the plugin will load in Rails 3 apps
|
3
|
+
* remove some internal rails3 ivars from the assigns note
|
4
|
+
* convert CSS to ems, px are sooo 2000's
|
5
|
+
|
6
|
+
== Footnotes v4.0.0.pre.1 (February 14, 2011)
|
2
7
|
* escapes TextMate links correctly (thanks reedlaw)
|
3
8
|
|
4
|
-
== Footnotes v4.0.0.pre
|
9
|
+
== Footnotes v4.0.0.pre (February 14, 2011)
|
5
10
|
* works with Rails 3 (mostly thanks to mperham)
|
6
11
|
|
7
12
|
== Footnotes v3.6.7
|
data/lib/rails-footnotes.rb
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
module Footnotes
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def self.included(base)
|
9
|
-
base.prepend_before_filter Footnotes::BeforeFilter
|
10
|
-
base.after_filter Footnotes::AfterFilter
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.run!
|
15
|
-
require 'rails-footnotes/footnotes'
|
16
|
-
require 'rails-footnotes/backtracer'
|
3
|
+
class Railtie < ::Rails::Railtie
|
4
|
+
config.before_configuration do
|
5
|
+
if ::Rails.env.development?
|
6
|
+
require 'rails-footnotes/footnotes'
|
7
|
+
require 'rails-footnotes/backtracer'
|
17
8
|
|
18
|
-
|
9
|
+
# Require each individual note
|
10
|
+
notes_glob = File.expand_path("../rails-footnotes/notes/*.rb", __FILE__)
|
11
|
+
Dir[notes_glob].each{|note| require note }
|
19
12
|
|
20
|
-
|
13
|
+
# The footnotes are applied by default to all actions. To remove the
|
14
|
+
# footnotes from an action, use skip_filter in your controller.
|
15
|
+
ActionController::Base.prepend_before_filter Footnotes::BeforeFilter
|
16
|
+
ActionController::Base.after_filter Footnotes::AfterFilter
|
17
|
+
end
|
18
|
+
end
|
21
19
|
end
|
20
|
+
|
22
21
|
end
|
@@ -80,7 +80,7 @@ module Footnotes
|
|
80
80
|
# Logs the error using specified title and format
|
81
81
|
#
|
82
82
|
def log_error(title, exception)
|
83
|
-
Rails.logger.error "#{title}: #{exception}\n#{exception.backtrace.join("\n")}"
|
83
|
+
::Rails.logger.error "#{title}: #{exception}\n#{exception.backtrace.join("\n")}"
|
84
84
|
end
|
85
85
|
|
86
86
|
# If none argument is sent, simply return the prefix.
|
@@ -187,9 +187,9 @@ module Footnotes
|
|
187
187
|
insert_text :before, /<\/head>/i, <<-HTML
|
188
188
|
<!-- Footnotes Style -->
|
189
189
|
<style type="text/css">
|
190
|
-
#footnotes_debug {font-size:
|
191
|
-
#footnotes_debug th, #footnotes_debug td {color: #444; line-height:
|
192
|
-
#footnotes_debug a {color: #9b1b1b; font-weight: inherit; text-decoration: none; line-height:
|
190
|
+
#footnotes_debug {font-size: 1em; font-weight: normal; margin: 2em 0 1em 0; text-align: center; color: #444; line-height: 16px;}
|
191
|
+
#footnotes_debug th, #footnotes_debug td {color: #444; line-height: 1.5em;}
|
192
|
+
#footnotes_debug a {color: #9b1b1b; font-weight: inherit; text-decoration: none; line-height: 1.5em;}
|
193
193
|
#footnotes_debug table {text-align: center;}
|
194
194
|
#footnotes_debug table td {padding: 0 5px;}
|
195
195
|
#footnotes_debug tbody {text-align: left;}
|
@@ -4,18 +4,28 @@ module Footnotes
|
|
4
4
|
module Notes
|
5
5
|
class AssignsNote < AbstractNote
|
6
6
|
@@ignored_assigns = [
|
7
|
-
:@
|
7
|
+
:@action_has_layout,
|
8
8
|
:@before_filter_chain_aborted,
|
9
|
+
:@db_rt_after_render,
|
10
|
+
:@db_rt_before_render,
|
11
|
+
:@devise_mapping,
|
12
|
+
:@lookup_context,
|
9
13
|
:@performed_redirect,
|
10
14
|
:@performed_render,
|
11
|
-
:@
|
12
|
-
:@_response,
|
13
|
-
:@url,
|
15
|
+
:@real_format,
|
14
16
|
:@template,
|
17
|
+
:@url,
|
18
|
+
:@view_context_class,
|
19
|
+
:@_action_name,
|
20
|
+
:@_config,
|
21
|
+
:@_db_runtime,
|
22
|
+
:@_env,
|
23
|
+
:@_params,
|
15
24
|
:@_request,
|
16
|
-
:@
|
17
|
-
:@
|
18
|
-
:@
|
25
|
+
:@_response,
|
26
|
+
:@_response_body,
|
27
|
+
:@_status,
|
28
|
+
:@_view_runtime,
|
19
29
|
]
|
20
30
|
cattr_accessor :ignored_assigns, :instance_writter => false
|
21
31
|
|
@@ -44,11 +54,11 @@ module Footnotes
|
|
44
54
|
def assigns
|
45
55
|
assign = []
|
46
56
|
ignored = @@ignored_assigns
|
47
|
-
|
57
|
+
|
48
58
|
@controller.instance_variables.each {|x| assign << x.intern }
|
49
59
|
@controller.protected_instance_variables.each {|x| ignored << x.intern } if @controller.respond_to? :protected_instance_variables
|
50
|
-
|
51
|
-
assign -= ignored
|
60
|
+
|
61
|
+
assign -= ignored
|
52
62
|
return assign
|
53
63
|
end
|
54
64
|
|
@@ -20,15 +20,15 @@ module Footnotes
|
|
20
20
|
prefix? && first_render?
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
protected
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
def first_render?
|
26
|
+
@template.instance_variable_get(:@_first_render)
|
27
|
+
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
def filename
|
30
|
+
@filename ||= @template.instance_variable_get(:@_first_render).filename
|
31
|
+
end
|
32
32
|
|
33
33
|
end
|
34
34
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails3-footnotes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923831853
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 4
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- pre
|
11
|
-
-
|
12
|
-
version: 4.0.0.pre.
|
11
|
+
- 2
|
12
|
+
version: 4.0.0.pre.2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- "Andr\xC3\xA9 Arko"
|