sdoc 2.2.0 → 2.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 002ca37375a4f9d51c68f2c7ac421cec8c4baf74171615627e828fbf8947bc48
4
- data.tar.gz: 06f44cb76f359c63d97a0b9e5c0eb5c5b06277c700928006e2e390c05955eb17
3
+ metadata.gz: 70eb2edc18b9ea26f3e275f9e7cbe89b1ce69af8c94fe4e0757ade7d39585d65
4
+ data.tar.gz: 9358e5e14fc3e26fd5c39f9ff348c4e5ee0cf569921256de2234006b5055ff68
5
5
  SHA512:
6
- metadata.gz: b48d64b1e6c87db2088e56c692ed31c8f85fef24e640b18a5c4f609966f7d0b912d78a2e2a973bfffc2bbbecf1ffb3bfb5f16adeecc69780f3e7286850a8f92a
7
- data.tar.gz: 9e59249e7ea77c4057c1a741e9d4dd6c6fe058ba63fe976d88e20806520d7ce8b219aa5b04acc0943b8f91b0abfb11d97e9fb2d28360381cf893a5c7f8ec3b7f
6
+ metadata.gz: d001cb3198db3cdd7db808a56d7c06325d126a73b93de6240e1826abc6a0b7ad7743b21b67e289289ed35346192164e44900702191def749a5c22ec833f39569
7
+ data.tar.gz: 731ad61d0e0ac791e02050d173cc97eab604634c3e9252ed691d2714142b97c0e7f19a30fa9eddda56516fc2e3f46f7d393f0c36d3a3aaad49c28dddcbbca14c
@@ -31,6 +31,7 @@ jobs:
31
31
  with:
32
32
  ruby-version: ${{ matrix.ruby }}
33
33
  bundler-cache: true
34
+ cache-version: 1
34
35
 
35
36
  - name: Test
36
37
  run: |
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  Master
2
2
  ======
3
3
 
4
+ 2.3.0
5
+ =====
6
+
7
+ * #178 Don't use rdoc 6.4.0 for now [@p8](https://github.com/p8)
8
+ * #177 Remove rake version constraint for ruby head [@p8](https://github.com/p8)
9
+ * #176 Make sidepanel work with relative paths/URLs [@p8](https://github.com/p8)
10
+ * #175 Avoid displaying source toggler for ghost methods [Robin Dupret](https://github.com/robin850)
11
+ * #174 Suppress unused variable warnings [Masataka Pocke Kuwabara](https://github.com/pocke)
12
+
4
13
  2.2.0
5
14
  =====
6
15
 
data/Gemfile CHANGED
@@ -2,9 +2,15 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rake", "< 11"
6
- gem "minitest"
5
+ gem "rack"
6
+ gem "rake"
7
7
  gem "hoe"
8
+ gem "minitest"
9
+
10
+
11
+ if RUBY_VERSION.to_f <= 2.5
12
+ gem "psych", "< 4.0"
13
+ end
8
14
 
9
15
  if ENV["rdoc"] == "master"
10
16
  gem "rdoc", :github => "ruby/rdoc"
@@ -195,12 +195,20 @@
195
195
  else
196
196
  false
197
197
  end
198
+
199
+ ghost = method.instance_of?(RDoc::GhostMethod)
198
200
  %>
199
201
  <p class="source-link">
200
- Source:
201
- <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
202
+ <% if !ghost || github %> Source: <% end %>
203
+
204
+ <% unless ghost %>
205
+ <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
206
+ <% end %>
207
+
208
+ <% if !ghost && github %> | <% end %>
209
+
202
210
  <% if github %>
203
- | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
211
+ <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
204
212
  <% end %>
205
213
  </p>
206
214
  <div id="<%= method.aref %>_source" class="dyn-source">
