sdoc 0.2.20 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ build
2
+ check_dependencies
3
+ check_dependencies:development
4
+ check_dependencies:runtime
5
+ gem_file_list
6
+ gemspec
7
+ gemspec:debug
8
+ gemspec:generate
9
+ gemspec:validate
10
+ ghost
11
+ git:release
12
+ github:release
13
+ install
14
+ release
15
+ test
16
+ version
17
+ version:bump:major
18
+ version:bump:minor
19
+ version:bump:patch
20
+ version:write
data/Rakefile CHANGED
@@ -1,51 +1,12 @@
1
- require 'rake/testtask'
2
- require 'rake/gempackagetask'
1
+ require 'rubygems'
3
2
 
4
- task :default => :test
3
+ require 'bundler'
4
+ Bundler::GemHelper.install_tasks
5
5
 
6
- Rake::TestTask.new("test") do |t|
7
- t.libs << 'test'
8
- t.pattern = 'test/**/*_test.rb'
9
- t.warning = true
10
- t.verbose = true
11
- end
6
+ gem 'rspec', '>= 2.5.0'
7
+ require 'rspec/core/rake_task'
12
8
 
13
- desc "Generate file list for .gemspec"
14
- task :gem_file_list do
15
- f = FileList.new
16
- f.include('lib/**/**')
17
- f.include('rdoc/**/**')
18
- f.exclude('rdoc/test/**/**')
19
- print "%w(" + f.to_a.select{|file| !File.directory? file }.join(' ') + ")\n"
20
- end
21
-
22
- begin
23
- require 'jeweler'
24
-
25
- spec = Gem::Specification.new do |gem|
26
- gem.name = "sdoc"
27
- gem.summary = "rdoc html with javascript search index."
28
- gem.email = "voloko@gmail.com"
29
- gem.homepage = "http://github.com/voloko/sdoc"
30
- gem.authors = ["Volodya Kolesnikov"]
31
- gem.add_dependency("rdoc", "= 2.4.3")
32
-
33
- if defined?(JRUBY_VERSION)
34
- gem.platform = Gem::Platform.new(['universal', 'java', nil])
35
- gem.add_dependency("json_pure", ">= 1.1.3")
36
- else
37
- gem.add_dependency("json", ">= 1.1.3")
38
- end
39
- end
40
-
41
- jewler = Jeweler::Tasks.new(spec)
42
-
43
- desc "Replace system gem with symlink to this folder"
44
- task 'ghost' do
45
- path = Gem.searcher.find(jewler.gemspec.name).full_gem_path
46
- system 'sudo', 'rm', '-r', path
47
- symlink File.expand_path('.'), path
48
- end
49
- rescue LoadError
50
- puts "Jeweler not available. Install it with: (sudo) gem install jeweler"
51
- end
9
+ desc "Run all specs"
10
+ RSpec::Core::RakeTask.new(:spec)
11
+ task :default => :spec
12
+ task :test => :spec
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 20
2
+ :patch: 0
3
3
  :major: 0
4
4
  :build:
5
- :minor: 2
5
+ :minor: 3
data/bin/sdoc CHANGED
@@ -1,11 +1,27 @@
1
1
  #!/usr/bin/env ruby -KU
2
-
3
2
  require File.dirname(__FILE__) + '/../lib/sdoc' # add extensions
4
3
 
5
4
  begin
5
+ ARGV.push('--format=sdoc') if ARGV.grep(/\A(-f|--fmt|--format|-r|-R|--ri|--ri-site)\b/).empty?
6
6
  r = RDoc::RDoc.new
7
- r.document(ARGV)
8
- rescue RDoc::RDocError => e
9
- $stderr.puts e.message
10
- exit(1)
7
+ r.document ARGV
8
+ rescue SystemExit
9
+ raise
10
+ rescue Exception => e
11
+ if $DEBUG_RDOC then
12
+ $stderr.puts e.message
13
+ $stderr.puts "#{e.backtrace.join "\n\t"}"
14
+ $stderr.puts
15
+ elsif Interrupt === e then
16
+ $stderr.puts
17
+ $stderr.puts 'Interrupted'
18
+ else
19
+ $stderr.puts "uh-oh! RDoc had a problem:"
20
+ $stderr.puts e.message
21
+ $stderr.puts
22
+ $stderr.puts "run with --debug for full backtrace"
23
+ end
24
+
25
+ exit 1
11
26
  end
