rdoc-markdown 0.5.0 → 0.7.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/Gemfile.lock CHANGED
@@ -1,67 +1,203 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdoc-markdown (0.5.0)
4
+ rdoc-markdown (0.7.0)
5
5
  csv
6
6
  erb
7
7
  rdoc
8
8
  reverse_markdown
9
- unindent
10
9
 
11
10
  GEM
12
11
  remote: https://rubygems.org/
13
12
  specs:
14
- cgi (0.4.1)
15
- csv (3.3.2)
16
- date (3.4.1)
17
- erb (4.0.4)
18
- cgi (>= 0.3.3)
19
- minitest (5.25.4)
20
- nokogiri (1.18.0-aarch64-linux-gnu)
13
+ actionview (8.1.3)
14
+ activesupport (= 8.1.3)
15
+ builder (~> 3.1)
16
+ erubi (~> 1.11)
17
+ rails-dom-testing (~> 2.2)
18
+ rails-html-sanitizer (~> 1.6)
19
+ activesupport (8.1.3)
20
+ base64
21
+ bigdecimal
22
+ concurrent-ruby (~> 1.0, >= 1.3.1)
23
+ connection_pool (>= 2.2.5)
24
+ drb
25
+ i18n (>= 1.6, < 2)
26
+ json
27
+ logger (>= 1.4.2)
28
+ minitest (>= 5.1)
29
+ securerandom (>= 0.3)
30
+ tzinfo (~> 2.0, >= 2.0.5)
31
+ uri (>= 0.13.1)
32
+ ast (2.4.3)
33
+ base64 (0.3.0)
34
+ better_html (2.2.0)
35
+ actionview (>= 7.0)
36
+ activesupport (>= 7.0)
37
+ ast (~> 2.0)
38
+ erubi (~> 1.4)
39
+ parser (>= 2.4)
40
+ smart_properties
41
+ bigdecimal (4.1.2)
42
+ builder (3.3.0)
43
+ commonmarker (2.8.1-x86_64-linux)
44
+ concurrent-ruby (1.3.6)
45
+ connection_pool (3.0.2)
46
+ crass (1.0.6)
47
+ csv (3.3.5)
48
+ date (3.5.1)
49
+ diff-lcs (2.0.0)
50
+ docile (1.4.1)
51
+ drb (2.2.3)
52
+ erb (6.0.4)
53
+ erb_lint (0.9.0)
54
+ activesupport
55
+ better_html (>= 2.0.1)
56
+ parser (>= 2.7.1.4)
57
+ rainbow
58
+ rubocop (>= 1)
59
+ smart_properties
60
+ erubi (1.13.1)
61
+ i18n (1.14.8)
62
+ concurrent-ruby (~> 1.0)
63
+ io-console (0.8.2)
64
+ irb (1.18.0)
65
+ pp (>= 0.6.0)
66
+ prism (>= 1.3.0)
67
+ rdoc (>= 4.0.0)
68
+ reline (>= 0.4.2)
69
+ json (2.19.4)
70
+ language_server-protocol (3.17.0.5)
71
+ lint_roller (1.1.0)
72
+ logger (1.7.0)
73
+ loofah (2.25.1)
74
+ crass (~> 1.0.2)
75
+ nokogiri (>= 1.12.0)
76
+ minitest (5.27.0)
77
+ minitest-strict (1.0.0)
78
+ minitest (>= 5.21, < 7)
79
+ mutant (0.16.2)
80
+ diff-lcs (>= 1.6, < 3)
81
+ irb (~> 1.15)
82
+ parser (~> 3.3.10)
83
+ regexp_parser (~> 2.10)
84
+ securerandom (>= 0.3)
85
+ sorbet-runtime (~> 0.6.0)
86
+ unparser (>= 0.8.2, < 0.10)
87
+ mutant-minitest (0.16.2)
88
+ minitest (>= 5.11, < 7)
89
+ mutant (= 0.16.2)
90
+ mutex_m (~> 0.2)
91
+ mutex_m (0.3.0)
92
+ nokogiri (1.19.2-x86_64-linux-gnu)
21
93
  racc (~> 1.4)
