tomdoc 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  TomDoc
2
2
  ======
3
3
 
4
- TomDoc is documentation for humans. Using a few simple rules and zero
5
- special syntax you can produce great looking documentation for both humans
4
+ TomDoc is documentation for humans. Using a few simple rules and zero
5
+ special syntax you can produce great looking documentation for both humans
6
6
  and machines.
7
7
 
8
8
  Just follow these four easy steps:
@@ -100,5 +100,15 @@ or
100
100
 
101
101
  ![html](http://img.skitch.com/20100408-dbhtc4mef2q3ygmn63csxgh14w.png)
102
102
 
103
+ Local Dev
104
+ ---------
105
+
106
+ Want to hack on tomdoc.rb? Of course you do.
107
+
108
+ git clone http://github.com/defunkt/tomdoc.git
109
+ cd tomdoc
110
+ bundle install --local
111
+ ruby -rubygems ./bin/tomdoc lib/tomdoc/source_parser.rb
112
+
103
113
  [man]: https://github.com/defunkt/tomdoc/blob/tomdoc.rb/man/tomdoc.5.ronn
104
114
  [spec]: https://github.com/defunkt/tomdoc/blob/tomdoc.rb/tomdoc.md
data/bin/tomdoc CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $:.unshift File.dirname(__FILE__) + '/../lib'
3
4
  require 'tomdoc'
4
5
 
5
6
  # Process options
@@ -6,6 +6,7 @@ module TomDoc
6
6
  end
7
7
 
8
8
  def write_scope_header(scope, prefix)
9
+ #write "<h1>#{scope.name}</h1>"
9
10
  end
10
11
 
11
12
  def write_scope_footer(scope, prefix)
@@ -13,13 +14,13 @@ module TomDoc
13
14
 
14
15
  def write_class_methods(scope, prefix)
15
16
  out = '<ul>'
16
- out << super.to_s
17
+ out << super.join
17
18
  write out
18
19
  end
19
20
 
20
21
  def write_instance_methods(scope, prefix)
21
22
  out = ''
22
- out << super.to_s
23
+ out << super.join
23
24
  out << '</ul>'
24
25
  write out
25
26
  end
@@ -86,9 +86,15 @@ module TomDoc
86
86
  process(ast[3], new_scope)
87
87
  when :imethod
88
88
  ast.shift
89
+ if !scope
90
+ scope = (@scopes[:main] ||= Scope.new(:main))
91
+ end
89
92
  scope.instance_methods << Method.new(*ast)
90
93
  when :cmethod
91
94
  ast.shift
95
+ if !scope
96
+ scope = (@scopes[:main] ||= Scope.new(:main))
97
+ end
92
98
  scope.class_methods << Method.new(*ast)
93
99
  when Array
94
100
  ast.map { |a| process(a, scope) }
@@ -66,6 +66,8 @@ module TomDoc
66
66
  args = []
67
67
  last_indent = nil
68
68
 
69
+ return args unless sections[1]
70
+
69
71
  sections[1].split("\n").each do |line|
70
72
  next if line.strip.empty?
71
73
  indent = line.scan(/^\s*/)[0].to_s.size
@@ -1,3 +1,3 @@
1
1
  module TomDoc
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -5,7 +5,7 @@ require 'test/fixtures/multiplex'
5
5
  require 'tomdoc'
6
6
 
7
7
  module TomDoc
8
- class Test < Test::Unit::TestCase
8
+ class Test < ::Test::Unit::TestCase
9
9
  def self.test(name, &block)
10
10
  define_method("test_#{name.gsub(/\W/,'_')}", &block) if block
11
11
  end
metadata CHANGED
@@ -1,29 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomdoc
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 23
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
- - 1
8
+ - 2
8
9
  - 0
9
- version: 0.1.0
10
+ version: 0.2.0
10
11
  platform: ruby
11
12
  authors:
13
+ - Tom Preston-Werner
12
14
  - Chris Wanstrath
13
15
  autorequire:
14
16
  bindir: bin
15
17
  cert_chain: []
16
18
 
17
- date: 2010-05-11 00:00:00 -07:00
18
- default_executable:
19
+ date: 2011-05-22 00:00:00 Z
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: sexp_processor
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
- - - "="
27
+ - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 15
27
30
  segments:
28
31
  - 3
29
32
  - 0
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: ParseTree
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
- - - "="
43
+ - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 13
41
46
  segments:
42
47
  - 3
43
48
  - 0
@@ -49,9 +54,11 @@ dependencies:
49
54
  name: RubyInline
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
- - - "="
59
+ - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 27
55
62
  segments:
56
63
  - 3
57
64
  - 7
@@ -63,9 +70,11 @@ dependencies:
63
70
  name: ruby_parser
64
71
  prerelease: false
65
72
  requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
66
74
  requirements:
67
- - - "="
75
+ - - ">="
68
76
  - !ruby/object:Gem::Version
77
+ hash: 7
69
78
  segments:
70
79
  - 2
71
80
  - 0
@@ -73,6 +82,20 @@ dependencies:
73
82
  version: 2.0.4
74
83
  type: :runtime
75
84
  version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: colored
87
+ prerelease: false
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ type: :runtime
98
+ version_requirements: *id005
76
99
  description: " TomDoc is flexible code documentation with human readers in\n mind. The tomdoc gem is a Ruby library to discover and display\n TomDoc'd methods and classes.\n\n Given a Ruby file with TomDoc'd methods, tomdoc can generate HTML or\n print to the console. You can use it to query up a single method or\n a group of methods, and it's usable from irb.\n\n If you're using TomDoc, tomdoc is for you.\n"
77
100
  email: chris@ozmm.org
78
101
  executables:
@@ -85,31 +108,30 @@ files:
85
108
  - README.md
86
109
  - Rakefile
87
110
  - LICENSE
88
- - lib/tomdoc/arg.rb
89
- - lib/tomdoc/cli.rb
90
- - lib/tomdoc/generator.rb
111
+ - lib/tomdoc.rb
91
112
  - lib/tomdoc/generators/console.rb
92
113
  - lib/tomdoc/generators/html.rb
93
- - lib/tomdoc/method.rb
94
- - lib/tomdoc/scope.rb
114
+ - lib/tomdoc/cli.rb
95
115
  - lib/tomdoc/source_parser.rb
96
- - lib/tomdoc/tomdoc.rb
97
116
  - lib/tomdoc/version.rb
98
- - lib/tomdoc.rb
117
+ - lib/tomdoc/tomdoc.rb
118
+ - lib/tomdoc/generator.rb
119
+ - lib/tomdoc/scope.rb
120
+ - lib/tomdoc/arg.rb
121
+ - lib/tomdoc/method.rb
99
122
  - bin/tomdoc
100
123
  - man/tomdoc.5
101
124
  - man/tomdoc.5.html
102
125
  - man/tomdoc.5.ronn
103
- - test/console_generator_test.rb
104
- - test/fixtures/chimney.rb
105
- - test/fixtures/multiplex.rb
106
- - test/fixtures/simple.rb
107
- - test/generator_test.rb
108
- - test/helper.rb
109
126
  - test/html_generator_test.rb
110
127
  - test/source_parser_test.rb
111
128
  - test/tomdoc_parser_test.rb
112
- has_rdoc: true
129
+ - test/helper.rb
130
+ - test/console_generator_test.rb
131
+ - test/generator_test.rb
132
+ - test/fixtures/multiplex.rb
133
+ - test/fixtures/chimney.rb
134
+ - test/fixtures/simple.rb
113
135
  homepage: http://github.com/defunkt/tomdoc
114
136
  licenses: []
115
137
 
@@ -119,23 +141,27 @@ rdoc_options: []
119
141
  require_paths:
120
142
  - lib
121
143
  required_ruby_version: !ruby/object:Gem::Requirement
144
+ none: false
122
145
  requirements:
123
146
  - - ">="
124
147
  - !ruby/object:Gem::Version
148
+ hash: 3
125
149
  segments:
126
150
  - 0
127
151
  version: "0"
128
152
  required_rubygems_version: !ruby/object:Gem::Requirement
153
+ none: false
129
154
  requirements:
130
155
  - - ">="
131
156
  - !ruby/object:Gem::Version
157
+ hash: 3
132
158
  segments:
133
159
  - 0
134
160
  version: "0"
135
161
  requirements: []
136
162
 
137
163
  rubyforge_project:
138
- rubygems_version: 1.3.6
164
+ rubygems_version: 1.8.2
139
165
  signing_key:
140
166
  specification_version: 3
141
167
  summary: A TomDoc library for Ruby.