dnote 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +50 -42
- data/.yardopts +5 -0
- data/COPYING.rdoc +31 -0
- data/HISTORY.rdoc +14 -2
- data/README.rdoc +5 -14
- data/lib/dnote.rb +1 -1
- data/lib/dnote/core_ext.rb +80 -0
- data/lib/dnote/format.rb +2 -1
- data/lib/dnote/rake/dnotetask.rb +116 -0
- data/lib/dnote/session.rb +2 -2
- data/lib/dnote/templates/md.erb +2 -1
- data/lib/dnote/templates/md/file.erb +1 -0
- data/lib/dnote/templates/md/label.erb +1 -0
- data/lib/dnote/templates/md/list.erb +1 -0
- data/lib/dnote/templates/rdoc.erb +1 -0
- data/lib/dnote/templates/rdoc/file.erb +1 -0
- data/lib/dnote/templates/rdoc/label.erb +1 -0
- data/lib/dnote/templates/rdoc/list.erb +1 -0
- data/lib/dnote/templates/text.erb +1 -0
- data/lib/dnote/templates/text/file.erb +2 -1
- data/lib/dnote/templates/text/list.erb +1 -0
- data/lib/dnote/templates/xml.erb +13 -5
- data/lib/dnote/templates/xml/file.erb +13 -5
- data/lib/dnote/templates/xml/label.erb +11 -3
- data/lib/dnote/templates/xml/list.erb +9 -1
- data/lib/dnote/version.rb +14 -1
- data/test/notes_case.rb +45 -25
- metadata +69 -85
- data/APACHE2.txt +0 -202
- data/lib/dnote/string.rb +0 -68
- data/lib/plugins/rake/task.rb +0 -113
- data/lib/plugins/redline/dnote.rb +0 -158
@@ -5,6 +5,7 @@
|
|
5
5
|
<%= file %>:
|
6
6
|
|
7
7
|
<% line_notes.sort!{ |a,b| a.line <=> b.line } %><% line_notes.each do |note| %>
|
8
|
-
<%= note.to_s.indent(
|
8
|
+
<%= note.to_s.indent(4).sub(' ' * 4,' * ') %> (<%= note.line %>)
|
9
|
+
<% if note.code? %><%= "\n" + note.code.tabset(10) + "\n" %><% end %>
|
9
10
|
<% end; end %>
|
10
11
|
|
data/lib/dnote/templates/xml.erb
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
<?xml version="1.0" ?>
|
2
2
|
<notes>
|
3
3
|
<% notes.by_label_file.each do |label, per_file| %>
|
4
|
-
|
4
|
+
<label name="<%= label %>">
|
5
5
|
<% per_file.each do |file, line_notes| %>
|
6
|
-
|
6
|
+
<file src="<%= file %>">
|
7
7
|
<% line_notes.sort!{ |a,b| a.line <=> b.line } %>
|
8
8
|
<% line_notes.each do |note| %>
|
9
|
-
|
9
|
+
<note line="<%= note.line %>" type="<%= label %>">
|
10
|
+
<%= h note.textline %>
|
11
|
+
<% if note.code? %>
|
12
|
+
|
13
|
+
<![CDATA[
|
14
|
+
<%= note.code %>
|
15
|
+
]]>
|
10
16
|
<% end %>
|
11
|
-
|
17
|
+
</note>
|
12
18
|
<% end %>
|
13
|
-
</
|
19
|
+
</file>
|
20
|
+
<% end %>
|
21
|
+
</label>
|
14
22
|
<% end %>
|
15
23
|
</notes>
|
@@ -1,15 +1,23 @@
|
|
1
1
|
<?xml version="1.0" ?>
|
2
2
|
<notes>
|
3
3
|
<% notes.by_file_label.each do |file, per_label| %>
|
4
|
-
|
4
|
+
<file src="<%= file %>">
|
5
5
|
<% per_label.each do |label, lnotes| %>
|
6
|
-
|
6
|
+
<label name="<%= label %>">
|
7
7
|
<% line_notes.sort!{ |a,b| a.line <=> b.line } %>
|
8
8
|
<% line_notes.each do |note| %>
|
9
|
-
|
9
|
+
<note line="<%= note.line %>" type="<%= label %>">
|
10
|
+
<%= h note.textline %>
|
11
|
+
<% if note.code? %>
|
12
|
+
|
13
|
+
<![CDATA[
|
14
|
+
<%= note.code %>
|
15
|
+
]]>
|
10
16
|
<% end %>
|
11
|
-
|
17
|
+
</note>
|
12
18
|
<% end %>
|
13
|
-
</
|
19
|
+
</label>
|
20
|
+
<% end %>
|
21
|
+
</file>
|
14
22
|
<% end %>
|
15
23
|
</notes>
|
@@ -1,12 +1,20 @@
|
|
1
1
|
<?xml version="1.0" ?>
|
2
2
|
<notes>
|
3
3
|
<% notes.by_label_file.each do |label, per_file| %>
|
4
|
-
|
4
|
+
<label name="<%= label %>">
|
5
5
|
<% per_file.each do |file, line_notes| %>
|
6
|
-
|
6
|
+
<file src="<%= file %>">
|
7
7
|
<% line_notes.sort!{ |a,b| a.line <=> b.line } %>
|
8
8
|
<% line_notes.each do |note| %>
|
9
|
-
|
9
|
+
<note line="<%= note.line %>" type="<%= label %>">
|
10
|
+
<%= h note.textline %>
|
11
|
+
<% if note.code? %>
|
12
|
+
|
13
|
+
<![CDATA[
|
14
|
+
<%= note.code %>
|
15
|
+
]]>
|
16
|
+
<% end %>
|
17
|
+
</note>
|
10
18
|
<% end %>
|
11
19
|
</file>
|
12
20
|
<% end %>
|
@@ -1,6 +1,14 @@
|
|
1
1
|
<?xml version="1.0" ?>
|
2
2
|
<notes>
|
3
3
|
<% notes.each do |note| %>
|
4
|
-
<note file="<%= note.file %>" line="<%= note.line %>" type="<%= label %>"
|
4
|
+
<note file="<%= note.file %>" line="<%= note.line %>" type="<%= label %>">
|
5
|
+
<%= h note.textline %>
|
6
|
+
<% if note.code? %>
|
7
|
+
|
8
|
+
<![CDATA[
|
9
|
+
<%= note.code %>
|
10
|
+
]]>
|
11
|
+
<% end %>
|
12
|
+
</note>
|
5
13
|
<% end %>
|
6
14
|
</notes>
|
data/lib/dnote/version.rb
CHANGED
@@ -1,3 +1,16 @@
|
|
1
1
|
module DNote
|
2
|
-
|
2
|
+
|
3
|
+
#
|
4
|
+
def self.metadata
|
5
|
+
@metadata ||= (
|
6
|
+
require 'yaml'
|
7
|
+
YAML.load_file(File.dirname(__FILE__) + '/../dnote.yml')
|
8
|
+
)
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
def self.const_missing(name)
|
13
|
+
metadata[name.to_s.downcase] || super(name)
|
14
|
+
end
|
15
|
+
|
3
16
|
end
|
data/test/notes_case.rb
CHANGED
@@ -1,44 +1,64 @@
|
|
1
|
+
require 'lemon'
|
2
|
+
require 'ae'
|
1
3
|
require 'dnote/notes'
|
2
4
|
|
3
5
|
testcase DNote::Notes do
|
4
6
|
|
5
7
|
concern "Coverage of DNote::Notes class."
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
method :labels do
|
10
|
+
test 'returns the list of labels' do
|
11
|
+
notes = DNote::Notes.new([], :labels=>['TODO'])
|
12
|
+
notes.labels.assert == ['TODO'] #DNote::Notes::DEFAULT_LABELS
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
method :files do
|
17
|
+
test 'returns the files attribute' do
|
18
|
+
notes = DNote::Notes.new(["example1.rb"])
|
19
|
+
notes.assert.files == ["example1.rb"]
|
20
|
+
notes = DNote::Notes.new([], :paths => ["example2.rb"])
|
21
|
+
notes.assert.files == ["example2.rb"]
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
25
|
+
method :files do
|
26
|
+
test 'changes the paths attribute' do
|
27
|
+
notes = DNote::Notes.new([])
|
28
|
+
notes.files = ["example1.rb"]
|
29
|
+
notes.assert.files == ["example1.rb"]
|
30
|
+
end
|
23
31
|
end
|
24
32
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
33
|
+
method :match_general do
|
34
|
+
test 'works' do
|
35
|
+
notes = DNote::Notes.new([])
|
36
|
+
line, lineno, file = "# TODO: Do something or another!", 1, "foo.rb"
|
37
|
+
rec = notes.match_general(line, lineno, file)
|
38
|
+
rec.to_h.assert == {'label'=>"TODO",'file'=>file,'line'=>lineno,'text'=>"Do something or another!"}
|
39
|
+
end
|
30
40
|
end
|
31
41
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
42
|
+
method :match_special do
|
43
|
+
test 'works' do
|
44
|
+
notes = DNote::Notes.new([], :labels=>['TODO'])
|
45
|
+
line, lineno, file = "# TODO: Do something or another!", 1, "foo.rb"
|
46
|
+
rec = notes.match_special(line, lineno, file)
|
47
|
+
rec.to_h.assert == {'label'=>"TODO",'file'=>file,'line'=>lineno,'text'=>"Do something or another!"}
|
48
|
+
end
|
37
49
|
end
|
38
50
|
|
39
|
-
|
40
|
-
|
41
|
-
|
51
|
+
method :counts do
|
52
|
+
test{ raise NotImplementedError }
|
53
|
+
end
|
54
|
+
|
55
|
+
method :notes do
|
56
|
+
test{ raise NotImplementedError }
|
57
|
+
end
|
58
|
+
|
59
|
+
method :parse do
|
60
|
+
test{ raise NotImplementedError }
|
61
|
+
end
|
42
62
|
|
43
63
|
end
|
44
64
|
|
metadata
CHANGED
@@ -1,82 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dnote
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 6
|
9
|
-
- 1
|
10
|
-
version: 1.6.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.7.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Thomas Sawyer
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: lemon
|
16
|
+
requirement: &13030000 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
version_requirements: *13030000
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: ae
|
27
|
+
requirement: &13029220 !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
33
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: redline
|
37
34
|
prerelease: false
|
38
|
-
|
35
|
+
version_requirements: *13029220
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: detroit
|
38
|
+
requirement: &13028580 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
47
44
|
type: :development
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: reap
|
51
45
|
prerelease: false
|
52
|
-
|
46
|
+
version_requirements: *13028580
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: reap
|
49
|
+
requirement: &13027940 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
version: "0"
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
61
55
|
type: :development
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *13027940
|
58
|
+
description: ! 'DNote makes it easy to extract developer''s notes from source code,
|
59
|
+
|
60
|
+
and supports almost any language.'
|
61
|
+
email:
|
62
|
+
- transfire@gmail.com
|
63
|
+
executables:
|
66
64
|
- dnote
|
67
65
|
extensions: []
|
68
|
-
|
69
|
-
|
66
|
+
extra_rdoc_files:
|
67
|
+
- HISTORY.rdoc
|
70
68
|
- README.rdoc
|
71
|
-
|
69
|
+
- COPYING.rdoc
|
70
|
+
files:
|
72
71
|
- .ruby
|
72
|
+
- .yardopts
|
73
73
|
- bin/dnote
|
74
74
|
- lib/dnote/core_ext.rb
|
75
75
|
- lib/dnote/format.rb
|
76
76
|
- lib/dnote/note.rb
|
77
77
|
- lib/dnote/notes.rb
|
78
|
+
- lib/dnote/rake/dnotetask.rb
|
78
79
|
- lib/dnote/session.rb
|
79
|
-
- lib/dnote/string.rb
|
80
80
|
- lib/dnote/templates/html/file.erb
|
81
81
|
- lib/dnote/templates/html/label.erb
|
82
82
|
- lib/dnote/templates/html/list.erb
|
@@ -115,51 +115,35 @@ files:
|
|
115
115
|
- lib/dnote/templates/yaml.erb
|
116
116
|
- lib/dnote/version.rb
|
117
117
|
- lib/dnote.rb
|
118
|
-
- lib/plugins/rake/task.rb
|
119
|
-
- lib/plugins/redline/dnote.rb
|
120
118
|
- test/notes_case.rb
|
121
119
|
- try/sample.bas
|
122
120
|
- try/sample.js
|
123
121
|
- try/sample.rb
|
124
122
|
- HISTORY.rdoc
|
125
|
-
- APACHE2.txt
|
126
123
|
- README.rdoc
|
127
|
-
|
124
|
+
- COPYING.rdoc
|
128
125
|
homepage: http://rubyworks.github.com/dnote
|
129
126
|
licenses: []
|
130
|
-
|
131
127
|
post_install_message:
|
132
|
-
rdoc_options:
|
133
|
-
|
134
|
-
- DNote API
|
135
|
-
- --main
|
136
|
-
- README.rdoc
|
137
|
-
require_paths:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
138
130
|
- lib
|
139
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
140
132
|
none: false
|
141
|
-
requirements:
|
142
|
-
- -
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
|
145
|
-
|
146
|
-
- 0
|
147
|
-
version: "0"
|
148
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
138
|
none: false
|
150
|
-
requirements:
|
151
|
-
- -
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
|
154
|
-
segments:
|
155
|
-
- 0
|
156
|
-
version: "0"
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
157
143
|
requirements: []
|
158
|
-
|
159
|
-
|
160
|
-
rubygems_version: 1.3.7
|
144
|
+
rubyforge_project:
|
145
|
+
rubygems_version: 1.8.10
|
161
146
|
signing_key:
|
162
147
|
specification_version: 3
|
163
|
-
summary: Extract developer's notes from source code
|
148
|
+
summary: Extract developer's notes from source code.
|
164
149
|
test_files: []
|
165
|
-
|