22
- nokogiri (1.18.0-aarch64-linux-musl)
23
- racc (~> 1.4)
24
- nokogiri (1.18.0-arm-linux-gnu)
25
- racc (~> 1.4)
26
- nokogiri (1.18.0-arm-linux-musl)
27
- racc (~> 1.4)
28
- nokogiri (1.18.0-arm64-darwin)
29
- racc (~> 1.4)
30
- nokogiri (1.18.0-x86_64-darwin)
31
- racc (~> 1.4)
32
- nokogiri (1.18.0-x86_64-linux-gnu)
33
- racc (~> 1.4)
34
- nokogiri (1.18.0-x86_64-linux-musl)
35
- racc (~> 1.4)
36
- psych (5.2.2)
94
+ parallel (1.28.0)
95
+ parser (3.3.11.1)
96
+ ast (~> 2.4.1)
97
+ racc
98
+ pp (0.6.3)
99
+ prettyprint
100
+ prettyprint (0.2.0)
101
+ prism (1.9.0)
102
+ psych (5.3.1)
37
103
  date
38
104
  stringio
39
105
  racc (1.8.1)
40
- rake (13.2.1)
41
- rdiscount (2.2.7.3)
42
- rdoc (6.10.0)
106
+ rails-dom-testing (2.3.0)
107
+ activesupport (>= 5.0.0)
108
+ minitest
109
+ nokogiri (>= 1.6)
110
+ rails-html-sanitizer (1.7.0)
111
+ loofah (~> 2.25)
112
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
113
+ rainbow (3.1.1)
114
+ rake (13.4.2)
115
+ rdiscount (2.2.7.4)
116
+ rdoc (7.2.0)
117
+ erb
43
118
  psych (>= 4.0.0)
44
- reverse_markdown (3.0.0)
119
+ tsort
120
+ regexp_parser (2.12.0)
121
+ reline (0.6.3)
122
+ io-console (~> 0.5)
123
+ reverse_markdown (3.0.2)
45
124
  nokogiri
46
- stringio (3.1.2)
47
- unindent (1.0)
125
+ rubocop (1.84.2)
126
+ json (~> 2.3)
127
+ language_server-protocol (~> 3.17.0.2)
128
+ lint_roller (~> 1.1.0)
129
+ parallel (~> 1.10)
130
+ parser (>= 3.3.0.2)
131
+ rainbow (>= 2.2.2, < 4.0)
132
+ regexp_parser (>= 2.9.3, < 3.0)
133
+ rubocop-ast (>= 1.49.0, < 2.0)
134
+ ruby-progressbar (~> 1.7)
135
+ unicode-display_width (>= 2.4.0, < 4.0)
136
+ rubocop-ast (1.49.1)
137
+ parser (>= 3.3.7.2)
138
+ prism (~> 1.7)
139
+ rubocop-performance (1.26.1)
140
+ lint_roller (~> 1.1)
141
+ rubocop (>= 1.75.0, < 2.0)
142
+ rubocop-ast (>= 1.47.1, < 2.0)
143
+ ruby-progressbar (1.13.0)
144
+ securerandom (0.4.1)
145
+ simplecov (0.22.0)
146
+ docile (~> 1.1)
147
+ simplecov-html (~> 0.11)
148
+ simplecov_json_formatter (~> 0.1)
149
+ simplecov-html (0.13.2)
150
+ simplecov_json_formatter (0.1.4)
151
+ smart_properties (1.17.0)
152
+ sorbet-runtime (0.6.13163)
153
+ standard (1.54.0)
154
+ language_server-protocol (~> 3.17.0.2)
155
+ lint_roller (~> 1.0)
156
+ rubocop (~> 1.84.0)
157
+ standard-custom (~> 1.0.0)
158
+ standard-performance (~> 1.8)
159
+ standard-custom (1.0.2)
160
+ lint_roller (~> 1.0)
161
+ rubocop (~> 1.50)
162
+ standard-performance (1.9.0)
163
+ lint_roller (~> 1.1)
164
+ rubocop-performance (~> 1.26.0)
165
+ stringio (3.2.0)
166
+ tsort (0.2.0)
167
+ tzinfo (2.0.6)
168
+ concurrent-ruby (~> 1.0)
169
+ unicode-display_width (3.2.0)
170
+ unicode-emoji (~> 4.1)
171
+ unicode-emoji (4.2.0)
172
+ unparser (0.9.0)
173
+ diff-lcs (>= 1.6, < 3)
174
+ parser (>= 3.3.0)
175
+ prism (>= 1.5.1)
176
+ uri (1.1.1)
177
+ yard (0.9.43)
178
+ yard-lint (1.5.1)
179
+ yard (~> 0.9)
180
+ zeitwerk (~> 2.6)
181
+ zeitwerk (2.7.5)
48
182
 
