rails3-footnotes 4.0.0.pre
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 +81 -0
- data/MIT-LICENSE +21 -0
- data/README.md +129 -0
- data/Rakefile +33 -0
- data/lib/rails-footnotes/backtracer.rb +36 -0
- data/lib/rails-footnotes/footnotes.rb +365 -0
- data/lib/rails-footnotes/notes/abstract_note.rb +179 -0
- data/lib/rails-footnotes/notes/assigns_note.rb +60 -0
- data/lib/rails-footnotes/notes/controller_note.rb +72 -0
- data/lib/rails-footnotes/notes/cookies_note.rb +19 -0
- data/lib/rails-footnotes/notes/env_note.rb +26 -0
- data/lib/rails-footnotes/notes/files_note.rb +44 -0
- data/lib/rails-footnotes/notes/filters_note.rb +53 -0
- data/lib/rails-footnotes/notes/general_note.rb +19 -0
- data/lib/rails-footnotes/notes/javascripts_note.rb +16 -0
- data/lib/rails-footnotes/notes/layout_note.rb +28 -0
- data/lib/rails-footnotes/notes/log_note.rb +47 -0
- data/lib/rails-footnotes/notes/params_note.rb +19 -0
- data/lib/rails-footnotes/notes/partials_note.rb +56 -0
- data/lib/rails-footnotes/notes/queries_note.rb +187 -0
- data/lib/rails-footnotes/notes/routes_note.rb +63 -0
- data/lib/rails-footnotes/notes/rpm_note.rb +30 -0
- data/lib/rails-footnotes/notes/session_note.rb +29 -0
- data/lib/rails-footnotes/notes/stylesheets_note.rb +16 -0
- data/lib/rails-footnotes/notes/view_note.rb +35 -0
- data/lib/rails-footnotes.rb +22 -0
- data/test/footnotes_test.rb +207 -0
- data/test/notes/abstract_note_test.rb +107 -0
- data/test/test_helper.rb +10 -0
- metadata +100 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class AbstractNoteTest < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
@note = Footnotes::Notes::AbstractNote.new
|
6
|
+
Footnotes::Filter.notes = [:abstract]
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_respond_to_start_and_close
|
10
|
+
assert_respond_to Footnotes::Notes::AbstractNote, :start!
|
11
|
+
assert_respond_to Footnotes::Notes::AbstractNote, :close!
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_respond_to_sym
|
15
|
+
assert_equal :abstract, Footnotes::Notes::AbstractNote.to_sym
|
16
|
+
assert_equal :abstract, @note.to_sym
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_respond_to_included?
|
20
|
+
assert Footnotes::Notes::AbstractNote.included?
|
21
|
+
Footnotes::Filter.notes = []
|
22
|
+
assert !Footnotes::Notes::AbstractNote.included?
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_respond_to_row
|
26
|
+
assert_equal :show, @note.row
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_respond_to_title
|
30
|
+
assert_respond_to @note.class, :title
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_respond_to_legend
|
34
|
+
assert_respond_to @note, :legend
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_respond_to_link
|
38
|
+
assert_respond_to @note, :link
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_respond_to_onclick
|
42
|
+
assert_respond_to @note, :onclick
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_respond_to_stylesheet
|
46
|
+
assert_respond_to @note, :stylesheet
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_respond_to_javascript
|
50
|
+
assert_respond_to @note, :javascript
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_respond_to_valid?
|
54
|
+
assert_respond_to @note, :valid?
|
55
|
+
assert @note.valid?
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_respond_to_has_fieldset?
|
59
|
+
assert_respond_to @note, :has_fieldset?
|
60
|
+
assert !@note.has_fieldset?
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_footnotes_prefix
|
64
|
+
Footnotes::Filter.prefix = ''
|
65
|
+
assert !@note.send(:prefix?)
|
66
|
+
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
|
67
|
+
assert @note.send(:prefix?)
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_footnotes_escape
|
71
|
+
assert_equal '<', @note.send(:escape,'<')
|
72
|
+
assert_equal '&', @note.send(:escape,'&')
|
73
|
+
assert_equal '>', @note.send(:escape,'>')
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_footnotes_mount_table
|
77
|
+
assert_equal '', @note.send(:mount_table,[])
|
78
|
+
assert_equal '', @note.send(:mount_table,[['h1','h2','h3']], :class => 'table')
|
79
|
+
|
80
|
+
tab = <<-TABLE
|
81
|
+
<table class="table" >
|
82
|
+
<thead><tr><th>H1</th></tr></thead>
|
83
|
+
<tbody><tr><td>r1c1</td></tr></tbody>
|
84
|
+
</table>
|
85
|
+
TABLE
|
86
|
+
|
87
|
+
assert_equal tab, @note.send(:mount_table,[['h1'],['r1c1']], :class => 'table')
|
88
|
+
|
89
|
+
tab = <<-TABLE
|
90
|
+
<table >
|
91
|
+
<thead><tr><th>H1</th><th>H2</th><th>H3</th></tr></thead>
|
92
|
+
<tbody><tr><td>r1c1</td><td>r1c2</td><td>r1c3</td></tr></tbody>
|
93
|
+
</table>
|
94
|
+
TABLE
|
95
|
+
|
96
|
+
assert_equal tab, @note.send(:mount_table,[['h1','h2','h3'],['r1c1','r1c2','r1c3']])
|
97
|
+
|
98
|
+
tab = <<-TABLE
|
99
|
+
<table >
|
100
|
+
<thead><tr><th>H1</th><th>H2</th><th>H3</th></tr></thead>
|
101
|
+
<tbody><tr><td>r1c1</td><td>r1c2</td><td>r1c3</td></tr><tr><td>r2c1</td><td>r2c2</td><td>r2c3</td></tr></tbody>
|
102
|
+
</table>
|
103
|
+
TABLE
|
104
|
+
|
105
|
+
assert_equal tab, @note.send(:mount_table,[['h1','h2','h3'],['r1c1','r1c2','r1c3'],['r2c1','r2c2','r2c3']])
|
106
|
+
end
|
107
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'mocha'
|
4
|
+
|
5
|
+
ENV['RAILS_ENV'] = 'test'
|
6
|
+
|
7
|
+
require 'active_support'
|
8
|
+
require 'active_support/all' unless Class.respond_to?(:cattr_accessor)
|
9
|
+
require 'rails-footnotes/footnotes'
|
10
|
+
require 'rails-footnotes/notes/abstract_note'
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails3-footnotes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 961915908
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
- pre
|
11
|
+
version: 4.0.0.pre
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- "Andr\xC3\xA9 Arko"
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-02-14 00:00:00 -08:00
|
20
|
+
default_executable:
|
21
|
+
dependencies: []
|
22
|
+
|
23
|
+
description: Adds footnotes to each page in your Rails app, containing useful development information as well as links to edit the controllers and views in your editor.
|
24
|
+
email: andre@arko.net
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files: []
|
30
|
+
|
31
|
+
files:
|
32
|
+
- CHANGELOG
|
33
|
+
- MIT-LICENSE
|
34
|
+
- Rakefile
|
35
|
+
- README.md
|
36
|
+
- lib/rails-footnotes/backtracer.rb
|
37
|
+
- lib/rails-footnotes/footnotes.rb
|
38
|
+
- lib/rails-footnotes/notes/abstract_note.rb
|
39
|
+
- lib/rails-footnotes/notes/assigns_note.rb
|
40
|
+
- lib/rails-footnotes/notes/controller_note.rb
|
41
|
+
- lib/rails-footnotes/notes/cookies_note.rb
|
42
|
+
- lib/rails-footnotes/notes/env_note.rb
|
43
|
+
- lib/rails-footnotes/notes/files_note.rb
|
44
|
+
- lib/rails-footnotes/notes/filters_note.rb
|
45
|
+
- lib/rails-footnotes/notes/general_note.rb
|
46
|
+
- lib/rails-footnotes/notes/javascripts_note.rb
|
47
|
+
- lib/rails-footnotes/notes/layout_note.rb
|
48
|
+
- lib/rails-footnotes/notes/log_note.rb
|
49
|
+
- lib/rails-footnotes/notes/params_note.rb
|
50
|
+
- lib/rails-footnotes/notes/partials_note.rb
|
51
|
+
- lib/rails-footnotes/notes/queries_note.rb
|
52
|
+
- lib/rails-footnotes/notes/routes_note.rb
|
53
|
+
- lib/rails-footnotes/notes/rpm_note.rb
|
54
|
+
- lib/rails-footnotes/notes/session_note.rb
|
55
|
+
- lib/rails-footnotes/notes/stylesheets_note.rb
|
56
|
+
- lib/rails-footnotes/notes/view_note.rb
|
57
|
+
- lib/rails-footnotes.rb
|
58
|
+
- test/footnotes_test.rb
|
59
|
+
- test/notes/abstract_note_test.rb
|
60
|
+
- test/test_helper.rb
|
61
|
+
has_rdoc: true
|
62
|
+
homepage: http://github.com/indirect/rails-footnotes
|
63
|
+
licenses: []
|
64
|
+
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options:
|
67
|
+
- --charset=UTF-8
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 25
|
85
|
+
segments:
|
86
|
+
- 1
|
87
|
+
- 3
|
88
|
+
- 1
|
89
|
+
version: 1.3.1
|
90
|
+
requirements: []
|
91
|
+
|
92
|
+
rubyforge_project: rails-footnotes
|
93
|
+
rubygems_version: 1.3.7
|
94
|
+
signing_key:
|
95
|
+
specification_version: 3
|
96
|
+
summary: Footnotes for Rails pages in development
|
97
|
+
test_files:
|
98
|
+
- test/footnotes_test.rb
|
99
|
+
- test/notes/abstract_note_test.rb
|
100
|
+
- test/test_helper.rb
|