27
+
@@ -6,7 +6,20 @@ require 'sdoc/merge'
6
6
  begin
7
7
  m = SDoc::Merge.new
8
8
  m.merge(ARGV)
9
- rescue RDoc::RDocError => e
10
- $stderr.puts e.message
11
- exit(1)
9
+ rescue SystemExit
10
+ raise
11
+ rescue Exception => e
12
+ if $DEBUG_RDOC then
13
+ $stderr.puts e.message
14
+ $stderr.puts "#{e.backtrace.join "\n\t"}"
15
+ $stderr.puts
16
+ elsif Interrupt === e then
17
+ $stderr.puts
18
+ $stderr.puts 'Interrupted'
19
+ else
20
+ $stderr.puts "uh-oh! SDoc merge had a problem:"
21
+ $stderr.puts e.message
22
+ end
23
+ exit 1
12
24
  end
25
+
@@ -1 +1,5 @@
1
- require File.join(File.dirname(__FILE__), '/../sdoc')
1
+ begin
2
+ gem 'rdoc', '~> 3'
3
+ require File.join(File.dirname(__FILE__), '/../sdoc')
4
+ rescue Gem::LoadError
5
+ end
@@ -1,23 +1,7 @@
1
1
  $:.unshift File.dirname(__FILE__)
2
2
  require "rubygems"
3
- gem "rdoc", "= 2.4.3"
3
+ gem 'rdoc', '~> 3'
4
4
 
5
- require "rdoc/rdoc"
6
-
7
- module SDoc
8
- end
9
-
10
- require "sdoc/generator/shtml"
11
- require "sdoc/c_parser_fix"
12
-
13
- unless defined? SDOC_FIXED_RDOC_OPTIONS
14
- SDOC_FIXED_RDOC_OPTIONS = 1
15
- class RDoc::Options
16
- alias_method :rdoc_initialize, :initialize
5
+ module SDoc end
17
6
 
18
- def initialize
19
- rdoc_initialize
20
- @generator = RDoc::Generator::SHtml
21
- end
22
- end
23
- end
7
+ require 'sdoc/generator'
@@ -1,17 +1,20 @@
1
- require 'sdoc/json_backend'
2
- require 'iconv'
1
+ require 'rubygems'
2
+ require 'erb'
3
3
  require 'pathname'
4
4
  require 'fileutils'
5
- require 'erb'
6
-
7
- gem 'rdoc', '>= 2.4.2'
8
- require 'rdoc/rdoc'
9
- require 'rdoc/generator'
10
- require 'rdoc/generator/markup'
5
+ if Gem.available? "json"
6
+ gem "json", ">= 1.1.3"
7
+ else
8
+ gem "json_pure", ">= 1.1.3"
9
+ end
10
+ require 'json'
11
11
 
12
12
  require 'sdoc/github'
13
13
  require 'sdoc/templatable'
14
14
  require 'sdoc/helpers'
15
+ require 'rdoc'
16
+ require 'rdoc/rdoc'
17
+ require 'rdoc/generator'
15
18
 
16
19
  class RDoc::ClassModule
17
20
  def document_self_or_methods
@@ -23,14 +26,21 @@ class RDoc::ClassModule
23
26
  end
24
27
  end
25
28
 
26
- class RDoc::Generator::SHtml
27
- RDoc::RDoc.add_generator( self )
29
+ class RDoc::Options
30
+ attr_accessor :github
31
+ end
32
+
33
+ class RDoc::Generator::SDoc
34
+ RDoc::RDoc.add_generator self
35
+
36
+ DESCRIPTION = 'Searchable HTML documentation'
37
+
28
38
  include ERB::Util
29
39
  include SDoc::GitHub
30
40
  include SDoc::Templatable
31
41
  include SDoc::Helpers
32
42
 
33
- GENERATOR_DIRS = [File.join('sdoc', 'generator'), File.join('rdoc', 'generator')]
43
+ GENERATOR_DIRS = [File.join('sdoc', 'generator')]
34
44
 
35
45
  # Used in js to reduce index sizes
36
46
  TYPE_CLASS = 1
@@ -46,19 +56,23 @@ class RDoc::Generator::SHtml
46
56
  RESOURCES_DIR = File.join('resources', '.')
47
57
 
48
58
  attr_reader :basedir