49
183
  PLATFORMS
50
- aarch64-linux-gnu
51
- aarch64-linux-musl
52
- arm-linux-gnu
53
- arm-linux-musl
54
- arm64-darwin
55
- x86_64-darwin
56
184
  x86_64-linux-gnu
57
- x86_64-linux-musl
58
185
 
59
186
  DEPENDENCIES
60
- bundler (~> 2.0)
187
+ bundler (>= 2.0)
188
+ commonmarker
189
+ erb_lint
61
190
  minitest (~> 5.0)
191
+ minitest-strict (~> 1.0)
192
+ mutant
193
+ mutant-minitest
194
+ mutex_m
62
195
  rake (~> 13.0)
63
196
  rdiscount (~> 2.0)
64
197
  rdoc-markdown!
198
+ simplecov (~> 0.22)
199
+ standard
200
+ yard-lint
65
201
 
66
202
  BUNDLED WITH
67
- 2.6.1
203
+ 4.0.10
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # RDoc-Markdown
2
- RDoc plugin to generate markdown documentation and search index backed by sqlite database.
2
+ RDoc plugin to generate markdown documentation and search index file (CSV).
3
+
4
+ ## Motivation
5
+ Markdown has become the de-facto documentation standard. I heavily rely on Obsidian to render my storage of markdown notes. But markdown is used not just for scribbles, supported is far and wide. We can render markdown file on any device, probably even on thermometer with a screen. But also everyone knows enough markdown to be dangerous (or productive).
6
+
7
+ It's a pitty that rdoc and yard can't output a proper markdown file. I would like to change that.
3
8
 
4
9
  ## Installation
5
10
 
@@ -23,6 +28,13 @@ Run following command in directory with ruby source code:
23
28
 
24
29
  This will produce a tree of markdown documents and search index in `/doc` folder. Every class in library will have it's own markdown file.
25
30
 
31
+ ## Note on index.csv file
32
+ This gem emits index of all markdown files in a index.csv file.
33
+
34
+ There are decent tools that offer search through structured plain-text files. But my expectation is that nobody will use CSV as an actual search index, but rather import it into something that performs this function better.
35
+
36
+ In my personal use-case, I use SQLite. All other databases seem to have a good support for CSV imports.
37
+
26
38
  ## Development
27
39
  Biggest issue is testing this locally, but that's not as hard to do these days.
28
40
 
@@ -45,7 +57,73 @@ Following command should run entire testsuit:
45
57
  ```
46
58
  rake test
47
59
  ```
60
+ The test suite loads `minitest-strict`, so boolean and nil assertions only pass on exact `true`, `false`, and `nil` values.
48
61
  Testing is not excessive, just verifies that basic functionality is operational.
