rdoc-markdown 0.1.10 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d08a05e31cacde411267507404584cf8b83a715e2001290e84f4b0ae3494106
4
- data.tar.gz: cf679c7121051ed3c3dfe7615e9ef559d2ec8b023e2b1efd9666d9caa2de5ae7
3
+ metadata.gz: e8541f95990a90cf56b56fc4ac7ddc00ee027327023a127063c30cb1b87449b6
4
+ data.tar.gz: b00c270ed9c64a36120900e0bfb8eb794afda0ab1b28cdb4cbc51c016b9c4999
5
5
  SHA512:
6
- metadata.gz: 9cbbf2f3f6fc21e199d426ed08d71c734f09daf155bb5bc9b37a65662094c735047f76cfe8d84e3ee92a3b998e21e3cbbf643b6f0702ab14a67467773b028ead
7
- data.tar.gz: 4a9e28997fd4cda40d0510f29f9bc04a78a30140e5631dd0be4a38b7bfc9ae4a65d3fbae14de8d4d1853cac2c60b8ddf4a399653a171c757b605397368e193fc
6
+ metadata.gz: 58ba2c78a1f23cea5738a2e65df6468a4c70da00fb8654affd479cb2ed244930fa63c56d91451d83c0475c1c31102319af9970f3d9d7f000ea04bfecd146616a
7
+ data.tar.gz: 5960431dc78731a5b65b57a004b6982e7eac883ed1bc2306e92bf34f3948bd3bf33494e3daac4dab1685a1d19e6b8831993247cfd1d91ee8ae0852c483c79453
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdoc-markdown (0.1.7)
4
+ rdoc-markdown (0.1.10)
5
5
  erb (~> 2.0)
6
+ extralite-bundle (~> 1.0)
6
7
  rdoc (~> 6.0)
7
8
  reverse_markdown (~> 2.0)
8
9
 
@@ -13,6 +14,7 @@ GEM
13
14
  cgi (0.3.3)
14
15
  erb (2.2.3)
15
16
  cgi
17
+ extralite-bundle (1.16)
16
18
  json (2.6.2)
17
19
  minitest (5.16.3)
18
20
  nokogiri (1.13.8-arm64-darwin)
@@ -5,6 +5,7 @@ gem "rdoc"
5
5
  require "pathname"
6
6
  require "erb"
7
7
  require "reverse_markdown"
8
+ require 'extralite'
8
9
 
9
10
  class RDoc::Generator::Markdown
10
11
  RDoc::RDoc.add_generator self
@@ -60,6 +61,10 @@ class RDoc::Generator::Markdown
60
61
  debug("Generate documentation in #{@output_dir}")
61
62
 
62
63
  emit_classfiles
64
+
65
+ debug("Generate index db file: #{output_dir}/index.db")
66
+
67
+ emit_sqlite
63
68
  end
64
69
 
65
70
  private
@@ -74,6 +79,29 @@ class RDoc::Generator::Markdown
74
79
  end
75
80
  end
76
81
 
82
+ def emit_sqlite
83
+ db = Extralite::Database.new("#{output_dir}/index.db")
84
+
85
+ db.execute <<-SQL
86
+ create table contentIndex (
87
+ id INTEGER PRIMARY KEY,
88
+ name TEXT,
89
+ type TEXT,
90
+ path TEXT
91
+ );
92
+ SQL
93
+
94
+ @classes.map do |klass|
95
+ {
96
+ name: klass.full_name,
97
+ type: klass.type.capitalize,
98
+ path: turn_to_path(klass.full_name)
99
+ }
100
+ end.each do |rec|
101
+ db.execute "insert into contentIndex (name, type, path) values (:name, :type, :path)", rec
102
+ end
103
+ end
104
+
77
105
  def emit_classfiles
78
106
  @classes.each do |klass|
79
107
  klass_methods = []
@@ -91,7 +119,7 @@ class RDoc::Generator::Markdown
91
119
 
92
120
  template = ERB.new File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
93
121
 
94
- out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}.md")
122
+ out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}")
95
123
  out_file.dirname.mkpath
96
124
 
97
125
  result = template.result(binding)
@@ -104,7 +132,7 @@ class RDoc::Generator::Markdown
104
132
  private
105
133
 
106
134
  def turn_to_path(class_name)
107
- class_name.gsub("::", "/")
135
+ "#{class_name.gsub("::", "/")}.md"
108
136
  end
109
137
 
110
138
  def markdownify(input)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rdoc
4
4
  module Markdown
5
- VERSION = "0.1.10"
5
+ VERSION = "0.1.12"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav (Stas) Katkov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-16 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: extralite-bundle
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: minitest
57
71
  requirement: !ruby/object:Gem::Requirement