@@ -1,22 +1,14 @@
1
- <%
2
- # Turbolinks does not consider relative urls similar, resulting in page
3
- # reloads and losing the context of the panel. Emptying the rel_prefix makes
4
- # asset paths absolute. This breaks opening the docs locally. Maybe all
5
- # generated docs should be in the same folder?
6
- rel_prefix = ''
7
- %>
8
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/reset.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
9
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/panel.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
10
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/main.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
11
- <link rel="stylesheet" href="<%= "#{rel_prefix}/css/github.css" %>" type="text/css" media="screen" data-turbolinks-track="reload" />
12
- <script src="<%= "#{rel_prefix}/js/jquery-3.5.1.min.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
13
- <script src="<%= "#{rel_prefix}/js/main.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
14
- <script src="<%= "#{rel_prefix}/js/highlight.pack.js" %>" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
15
- <script src="<%= rel_prefix %>/js/turbolinks.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
16
- <script src="<%= rel_prefix %>/js/search_index.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
17
- <script src="<%= rel_prefix %>/js/searcher.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
18
- <script src="<%= rel_prefix %>/panel/tree.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
19
- <script src="<%= rel_prefix %>/js/searchdoc.js" type="text/javascript" charset="utf-8" data-turbolinks-track="reload"></script>
20
-
1
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/reset.css" type="text/css" media="screen" />
2
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/panel.css" type="text/css" media="screen" />
3
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/main.css" type="text/css" media="screen" />
4
+ <link rel="stylesheet" href="<%= rel_prefix %>/css/github.css" type="text/css" media="screen" />
5
+ <script src="<%= rel_prefix %>/js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
6
+ <script src="<%= rel_prefix %>/js/main.js" type="text/javascript" charset="utf-8"></script>
7
+ <script src="<%= rel_prefix %>/js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
8
+ <script src="<%= rel_prefix %>/js/turbolinks.js" type="text/javascript" charset="utf-8"></script>
9
+ <script src="<%= rel_prefix %>/js/search_index.js" type="text/javascript" charset="utf-8"></script>
10
+ <script src="<%= rel_prefix %>/js/searcher.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="<%= rel_prefix %>/panel/tree.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="<%= rel_prefix %>/js/searchdoc.js" type="text/javascript" charset="utf-8"></script>
21
13
  <meta name="data-rel-prefix" content="<%= rel_prefix %>/">
22
14
  <meta name="data-tree-keys" content='<%= tree_keys %>'>