62
+
63
+ To validate generated markdown against GitHub Flavored Markdown and check local links/anchors:
64
+
65
+ ```
66
+ rake markdown:validate
67
+ ```
68
+
69
+ This task validates:
70
+
71
+ - generated sample docs,
72
+ - checked-in `example/` docs,
73
+ - vendored minitest docs,
74
+ - vendored rails docs (Active Support, Active Record, Action Pack, Railties slices).
75
+
76
+ Validation artifacts are written to `tmp/markdown-validate/` inside this repository.
77
+ To fail on every unresolved vendor local link/anchor, run with:
78
+
79
+ ```
80
+ MARKDOWN_VALIDATE_STRICT_VENDOR=1 rake markdown:validate
81
+ ```
82
+
83
+ This task is also executed in CI.
84
+
85
+ To lint markdown ERB templates:
86
+
87
+ ```
88
+ bundle exec rake erb:lint
89
+ ```
90
+
91
+ ### Integration harness: minitest
92
+ To run the integration harness against minitest (aligned with docs.seattlerb.org/minitest):
93
+
94
+ ```
95
+ rake vendor:setup:minitest
96
+ bundle exec rake test
97
+ ```
98
+
99
+ The harness validates markdown formatting quality, generated page files, class/module paths, and search index output.
100
+
101
+ ### Integration harness: rails
102
+ To run the rails harness (focused on Active Support + Active Record API docs with sdoc-like structure):
103
+
104
+ ```
105
+ rake vendor:setup:rails
106
+ bundle exec rake test
107
+ ```
108
+
109
+ The rails harness validates alias rendering, preserved code blocks, file/page links rewritten to markdown, and index stability (no synthetic nested class names).
110
+
111
+ ### Generate vendored docs
112
+ Use rake tasks to generate markdown output for vendored projects:
113
+
114
+ ```
115
+ rake vendor:setup
116
+ rake vendor:docs:minitest
117
+ rake vendor:docs:rails
118
+ # or generate both
119
+ rake vendor:docs
120
+ ```
121
+
122
+ Output is written to:
123
+
124
+ - `vendor/docs/minitest`
125
+ - `vendor/docs/rails`
126
+
49
127
  ## Release
