rails-footnotes 3.7.7 → 3.7.8
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.
@@ -16,6 +16,8 @@ module Footnotes
|
|
16
16
|
:@view_runtime
|
17
17
|
]
|
18
18
|
cattr_accessor :ignored_assigns, :instance_writter => false
|
19
|
+
@@ignored_assigns_pattern = /^@_/
|
20
|
+
cattr_accessor :ignored_assigns_pattern, :instance_writter => false
|
19
21
|
|
20
22
|
def initialize(controller)
|
21
23
|
@controller = controller
|
@@ -39,7 +41,7 @@ module Footnotes
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def assigns
|
42
|
-
@assigns ||= @controller.instance_variables.map {|v| v.to_sym} - ignored_assigns
|
44
|
+
@assigns ||= @controller.instance_variables.map {|v| v.to_sym}.select {|v| v.to_s !~ ignored_assigns_pattern } - ignored_assigns
|
43
45
|
end
|
44
46
|
|
45
47
|
def assigned_value(key)
|
@@ -5,9 +5,9 @@ require "rails-footnotes/notes/assigns_note"
|
|
5
5
|
describe Footnotes::Notes::AssignsNote do
|
6
6
|
let(:note) do
|
7
7
|
@controller = mock
|
8
|
-
@controller.stub(:instance_variables).and_return([:@action_has_layout, :@
|
8
|
+
@controller.stub(:instance_variables).and_return([:@action_has_layout, :@status])
|
9
9
|
@controller.instance_variable_set(:@action_has_layout, true)
|
10
|
-
@controller.instance_variable_set(:@
|
10
|
+
@controller.instance_variable_set(:@status, 200)
|
11
11
|
Footnotes::Notes::AssignsNote.new(@controller)
|
12
12
|
end
|
13
13
|
subject {note}
|
@@ -17,17 +17,22 @@ describe Footnotes::Notes::AssignsNote do
|
|
17
17
|
it {should be_valid}
|
18
18
|
its(:title) {should eql 'Assigns (2)'}
|
19
19
|
|
20
|
-
specify {note.send(:assigns).should eql [:@action_has_layout, :@
|
21
|
-
specify {note.send(:to_table).should eql [['Name', 'Value'], [:@action_has_layout, "true"], [:@
|
20
|
+
specify {note.send(:assigns).should eql [:@action_has_layout, :@status]}
|
21
|
+
specify {note.send(:to_table).should eql [['Name', 'Value'], [:@action_has_layout, "true"], [:@status, "200"]]}
|
22
22
|
|
23
23
|
describe "Ignored Assigns" do
|
24
|
-
before(:each) {Footnotes::Notes::AssignsNote.ignored_assigns = [:@
|
25
|
-
it {note.send(:assigns).should_not include :@
|
24
|
+
before(:each) {Footnotes::Notes::AssignsNote.ignored_assigns = [:@status]}
|
25
|
+
it {note.send(:assigns).should_not include :@status}
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "Ignored Assigns by regexp" do
|
29
|
+
before(:each) {Footnotes::Notes::AssignsNote.ignored_assigns_pattern = /^@status$/}
|
30
|
+
it {note.send(:assigns).should_not include :@status}
|
26
31
|
end
|
27
32
|
|
28
33
|
it "should call #mount_table method with correct params" do
|
29
34
|
note.should_receive(:mount_table).with(
|
30
|
-
[['Name', 'Value'], [:@action_has_layout, "true"], [:@
|
35
|
+
[['Name', 'Value'], [:@action_has_layout, "true"], [:@status, "200"]], {:summary=>"Debug information for Assigns (2)"})
|
31
36
|
note.content
|
32
37
|
end
|
33
38
|
end
|
metadata
CHANGED
@@ -1,60 +1,83 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-footnotes
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 7
|
9
|
+
- 8
|
10
|
+
version: 3.7.8
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Roman V. Babenko
|
9
|
-
-
|
14
|
+
- "Jos\xC3\xA9 Valim"
|
10
15
|
- Keenan Brock
|
11
16
|
- Duane Johnson
|
12
17
|
autorequire:
|
13
18
|
bindir: bin
|
14
19
|
cert_chain: []
|
15
|
-
|
16
|
-
|
17
|
-
|
20
|
+
|
21
|
+
date: 2012-04-19 00:00:00 Z
|
22
|
+
dependencies:
|
23
|
+
- !ruby/object:Gem::Dependency
|
18
24
|
name: rails
|
19
|
-
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
27
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 7
|
32
|
+
segments:
|
33
|
+
- 3
|
34
|
+
- 0
|
35
|
+
- 0
|
24
36
|
version: 3.0.0
|
25
37
|
type: :runtime
|
26
|
-
|
27
|
-
|
28
|
-
- !ruby/object:Gem::Dependency
|
38
|
+
version_requirements: *id001
|
39
|
+
- !ruby/object:Gem::Dependency
|
29
40
|
name: rails
|
30
|
-
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
43
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: 7
|
48
|
+
segments:
|
49
|
+
- 3
|
50
|
+
- 0
|
51
|
+
- 0
|
35
52
|
version: 3.0.0
|
36
53
|
type: :development
|
37
|
-
|
38
|
-
|
39
|
-
- !ruby/object:Gem::Dependency
|
54
|
+
version_requirements: *id002
|
55
|
+
- !ruby/object:Gem::Dependency
|
40
56
|
name: rspec
|
41
|
-
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
59
|
none: false
|
43
|
-
requirements:
|
60
|
+
requirements:
|
44
61
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 43
|
64
|
+
segments:
|
65
|
+
- 2
|
66
|
+
- 9
|
67
|
+
- 0
|
46
68
|
version: 2.9.0
|
47
69
|
type: :development
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
and links back to your editor.
|
52
|
-
email:
|
70
|
+
version_requirements: *id003
|
71
|
+
description: Every Rails page has footnotes that gives information about your application and links back to your editor.
|
72
|
+
email:
|
53
73
|
- romanvbabenko@gmail.com
|
54
74
|
executables: []
|
75
|
+
|
55
76
|
extensions: []
|
77
|
+
|
56
78
|
extra_rdoc_files: []
|
57
|
-
|
79
|
+
|
80
|
+
files:
|
58
81
|
- .gitignore
|
59
82
|
- .rspec.example
|
60
83
|
- .travis.yml
|
@@ -107,30 +130,38 @@ files:
|
|
107
130
|
- spec/spec_helper.rb
|
108
131
|
homepage: http://github.com/josevalim/rails-footnotes
|
109
132
|
licenses: []
|
133
|
+
|
110
134
|
post_install_message:
|
111
135
|
rdoc_options: []
|
112
|
-
|
136
|
+
|
137
|
+
require_paths:
|
113
138
|
- lib
|
114
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
140
|
none: false
|
116
|
-
requirements:
|
117
|
-
- -
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
|
120
|
-
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
hash: 3
|
145
|
+
segments:
|
146
|
+
- 0
|
147
|
+
version: "0"
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
149
|
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
hash: 3
|
154
|
+
segments:
|
155
|
+
- 0
|
156
|
+
version: "0"
|
126
157
|
requirements: []
|
158
|
+
|
127
159
|
rubyforge_project: rails-footnotes
|
128
160
|
rubygems_version: 1.8.17
|
129
161
|
signing_key:
|
130
162
|
specification_version: 3
|
131
|
-
summary: Every Rails page has footnotes that gives information about your application
|
132
|
-
|
133
|
-
test_files:
|
163
|
+
summary: Every Rails page has footnotes that gives information about your application and links back to your editor.
|
164
|
+
test_files:
|
134
165
|
- spec/abstract_note_spec.rb
|
135
166
|
- spec/footnotes_spec.rb
|
136
167
|
- spec/notes/assigns_note_spec.rb
|