49
-
50
- def self.for(options)
51
- self.new(options)
52
- end
53
-
54
- def self.template_dir template
55
- $LOAD_PATH.map do |path|
56
- GENERATOR_DIRS.map do |dir|
57
- File.join path, dir, 'template', template
58
- end
59
- end.flatten.find do |dir|
60
- File.directory? dir
59
+
60
+ attr_reader :options
61
+
62
+ def self.setup_options(options)
63
+ @github = false
64
+ options.template = 'direct'
65
+
66
+ opt = options.option_parser
67
+ opt.separator nil
68
+ opt.separator "SDoc generator options:"
69
+ opt.separator nil
70
+ opt.on("--github", "-g",
71
+ "Generate links to github.") do |value|
72
+ options.github = true
61
73
  end
74
+
75
+ opt.separator nil
62
76
  end
63
77
 
64
78
  def initialize(options)
@@ -70,7 +84,7 @@ class RDoc::Generator::SHtml
70
84
 
71
85
  template = @options.template || 'direct'
72
86
 
73
- templ_dir = self.class.template_dir template
87
+ templ_dir = self.class.template_dir_for template
74
88
 
75
89
  raise RDoc::Error, "could not find template #{template.inspect}" unless
76
90
  templ_dir
@@ -79,8 +93,8 @@ class RDoc::Generator::SHtml
79
93
  @basedir = Pathname.pwd.expand_path
80
94
  end
81
95
 
82
- def generate( top_levels )
83
- @outputdir = Pathname.new( @options.op_dir ).expand_path( @basedir )
96
+ def generate(top_levels)
97
+ @outputdir = Pathname.new(@options.op_dir).expand_path(@basedir)
84
98
  @files = top_levels.sort
85
99
  @classes = RDoc::TopLevel.all_classes_and_modules.sort
86
100
 
@@ -101,18 +115,28 @@ class RDoc::Generator::SHtml
101
115
  FILE_DIR
102
116
  end
103
117
 
118
+ def self.template_dir_for template
119
+ $LOAD_PATH.map do |path|
120
+ GENERATOR_DIRS.map do |dir|
121
+ File.join path, dir, 'template', template
122
+ end
123
+ end.flatten.find do |dir|
124
+ File.directory? dir
125
+ end
126
+ end
127
+
104
128
 
105
129
  protected
106
130
  ### Output progress information if debugging is enabled
107
131
  def debug_msg( *msg )
108
132
  return unless $DEBUG_RDOC
109
133
  $stderr.puts( *msg )
110
- end
134
+ end
111
135
 
112
136
  ### Create class tree structure and write it as json
113
137
  def generate_class_tree
114
138
  debug_msg "Generating class tree"
115
- topclasses = @classes.select {|klass| !(RDoc::ClassModule === klass.parent) }
139
+ topclasses = @classes.select {|klass| !(RDoc::ClassModule === klass.parent) }
116
140
  tree = generate_file_tree + generate_class_tree_level(topclasses)
117
141
  debug_msg " writing class tree to %s" % TREE_FILE
118
142
  File.open(TREE_FILE, "w", 0644) do |f|
@@ -125,9 +149,9 @@ class RDoc::Generator::SHtml
125
149
  tree = []
126
150
  classes.select{|c| c.with_documentation? }.sort.each do |klass|
127
151
  item = [
128
- klass.name,
152
+ klass.name,
129
153
  klass.document_self_or_methods ? klass.path : '',
130
- klass.module? ? '' : (klass.superclass ? " < #{String === klass.superclass ? klass.superclass : klass.superclass.full_name}" : ''),
154
+ klass.module? ? '' : (klass.superclass ? " < #{String === klass.superclass ? klass.superclass : klass.superclass.full_name}" : ''),
131
155
  generate_class_tree_level(klass.classes_and_modules)
132
156
  ]
133
157
  tree << item
@@ -163,16 +187,16 @@ class RDoc::Generator::SHtml
163
187
  def add_file_search_index(index)
164
188
  debug_msg " generating file search index"
165
189
 
