lazydoc 0.8.0 → 0.9.0
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/History +9 -3
- data/README +1 -1
- data/lib/lazydoc/attributes.rb +2 -2
- data/lib/lazydoc/document.rb +2 -2
- data/lib/lazydoc/utils.rb +6 -3
- metadata +4 -4
data/History
CHANGED
@@ -1,5 +1,11 @@
|
|
1
|
-
== 0.
|
1
|
+
== 0.9.0 / 2009-05-25
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
* lazy attributes can now be accessed without auto-resolve
|
4
|
+
* added a default key to Document.scan
|
5
5
|
|
6
|
+
== 0.3.1 / 2009-02-17
|
7
|
+
|
8
|
+
Update release with trivial changes that remove warnings under ruby 1.9
|
9
|
+
and to accommodate JRuby 1.1.6
|
10
|
+
|
11
|
+
* documents may now set default_const_name
|
data/README
CHANGED
@@ -222,4 +222,4 @@ Lazydoc is available as a gem on RubyForge[http://rubyforge.org/projects/tap].
|
|
222
222
|
Copyright (c) 2008-2009, Regents of the University of Colorado.
|
223
223
|
Developer:: {Simon Chiang}[http://bahuvrihi.wordpress.com], {Biomolecular Structure Program}[http://biomol.uchsc.edu/], {Hansen Lab}[http://hsc-proteomics.uchsc.edu/hansenlab/]
|
224
224
|
Support:: CU Denver School of Medicine Deans Academic Enrichment Fund
|
225
|
-
|
225
|
+
License:: {MIT-Style}[link:files/MIT-LICENSE.html]
|
data/lib/lazydoc/attributes.rb
CHANGED
@@ -115,9 +115,9 @@ module Lazydoc
|
|
115
115
|
end
|
116
116
|
|
117
117
|
instance_eval %Q{
|
118
|
-
def #{symbol}
|
118
|
+
def #{symbol}(resolve=true)
|
119
119
|
comment = const_attrs[#{key}] ||= Subject.new(nil, lazydoc)
|
120
|
-
comment.kind_of?(Comment) ? comment.resolve : comment
|
120
|
+
resolve && comment.kind_of?(Comment) ? comment.resolve : comment
|
121
121
|
end}
|
122
122
|
|
123
123
|
instance_eval(%Q{
|
data/lib/lazydoc/document.rb
CHANGED
@@ -89,7 +89,7 @@ module Lazydoc
|
|
89
89
|
# # ['Another', 'key', 'another value']]
|
90
90
|
#
|
91
91
|
# Returns the StringScanner used during scanning.
|
92
|
-
def scan(str, key) # :yields: const_name, key, value
|
92
|
+
def scan(str, key='[a-z_]+') # :yields: const_name, key, value
|
93
93
|
scanner = case str
|
94
94
|
when StringScanner then str
|
95
95
|
when String then StringScanner.new(str)
|
@@ -205,7 +205,7 @@ module Lazydoc
|
|
205
205
|
lines = Utils.split_lines(str)
|
206
206
|
scanner = Utils.convert_to_scanner(str)
|
207
207
|
|
208
|
-
Document.scan(scanner
|
208
|
+
Document.scan(scanner) do |const_name, key, value|
|
209
209
|
# get or initialize the comment that will be parsed
|
210
210
|
comment = (self[const_name][key] ||= Subject.new(nil, self))
|
211
211
|
|
data/lib/lazydoc/utils.rb
CHANGED
@@ -85,7 +85,8 @@ module Lazydoc
|
|
85
85
|
args = []
|
86
86
|
brakets = braces = parens = 0
|
87
87
|
start = scanner.pos
|
88
|
-
broke =
|
88
|
+
broke = false
|
89
|
+
while scanner.skip(/.*?['"#,\(\)\{\}\[\]]/)
|
89
90
|
pos = scanner.pos - 1
|
90
91
|
|
91
92
|
case str[pos]
|
@@ -97,13 +98,15 @@ module Lazydoc
|
|
97
98
|
args << str[start, pos-start].strip
|
98
99
|
start = pos + 1
|
99
100
|
|
100
|
-
when ?# then break
|
101
|
+
when ?# then broke = true; break # break on a comment
|
101
102
|
when ?' then skip_quote(scanner, /'/) # parse over quoted strings
|
102
103
|
when ?" then skip_quote(scanner, /"/) # parse over double-quoted string
|
103
104
|
|
104
105
|
when ?( then parens += 1 # for brakets, braces, and parenthesis
|
105
106
|
when ?) # simply track the nesting EXCEPT for
|
106
|
-
|
107
|
+
if parens == 0 # RPAREN. If the closing parenthesis
|
108
|
+
broke = true; break
|
109
|
+
end
|
107
110
|
parens -= 1 # is found, break.
|
108
111
|
when ?[ then braces += 1
|
109
112
|
when ?] then braces -= 1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazydoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Chiang
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-25 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -20,9 +20,9 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
23
|
-
- History
|
24
23
|
- README
|
25
24
|
- MIT-LICENSE
|
25
|
+
- History
|
26
26
|
files:
|
27
27
|
- lib/lazydoc.rb
|
28
28
|
- lib/lazydoc/arguments.rb
|
@@ -33,9 +33,9 @@ files:
|
|
33
33
|
- lib/lazydoc/subject.rb
|
34
34
|
- lib/lazydoc/trailer.rb
|
35
35
|
- lib/lazydoc/utils.rb
|
36
|
-
- History
|
37
36
|
- README
|
38
37
|
- MIT-LICENSE
|
38
|
+
- History
|
39
39
|
has_rdoc: true
|
40
40
|
homepage: http://tap.rubyforge.org/lazydoc
|
41
41
|
post_install_message:
|