@@ -31,7 +31,7 @@ document.addEventListener("turbolinks:load", function() {
31
31
  // Only initialize panel if not yet initialized
32
32
  if(!$('#panel .tree ul li').length) {
33
33
  $('#links').hide();
34
- var panel = new Searchdoc.Panel($('#panel'), search_data, tree, $('meta[name="data-rel-prefix"]').attr("content"));
34
+ var panel = new Searchdoc.Panel($('#panel'), search_data, tree);
35
35
  var s = window.location.search.match(/\?q=([^&]+)/);
36
36
  if (s) {
37
37
  s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
@@ -135,11 +135,10 @@ function scrollIntoView(element, view) {
135
135
 
136
136
  // panel.js -----------------------------------------------
137
137
 
138
- Searchdoc.Panel = function(element, data, tree, prefix) {
138
+ Searchdoc.Panel = function(element, data, tree) {
139
139
  this.$element = $(element);
140
140
  this.$input = $('input', element).eq(0);
141
141
  this.$result = $('.result ul', element).eq(0);
142
- this.prefix = prefix;
143
142
  this.$current = null;
144
143
  this.$view = this.$result.parent();
145
144
  this.data = data;
@@ -232,12 +231,13 @@ Searchdoc.Panel.prototype = $.extend({}, Searchdoc.Navigation, new function() {
232
231
  };
233
232
 
234
233
  this.open = function(src) {
235
- Turbolinks.visit(this.prefix + src);
234
+ var prefix = $('meta[name="data-rel-prefix"]').attr("content");
235
+ Turbolinks.visit(prefix + src);
236
236
  if (this.highlight) this.highlight(src);
237
237
  };
238
238
 
239
239
  this.select = function() {
240
- this.open(this.$current.data('path'));
240
+ this.open(this.$current.attr('data-path'));
241
241
  };
242
242
 
243
243
  this.move = function(isDown) {
@@ -266,7 +266,7 @@ Searchdoc.Panel.prototype = $.extend({}, Searchdoc.Navigation, new function() {
266
266
  html += hlt(result.namespace) + '</p>';
267
267
  if (result.snippet) html += '<p class="snippet">' + stripHTML(result.snippet) + '</p>';
268
268
  li.innerHTML = html;
269
- jQuery.data(li, 'path', result.path);
269
+ $(li).attr('data-path', result.path)
270
270
  return li;
271
271
  }
272
272
 
@@ -195,12 +195,20 @@
195
195
  else
196
196
  false
197
197
  end
198
+
199
+ ghost = method.instance_of?(RDoc::GhostMethod)
198
200
  %>
199
201
  <p class="source-link">
200
- Source:
201
- <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
202
+ <% if !ghost || github %> Source: <% end %>
203
+
204
+ <% unless ghost %>
205
+ <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
206
+ <% end %>
207
+
208
+ <% if !ghost && github %> | <% end %>
209
+
202
210
  <% if github %>
203
- | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
211
+ <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
204
212
  <% end %>
205
213
  </p>
206
214
  <div id="<%= method.aref %>_source" class="dyn-source">
@@ -118,7 +118,7 @@ class RDoc::Generator::SDoc
118
118
  debug_msg "Generating index file in #@outputdir"
119
119
  templatefile = @template_dir + 'index.rhtml'
120
120
  outfile = @outputdir + 'index.html'
121
- rel_prefix = @outputdir.relative_path_from( outfile.dirname )
121
+ rel_prefix = rel_prefix = @outputdir.relative_path_from( outfile.dirname )
122
122
 
123
123
  self.render_template( templatefile, binding(), outfile ) unless @options.dry_run
124
124
  end
@@ -131,7 +131,7 @@ class RDoc::Generator::SDoc
131
131
  @classes.each do |klass|
132
132
  debug_msg " working on %s (%s)" % [ klass.full_name, klass.path ]
133
133
  outfile = @outputdir + klass.path
134
- rel_prefix = @outputdir.relative_path_from( outfile.dirname )
134
+ rel_prefix = rel_prefix = @outputdir.relative_path_from( outfile.dirname )
135
135
 
136
136
  debug_msg " rendering #{outfile}"
137
137
  self.render_template( templatefile, binding(), outfile ) unless @options.dry_run
@@ -146,7 +146,7 @@ class RDoc::Generator::SDoc
146
146
  @files.each do |file|
147
147
  outfile = @outputdir + file.path
148
148
  debug_msg " working on %s (%s)" % [ file.full_name, outfile ]
149
- rel_prefix = @outputdir.relative_path_from( outfile.dirname )
149
+ rel_prefix = rel_prefix = @outputdir.relative_path_from( outfile.dirname )
150
150
 
151
151
  debug_msg " rendering #{outfile}"
152
152
  self.render_template( templatefile, binding(), outfile ) unless @options.dry_run
@@ -28,7 +28,7 @@ module SDoc::Templatable
28
28
  ### current context. Adds all +local_assigns+ to context
29
29
  def include_template(template_name, local_assigns = {})
30
30
  source = local_assigns.keys.map { |key| "#{key} = local_assigns[:#{key}];" }.join
31
- templatefile = @template_dir + template_name
31
+ templatefile = templatefile = @template_dir + template_name
32
32
  eval("#{source};eval_template(templatefile, binding)")
33
33
  end
34
34
 
data/lib/sdoc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SDoc
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
data/sdoc.gemspec CHANGED
@@ -22,9 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.rdoc_options = ["--charset=UTF-8"]
23
23
  s.extra_rdoc_files = ["README.md"]
24
24
 
25
- s.add_runtime_dependency("rdoc", ">= 5.0")
26
-
27
- s.add_development_dependency("rack")
25
+ s.add_runtime_dependency("rdoc", ">= 5.0", "< 6.4.0")
28
26
 
29
27
  s.files = `git ls-files`.split("\n")
30
28
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Kolesnikov
8
8
  - Nathan Broadbent
9
9
  - Jean Mertz
10
10
  - Zachary Scott
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-05-21 00:00:00.000000000 Z
14
+ date: 2022-01-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rdoc
@@ -20,6 +20,9 @@ dependencies:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
23
+ - - "<"
24
+ - !ruby/object:Gem::Version
25
+ version: 6.4.0
23
26
  type: :runtime
24
27
  prerelease: false
25
28
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,20 +30,9 @@ dependencies:
27
30
  - - ">="
28
31
  - !ruby/object:Gem::Version
29
32
  version: '5.0'
30
- - !ruby/object:Gem::Dependency
31
- name: rack
32
- requirement: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: '0'
37
- type: :development
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
33
+ - - "<"
42
34
  - !ruby/object:Gem::Version
43
- version: '0'
35
+ version: 6.4.0
44
36
  description: rdoc generator html with javascript search index.
45
37
  email: voloko@gmail.com mail@zzak.io
46
38
  executables:
@@ -121,7 +113,7 @@ homepage: https://github.com/zzak/sdoc
121
113
  licenses:
122
114
  - MIT
123
115
  metadata: {}
124
- post_install_message:
116
+ post_install_message:
125
117
  rdoc_options:
126
118
  - "--charset=UTF-8"
127
119
  require_paths:
@@ -137,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
129
  - !ruby/object:Gem::Version
138
130
  version: 1.3.6
139
131
  requirements: []
140
- rubygems_version: 3.0.3
141
- signing_key:
132
+ rubygems_version: 3.1.6
133
+ signing_key:
142
134
  specification_version: 4
143
135
  summary: rdoc html with javascript search index.
144
136
  test_files: []