166
- @files.select { |file|
167
- file.document_self
190
+ @files.select { |file|
191
+ file.document_self
168
192
  }.sort.each do |file|
169
193
  index[:searchIndex].push( search_string(file.name) )
170
194
  index[:longSearchIndex].push( search_string(file.path) )
171
195
  index[:info].push([
172
- file.name,
173
- file.path,
174
- file.path,
175
- '',
196
+ file.name,
197
+ file.path,
198
+ file.path,
199
+ '',
176
200
  snippet(file.comment),
177
201
  TYPE_FILE
178
202
  ])
@@ -183,7 +207,7 @@ class RDoc::Generator::SHtml
183
207
  def add_class_search_index(index)
184
208
  debug_msg " generating class search index"
185
209
 
186
- @classes.select { |klass|
210
+ @classes.select { |klass|
187
211
  klass.document_self_or_methods
188
212
  }.sort.each do |klass|
189
213
  modulename = klass.module? ? '' : (klass.superclass ? (String === klass.superclass ? klass.superclass : klass.superclass.full_name) : '')
@@ -191,10 +215,10 @@ class RDoc::Generator::SHtml
191
215
  index[:longSearchIndex].push( search_string(klass.parent.full_name) )
192
216
  files = klass.in_files.map{ |file| file.absolute_name }
193
217
  index[:info].push([
194
- klass.name,
195
- files.include?(klass.parent.full_name) ? files.first : klass.parent.full_name,
196
- klass.path,
197
- modulename ? " < #{modulename}" : '',
218
+ klass.name,
219
+ files.include?(klass.parent.full_name) ? files.first : klass.parent.full_name,
220
+ klass.path,
221
+ modulename ? " < #{modulename}" : '',
198
222
  snippet(klass.comment),
199
223
  TYPE_CLASS
200
224
  ])
@@ -205,23 +229,27 @@ class RDoc::Generator::SHtml
205
229
  def add_method_search_index(index)
206
230
  debug_msg " generating method search index"
207
231
 
208
- list = @classes.map { |klass|
232
+ list = @classes.map do |klass|
209
233
  klass.method_list
210
- }.flatten.sort{ |a, b| a.name == b.name ? a.parent.full_name <=> b.parent.full_name : a.name <=> b.name }.select { |method|
211
- method.document_self
212
- }
213
- unless @options.show_all
214
- list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
234
+ end.flatten.sort do |a, b|
235
+ a.name == b.name ?
236
+ a.parent.full_name <=> b.parent.full_name :
237
+ a.name <=> b.name
238
+ end.select do |method|
239
+ method.document_self
240
+ end.find_all do |m|
241
+ m.visibility == :public || m.visibility == :protected ||
242
+ m.force_documentation
215
243
  end
216
244
 
217
245
  list.each do |method|
218
246
  index[:searchIndex].push( search_string(method.name) + '()' )
219
247
  index[:longSearchIndex].push( search_string(method.parent.full_name) )
220
248
  index[:info].push([
221
- method.name,
222
- method.parent.full_name,
223
- method.path,
224
- method.params,
249
+ method.name,
250
+ method.parent.full_name,
251
+ method.path,
252
+ method.params,
225
253
  snippet(method.comment),
226
254
  TYPE_METHOD
227
255
  ])
@@ -26,9 +26,7 @@
26
26
 
27
27
  <%
28
28
  list = context.method_list
29
- unless @options.show_all
30
- list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
31
- end
29
+ list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
32
30
  %>
33
31
  <% unless list.empty? %>
34
32
  <div class="sectiontitle">Methods</div>
@@ -118,7 +116,7 @@
118
116
  next if visibilities.empty?
119
117
  visibilities.each do |visibility, methods|
120
118
  next if methods.empty?
121
- next unless @options.show_all || visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
119
+ next unless visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
122
120
  %>
123
121
  <div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
124
122
  <% methods.each do |method| %>
@@ -149,6 +147,7 @@
149
147
  <p class="source-link">
150
148
  Source: <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
151
149
  <%
150
+ if options.github
152
151
  if markup =~ /File\s(\S+), line (\d+)/
153
152
  path = $1
154
153
  line = $2.to_i
@@ -157,7 +156,7 @@
157
156
  if github
158
157
  %>
159
158
  | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
160
- <% end %>
159
+ <% end end %>
161
160
  </p>
162
161
  <div id="<%= method.aref %>_source" class="dyn-source">
163
162
  <pre><%= method.markup_code %></pre>
@@ -24,9 +24,7 @@
24
24
 
25
25
  <%
26
26
  list = context.method_list
27
- unless @options.show_all
28
- list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
29
- end
27
+ list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
30
28
  %>
31
29
  <% unless list.empty? %>
32
30
  <div class="sectiontitle">Methods</div>
@@ -109,7 +107,7 @@
109
107
  next if visibilities.empty?
110
108
  visibilities.each do |visibility, methods|
111
109
  next if methods.empty?
112
- next unless @options.show_all || visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
110
+ next unless visibility == :public || visibility == :protected || methods.any? {|m| m.force_documentation }
113
111
  %>
114
112
  <div class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</div>
115
113
  <% methods.each do |method| %>
@@ -141,6 +139,7 @@
141
139
  <p class="source-link">
142
140
  Source: <a href="javascript:toggleSource('<%= method.aref %>_source')" id="l_<%= method.aref %>_source">show</a>
143
141
  <%
142
+ if options.github
144
143
  if markup =~ /File\s(\S+), line (\d+)/
145
144
  path = $1
146
145
  line = $2.to_i
@@ -149,7 +148,7 @@
149
148
  if github
150
149
  %>
151
150
  | <a href="<%= "#{github}#L#{line}" %>" target="_blank" class="github_url">on GitHub</a>
152
- <% end %>
151
+ <% end end %>
153
152
  </p>
154
153
  <div id="<%= method.aref %>_source" class="dyn-source">
155
154
  <pre><%= method.markup_code %></pre>
@@ -2,7 +2,13 @@ require 'optparse'
2
2
  require 'pathname'
3
3
  require 'fileutils'
4
4
 
5
- require 'sdoc/json_backend'
5
+ if Gem.available? "json"
6
+ gem "json", ">= 1.1.3"
7
+ else
8
+ gem "json_pure", ">= 1.1.3"
9
+ end
10
+ require 'json'
11
+
6
12
  require 'sdoc/templatable'
7
13
 
8
14
  class SDoc::Merge
@@ -16,7 +22,7 @@ class SDoc::Merge
16
22
  @op_dir = 'doc'
17
23
  @title = ''
18
24
  @directories = []
19
- template_dir = RDoc::Generator::SHtml.template_dir('merge')
25
+ template_dir = RDoc::Generator::SDoc.template_dir_for('merge')
20
26
  @template_dir = Pathname.new File.expand_path(template_dir)
21
27
  end
22
28
 
@@ -51,8 +57,9 @@ class SDoc::Merge
51
57
  @title = v
52
58
  end
53
59
 
54
- opt.on("-u", "--urls [URLS]", "Paths to merged docs. If you \n" +
55
- "set this files and classes won't be actualy copied to merged build") do |v|
60
+ opt.on("-u", "--urls [URLS]", "Paths to merged docs. If you",
61
+ "set this files and classes won't be actualy",
62
+ "copied to merged build") do |v|
56
63
  @urls = v.split(' ').map{|name| name.strip }
57
64
  end
58
65
  end
@@ -1,3 +1,4 @@
1
+ require 'erb'
1
2
  require "sdoc"
2
3
 
3
4
  module SDoc::Templatable
@@ -1,94 +1,35 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
5
2
 
6
3
  Gem::Specification.new do |s|
7
- s.name = %q{sdoc}
8
- s.version = "0.2.20"
4
+ s.name = "sdoc"
5
+ s.version = "0.3.0"
9
6
 
10
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Volodya Kolesnikov"]
12
- s.date = %q{2010-08-23}
13
- s.email = %q{voloko@gmail.com}
14
- s.executables = ["sdoc", "sdoc-merge"]
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".gitignore",
21
- "LICENSE",
22
- "README.rdoc",
23
- "Rakefile",
24
- "VERSION.yml",
25
- "bin/sdoc",
26
- "bin/sdoc-merge",
27
- "lib/rdoc/discover.rb",
28
- "lib/sdoc.rb",
29
- "lib/sdoc/c_parser_fix.rb",
30
- "lib/sdoc/generator/shtml.rb",
31
- "lib/sdoc/generator/template/direct/_context.rhtml",
32
- "lib/sdoc/generator/template/direct/class.rhtml",
33
- "lib/sdoc/generator/template/direct/file.rhtml",
34
- "lib/sdoc/generator/template/direct/index.rhtml",
35
- "lib/sdoc/generator/template/direct/resources/apple-touch-icon.png",
36
- "lib/sdoc/generator/template/direct/resources/css/main.css",
37
- "lib/sdoc/generator/template/direct/resources/css/panel.css",
38
- "lib/sdoc/generator/template/direct/resources/css/reset.css",
39
- "lib/sdoc/generator/template/direct/resources/favicon.ico",
40
- "lib/sdoc/generator/template/direct/resources/i/arrows.png",
41
- "lib/sdoc/generator/template/direct/resources/i/results_bg.png",
42
- "lib/sdoc/generator/template/direct/resources/i/tree_bg.png",
43
- "lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js",
44
- "lib/sdoc/generator/template/direct/resources/js/jquery-effect.js",
45
- "lib/sdoc/generator/template/direct/resources/js/main.js",
46
- "lib/sdoc/generator/template/direct/resources/js/searchdoc.js",
47
- "lib/sdoc/generator/template/direct/resources/panel/index.html",
48
- "lib/sdoc/generator/template/merge/index.rhtml",
49
- "lib/sdoc/generator/template/shtml/_context.rhtml",
50
- "lib/sdoc/generator/template/shtml/class.rhtml",
51
- "lib/sdoc/generator/template/shtml/file.rhtml",
52
- "lib/sdoc/generator/template/shtml/index.rhtml",
53
- "lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png",
54
- "lib/sdoc/generator/template/shtml/resources/css/main.css",
55
- "lib/sdoc/generator/template/shtml/resources/css/panel.css",
56
- "lib/sdoc/generator/template/shtml/resources/css/reset.css",
57
- "lib/sdoc/generator/template/shtml/resources/favicon.ico",
58
- "lib/sdoc/generator/template/shtml/resources/i/arrows.png",
59
- "lib/sdoc/generator/template/shtml/resources/i/results_bg.png",
60
- "lib/sdoc/generator/template/shtml/resources/i/tree_bg.png",
61
- "lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js",
62
- "lib/sdoc/generator/template/shtml/resources/js/main.js",
63
- "lib/sdoc/generator/template/shtml/resources/js/searchdoc.js",
64
- "lib/sdoc/generator/template/shtml/resources/panel/index.html",
65
- "lib/sdoc/github.rb",
66
- "lib/sdoc/helpers.rb",
67
- "lib/sdoc/json_backend.rb",
68
- "lib/sdoc/merge.rb",
69
- "lib/sdoc/templatable.rb",
70
- "sdoc.gemspec"
71
- ]
72
- s.homepage = %q{http://github.com/voloko/sdoc}
73
- s.rdoc_options = ["--charset=UTF-8"]
74
- s.require_paths = ["lib"]
75
- s.rubygems_version = %q{1.3.7}
8
+ s.authors = ["Vladimir Kolesnikov"]
9
+ s.date = %q{2010-10-05}
10
+ s.description = %q{rdoc generator html with javascript search index.}
76
11
  s.summary = %q{rdoc html with javascript search index.}
12
+ s.homepage = %q{http://github.com/voloko/sdoc}
13
+ s.email = %q{voloko@gmail.com}
14
+
15
+ s.platform = Gem::Platform::RUBY
16
+ s.rubygems_version = %q{1.3.6}
17
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
77
18
 
78
- if s.respond_to? :specification_version then
79
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
80
- s.specification_version = 3
19
+ s.rdoc_options = ["--charset=UTF-8"]
20
+ s.extra_rdoc_files = ["README.rdoc"]
81
21
 
82
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
83
- s.add_runtime_dependency(%q<rdoc>, ["= 2.4.3"])
84
- s.add_runtime_dependency(%q<json>, [">= 1.1.3"])
85
- else
86
- s.add_dependency(%q<rdoc>, ["= 2.4.3"])
87
- s.add_dependency(%q<json>, [">= 1.1.3"])
88
- end
22
+ s.add_runtime_dependency('rdoc', "~> 3")
23
+ if defined?(JRUBY_VERSION)
24
+ s.platform = Gem::Platform.new(['universal', 'java', nil])
25
+ s.add_runtime_dependency("json_pure", ">= 1.1.3")
89
26
  else
90
- s.add_dependency(%q<rdoc>, ["= 2.4.3"])
91
- s.add_dependency(%q<json>, [">= 1.1.3"])
92
- end
27
+ s.add_runtime_dependency("json", ">= 1.1.3")
28
+ end
29
+
30
+ s.files = `git ls-files`.split("\n")
31
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
32
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
33
+ s.require_paths = ["lib"]
93
34
  end
94
35
 
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 20
10
- version: 0.2.20
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
- - Volodya Kolesnikov
13
+ - Vladimir Kolesnikov
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-23 00:00:00 +04:00
18
+ date: 2010-10-05 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,14 +24,12 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - "="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 25
29
+ hash: 5
30
30
  segments:
31
- - 2
32
- - 4
33
31
  - 3
34
- version: 2.4.3
32
+ version: "3"
35
33
  type: :runtime
36
34
  version_requirements: *id001
37
35
  - !ruby/object:Gem::Dependency
@@ -50,7 +48,7 @@ dependencies:
50
48
  version: 1.1.3
51
49
  type: :runtime
52
50
  version_requirements: *id002
53
- description:
51
+ description: rdoc generator html with javascript search index.
54
52
  email: voloko@gmail.com
55
53
  executables:
56
54
  - sdoc
@@ -58,10 +56,10 @@ executables:
58
56
  extensions: []
59
57
 
60
58
  extra_rdoc_files:
61
- - LICENSE
62
59
  - README.rdoc
63
60
  files:
64
61
  - .gitignore
62
+ - .rake_tasks~
65
63
  - LICENSE
66
64
  - README.rdoc
67
65
  - Rakefile
@@ -70,8 +68,7 @@ files:
70
68
  - bin/sdoc-merge
71
69
  - lib/rdoc/discover.rb
72
70
  - lib/sdoc.rb
73
- - lib/sdoc/c_parser_fix.rb
74
- - lib/sdoc/generator/shtml.rb
71
+ - lib/sdoc/generator.rb
75
72
  - lib/sdoc/generator/template/direct/_context.rhtml
76
73
  - lib/sdoc/generator/template/direct/class.rhtml
77
74
  - lib/sdoc/generator/template/direct/file.rhtml
@@ -108,7 +105,6 @@ files:
108
105
  - lib/sdoc/generator/template/shtml/resources/panel/index.html
109
106
  - lib/sdoc/github.rb
110
107
  - lib/sdoc/helpers.rb
111
- - lib/sdoc/json_backend.rb
112
108
  - lib/sdoc/merge.rb
113
109
  - lib/sdoc/templatable.rb
114
110
  - sdoc.gemspec
@@ -135,10 +131,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
131
  requirements:
136
132
  - - ">="
137
133
  - !ruby/object:Gem::Version
138
- hash: 3
134
+ hash: 23
139
135
  segments:
140
- - 0
141
- version: "0"
136
+ - 1
137
+ - 3
138
+ - 6
139
+ version: 1.3.6
142
140
  requirements: []
143
141
 
144
142
  rubyforge_project:
@@ -1,31 +0,0 @@
1
- require "rdoc/parser/c"
2
-
3
- # New RDoc somehow misses class comments.
4
- # copied this function from "2.2.2"
5
- if ['2.4.2', '2.4.3'].include? RDoc::VERSION
6
-
7
- class RDoc::Parser::C
8
- def find_class_comment(class_name, class_meth)
9
- comment = nil
10
- if @content =~ %r{((?>/\*.*?\*/\s+))
11
- (static\s+)?void\s+Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)\)}xmi then
12
- comment = $1
13
- elsif @content =~ %r{Document-(?:class|module):\s#{class_name}\s*?(?:<\s+[:,\w]+)?\n((?>.*?\*/))}m
14
- comment = $1
15
- else
16
- if @content =~ /rb_define_(class|module)/m then
17
- class_name = class_name.split("::").last
18
- comments = []
19
- @content.split(/(\/\*.*?\*\/)\s*?\n/m).each_with_index do |chunk, index|
20
- comments[index] = chunk
21
- if chunk =~ /rb_define_(class|module).*?"(#{class_name})"/m then
22
- comment = comments[index-1]
23
- break
24
- end
25
- end
26
- end
27
- end
28
- class_meth.comment = mangle_comment(comment) if comment
29
- end
30
- end
31
- end
@@ -1,15 +0,0 @@
1
- require 'rubygems'
2
-
3
- ## undefined method `to_json' for Array :(
4
- # if Gem.available? "yajl-ruby"
5
- # gem "yajl-ruby", ">= 0.7.6"
6
- # require "yajl"
7
- # warn "yajl"
8
- # else
9
- if Gem.available? "json"
10
- gem "json", ">= 1.1.3"
11
- else
12
- gem "json_pure", ">= 1.1.3"
13
- end
14
- require "json"
15
- # end