50
128
  ```
51
129
  gem build rdoc-markdown.gemspec
data/Rakefile CHANGED
@@ -1,5 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
+ require "fileutils"
4
+ require "rdoc/rdoc"
5
+ require "rdoc/markdown"
6
+ require_relative "test/support/markdown_validator"
3
7
 
4
8
  Rake::TestTask.new do |t|
5
9
  t.verbose = true
@@ -8,3 +12,177 @@ Rake::TestTask.new do |t|
8
12
  end
9
13
 
10
14
  task default: [:test]
15
+
16
+ namespace :erb do
17
+ desc "Lint markdown ERB templates"
18
+ task :lint do
19
+ sh "bundle exec erb_lint --lint-all"
20
+ end
21
+ end
22
+
23
+ namespace :markdown do
24
+ desc "Validate generated markdown as GitHub Flavored Markdown"
25
+ task :validate do
26
+ strict_vendor_links = ENV["MARKDOWN_VALIDATE_STRICT_VENDOR"] == "1"
27
+ validation_root = File.expand_path("tmp/markdown-validate", __dir__)
28
+ FileUtils.rm_rf(validation_root)
29
+ FileUtils.mkdir_p(validation_root)
30
+
31
+ sample_output = File.join(validation_root, "sample")
32
+ generate_markdown_docs(
33
+ title: "sample",
34
+ root: File.expand_path("test/data", __dir__),
35
+ output: sample_output,
36
+ files: [File.expand_path("test/data/example.rb", __dir__)]
37
+ )
38
+
39
+ sample_count = MarkdownValidator.new(sample_output).validate!
40
+ puts "Validated #{sample_count} markdown files in #{sample_output}"
41
+
42
+ example_dir = File.expand_path("example", __dir__)
43
+ if Dir.exist?(example_dir)
44
+ example_count = MarkdownValidator.new(example_dir).validate!
45
+ puts "Validated #{example_count} markdown files in #{example_dir}"
46
+ end
47
+
48
+ Rake::Task["vendor:setup:minitest"].invoke
49
+ minitest_root = File.expand_path("vendor/minitest", __dir__)
50
+ minitest_output = File.join(validation_root, "minitest")
51
+ generate_markdown_docs(
52
+ title: "minitest",
53
+ root: minitest_root,
54
+ output: minitest_output,
55
+ files: minitest_docs_files(minitest_root)
56
+ )
57
+ minitest_validator = MarkdownValidator.new(minitest_output, strict_links: strict_vendor_links)
58
+ minitest_count = minitest_validator.validate!
59
+ puts "Validated #{minitest_count} markdown files in #{minitest_output}"
60
+ puts "Skipped #{minitest_validator.unresolved_links} unresolved local links in vendored minitest docs"
61
+
62
+ Rake::Task["vendor:setup:rails"].invoke
63
+ rails_root = File.expand_path("vendor/rails", __dir__)
64
+ rails_output = File.join(validation_root, "rails")
65
+ generate_markdown_docs(
66
+ title: "rails validation",
67
+ root: rails_root,
68
+ output: rails_output,
69
+ files: rails_validation_files(rails_root)
70
+ )
71
+ rails_validator = MarkdownValidator.new(rails_output, strict_links: strict_vendor_links)
72
+ rails_count = rails_validator.validate!
73
+ puts "Validated #{rails_count} markdown files in #{rails_output}"
74
+ puts "Skipped #{rails_validator.unresolved_links} unresolved local links in vendored rails docs"
75
+
76
+ puts "Markdown validation artifacts written to #{validation_root}"
77
+ end
78
+ end
79
+
80
+ def ensure_git_checkout(path:, url:, ref: nil)
81
+ return if Dir.exist?(path)
82
+
83
+ FileUtils.mkdir_p(File.dirname(path))
84
+
85
+ clone_command = ["git", "clone", "--depth", "1"]
86
+ clone_command += ["--branch", ref] if ref
87
+ clone_command += [url, path]
88
+
89
+ sh clone_command.join(" ")
90
+ end
91
+
92
+ def generate_markdown_docs(title:, root:, output:, files:)
93
+ raise "No input files for #{title}" if files.empty?
94
+
95
+ FileUtils.rm_rf(output)
96
+ FileUtils.mkdir_p(output)
97
+
98
+ options = RDoc::Options.new
99
+ options.setup_generator("markdown")
100
+ options.verbosity = 0
101
+ options.files = files
102
+ options.op_dir = output
103
+ options.root = root
104
+ options.title = title
105
+ options.force_output = true
106
+
107
+ RDoc::RDoc.new.document(options)
108
+ end
109
+
110
+ def minitest_docs_files(root)
111
+ files = Dir[File.join(root, "lib/**/*.rb")]
112
+ files.concat(Dir[File.join(root, "*.rdoc")])
113
+
114
+ files.uniq
115
+ end
116
+
117
+ def rails_validation_files(root)
118
+ files = Dir[File.join(root, "activesupport/lib/**/*.rb")]
119
+ files.concat(Dir[File.join(root, "activerecord/lib/**/*.rb")])
120
+ files.concat(Dir[File.join(root, "actionpack/lib/**/*.rb")])
121
+ files.concat(Dir[File.join(root, "railties/lib/**/*.rb")])
122
+
123
+ [
124
+ "activerecord/README.rdoc",
125
+ "actionpack/README.rdoc",
126
+ "railties/README.rdoc",
127
+ "railties/RDOC_MAIN.md"
128
+ ].each do |relative_path|
129
+ file = File.join(root, relative_path)
130
+ files << file if File.file?(file)
131
+ end
132
+
133
+ files.uniq
134
+ end
135
+
136
+ namespace :vendor do
137
+ namespace :setup do
138
+ minitest_ref = "v6.0.1"
139
+ rails_ref = ENV.fetch("RAILS_REF", "main")
140
+
141
+ desc "Clone/update vendor/minitest and checkout docs-aligned tag"
142
+ task :minitest do
143
+ ensure_git_checkout(path: "vendor/minitest", url: "https://github.com/minitest/minitest.git", ref: minitest_ref)
144
+ Dir.chdir("vendor/minitest") { sh "git checkout #{minitest_ref}" }
145
+ end
146
+
147
+ desc "Clone/update vendor/rails"
148
+ task :rails do
149
+ ensure_git_checkout(path: "vendor/rails", url: "https://github.com/rails/rails.git", ref: rails_ref)
150
+ end
151
+ end
152
+
153
+ desc "Prepare all vendored repositories"
154
+ task setup: ["vendor:setup:minitest", "vendor:setup:rails"]
155
+
156
+ namespace :docs do
157
+ desc "Generate markdown docs for vendored minitest"
158
+ task :minitest do
159
+ root = File.expand_path("vendor/minitest", __dir__)
160
+ raise "Missing vendor/minitest. Run `rake vendor:setup:minitest` first." unless Dir.exist?(root)
161
+
162
+ output = File.expand_path("vendor/docs/minitest", __dir__)
163
+ generate_markdown_docs(title: "minitest", root: root, output: output, files: minitest_docs_files(root))
164
+ puts "Generated minitest markdown docs in #{output}"
165
+ end
166
+
167
+ desc "Generate markdown docs for vendored rails"
168
+ task :rails do
169
+ root = File.expand_path("vendor/rails", __dir__)
170
+ raise "Missing vendor/rails. Run `rake vendor:setup:rails` first." unless Dir.exist?(root)
171
+
172
+ files = Dir[File.join(root, "*/lib/**/*.rb")]
173
+
174
+ active_record_readme = File.join(root, "activerecord/README.rdoc")
175
+ files << active_record_readme if File.file?(active_record_readme)
176
+
177
+ output = File.expand_path("vendor/docs/rails", __dir__)
178
+ generate_markdown_docs(title: "rails", root: root, output: output, files: files)
179
+ puts "Generated rails markdown docs in #{output}"
180
+ end
181
+
182
+ desc "Generate markdown docs for all vendored repositories"
183
+ task all: [:minitest, :rails]
184
+ end
185
+
186
+ desc "Generate markdown docs for all vendored repositories"
187
+ task docs: ["vendor:docs:all"]
188
+ end
data/example/Bird.md CHANGED
@@ -1,18 +1,24 @@
1
- # class Bird [](#class-Bird) [](#top)
1
+ # Class Bird
2
+ <a id="class-Bird"></a>
3
+
2
4
  The base class for all birds.
3
5
 
4
- ## Public Instance Methods
5
- ### fly(string, number) -> bool [](#method-i-fly)
6
- Fly somewhere.
6
+ ### Public Instance Methods
7
+
8
+ #### `fly(direction: string, velocity: number) -> bool`
9
+ <a id="method-i-fly"></a>
10
+
11
+ Fly somewhere.
7
12
 
8
13
  Flying is the most critical feature of birds.
9
14
 
10
- # Example[¶](#method-i-fly-label-Example) [↑](#top)
15
+ ##### Example
11
16
 
12
17
  ```
13
- fly(:south,70)
18
+ fly(:south, 70)
14
19
  ```
15
- ### speak() { |text| ... } [](#method-i-speak)
16
- Produce some noise.
17
20
 
18
-
21
+ #### `speak() { |text| ... }`
22
+ <a id="method-i-speak"></a>
23
+
24
+ Produce some noise.
data/example/Duck.md CHANGED
@@ -1,52 +1,64 @@
1
- # class Duck [](#class-Duck) [](#top)
2
- A duck is a [`Waterfowl`](Waterfowl.html) [`Bird`](Bird.html).
1
+ # Class Duck
2
+ <a id="class-Duck"></a>
3
+
4
+ A duck is a [`Waterfowl`](Waterfowl.md) [`Bird`](Bird.md).
3
5
 
4
6
  Features:
5
7
 
6
- ```
7
- bird::
8
-
9
- * speak
10
- * fly
11
-
12
- waterfowl::
13
-
14
- * swim
15
- ```
16
- ## Constants
17
- | Name | Description |
18
- | ---- | ----------- |
19
- | **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
20
- # Bird overrides
21
- ## Constants
22
- | Name | Description |
23
- | ---- | ----------- |
24
- | **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
25
- ## Public Instance Methods
26
- ### speak() { |speech| ... } [](#method-i-speak)
27
- [`Duck`](Duck.html) overrides generic implementation.
28
-
29
- # Duck extensions
30
- ## Constants
31
- | Name | Description |
32
- | ---- | ----------- |
33
- | **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
34
- ## Attributes
35
- ### domestic[RW] [](#attribute-i-domestic)
36
- True for domestic ducks.
37
-
38
- ### rubber[R] [](#attribute-i-rubber)
39
- True for rubber ducks.
40
-
41
- ## Public Class Methods
42
- ### new(domestic, rubber) [](#method-c-new)
43
- Creates a new duck.
44
-
45
- ### rubber_ducks() [](#method-c-rubber_ducks)
46
- Returns list of all rubber ducks.
47
-
48
- ## Public Instance Methods
49
- ### useful? -> bool [](#method-i-useful-3F)
50
- Checks if this duck is a useful one.
51
-
52
-
8
+ bird:
9
+
10
+ - speak
11
+ - fly
12
+
13
+ waterfowl:
14
+
15
+ - swim
16
+
17
+ ## Bird overrides
18
+
19
+ ### Public Instance Methods
20
+
21
+ #### `speak() { |speech| ... }`
22
+ <a id="method-i-speak"></a>
23
+
24
+ [`Duck`](Duck.md) overrides generic implementation.
25
+
26
+ ## Duck extensions
27
+
28
+ ### Constants
29
+
30
+ #### `MAX_VELOCITY`
31
+ <a id="MAX_VELOCITY"></a>
32
+
33
+ Not documented.
34
+
35
+ ### Attributes
36
+
37
+ #### `domestic` [RW]
38
+ <a id="attribute-i-domestic"></a>
39
+
40
+ True for domestic ducks.
41
+
42
+ #### `rubber` [R]
43
+ <a id="attribute-i-rubber"></a>
44
+
45
+ True for rubber ducks.
46
+
47
+ ### Public Class Methods
48
+
49
+ #### `new(domestic, rubber)`
50
+ <a id="method-c-new"></a>
51
+
52
+ Creates a new duck.
53
+
54
+ #### `rubber_ducks()`
55
+ <a id="method-c-rubber_ducks"></a>
56
+
57
+ Returns list of all rubber ducks.
58
+
59
+ ### Public Instance Methods
60
+
61
+ #### `useful? -> bool`
62
+ <a id="method-i-useful-3F"></a>
63
+
64
+ Checks if this duck is a useful one.
data/example/Object.md CHANGED
@@ -1,6 +1,9 @@
1
- # class Object [](#class-Object) [](#top)
2
- ## Constants
3
- | Name | Description |
4
- | ---- | ----------- |
5
- | **DEFAULT_DUCK_VELOCITY[](#DEFAULT_DUCK_VELOCITY)** | Default velocity for a flying duck. |
6
-
1
+ # Class Object
2
+ <a id="class-Object"></a>
3
+
4
+ ### Constants
5
+
6
+ #### `DEFAULT_DUCK_VELOCITY`
7
+ <a id="DEFAULT_DUCK_VELOCITY"></a>
8
+
9
+ Default velocity for a flying duck.