Permalink
Browse files

bundler instead of jeweler, sdoc command, json loading fixes

  • Loading branch information...
1 parent 26a1c50 commit 71930be2c46a7bf8a09d5d7f276e57ab9398a412 @voloko voloko committed Aug 8, 2011
Showing with 72 additions and 155 deletions.
  1. +9 −48 Rakefile
  2. +2 −2 VERSION.yml
  3. +21 −5 bin/sdoc
  4. +1 −1 lib/sdoc.rb
  5. +8 −0 lib/sdoc/generator.rb
  6. +0 −15 lib/sdoc/json_backend.rb
  7. +7 −1 lib/sdoc/merge.rb
  8. +24 −83 sdoc.gemspec
View
@@ -1,51 +1,12 @@
-require 'rake/testtask'
-require 'rake/gempackagetask'
+require 'rubygems'
-task :default => :test
+require 'bundler'
+Bundler::GemHelper.install_tasks
-Rake::TestTask.new("test") do |t|
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.warning = true
- t.verbose = true
-end
+gem 'rspec', '>= 2.5.0'
+require 'rspec/core/rake_task'
-desc "Generate file list for .gemspec"
-task :gem_file_list do
- f = FileList.new
- f.include('lib/**/**')
- f.include('rdoc/**/**')
- f.exclude('rdoc/test/**/**')
- print "%w(" + f.to_a.select{|file| !File.directory? file }.join(' ') + ")\n"
-end
-
-begin
- require 'jeweler'
-
- spec = Gem::Specification.new do |gem|
- gem.name = "sdoc"
- gem.summary = "rdoc html with javascript search index."
- gem.email = "voloko@gmail.com"
- gem.homepage = "http://github.com/voloko/sdoc"
- gem.authors = ["Volodya Kolesnikov"]
- gem.add_dependency("rdoc", "= 2.4.3")
-
- if defined?(JRUBY_VERSION)
- gem.platform = Gem::Platform.new(['universal', 'java', nil])
- gem.add_dependency("json_pure", ">= 1.1.3")
- else
- gem.add_dependency("json", ">= 1.1.3")
- end
- end
-
- jewler = Jeweler::Tasks.new(spec)
-
- desc "Replace system gem with symlink to this folder"
- task 'ghost' do
- path = Gem.searcher.find(jewler.gemspec.name).full_gem_path
- system 'sudo', 'rm', '-r', path
- symlink File.expand_path('.'), path
- end
-rescue LoadError
- puts "Jeweler not available. Install it with: (sudo) gem install jeweler"
-end
+desc "Run all specs"
+RSpec::Core::RakeTask.new(:spec)
+task :default => :spec
+task :test => :spec
View
@@ -1,5 +1,5 @@
---
-:patch: 20
+:patch: 0
:major: 0
:build:
-:minor: 2
+:minor: 3
View
@@ -1,11 +1,27 @@
#!/usr/bin/env ruby -KU
-
require File.dirname(__FILE__) + '/../lib/sdoc' # add extensions
begin
+ ARGV.push('--format=sdoc') if ARGV.grep(/\A(-f|--fmt|--format|-r|-R|--ri|--ri-site)\b/).empty?
r = RDoc::RDoc.new
- r.document(ARGV)
-rescue RDoc::RDocError => e
- $stderr.puts e.message
- exit(1)
+ r.document ARGV
+rescue SystemExit
+ raise
+rescue Exception => e
+ if $DEBUG_RDOC then
+ $stderr.puts e.message
+ $stderr.puts "#{e.backtrace.join "\n\t"}"
+ $stderr.puts
+ elsif Interrupt === e then
+ $stderr.puts
+ $stderr.puts 'Interrupted'
+ else
+ $stderr.puts "uh-oh! RDoc had a problem:"
+ $stderr.puts e.message
+ $stderr.puts
+ $stderr.puts "run with --debug for full backtrace"
+ end
+
+ exit 1
end
+
View
@@ -1,6 +1,6 @@
$:.unshift File.dirname(__FILE__)
require "rubygems"
-gem "rdoc", ">= 3.9.0"
+gem 'rdoc', '~> 3'
module SDoc end
@@ -1,11 +1,19 @@
+require 'rubygems'
require 'erb'
require 'pathname'
require 'fileutils'
+if Gem.available? "json"
+ gem "json", ">= 1.1.3"
+else
+ gem "json_pure", ">= 1.1.3"
+end
require 'json'
require 'sdoc/github'
require 'sdoc/templatable'
require 'sdoc/helpers'
+require 'rdoc'
+require 'rdoc/rdoc'
require 'rdoc/generator'
class RDoc::ClassModule
@@ -1,15 +0,0 @@
-require 'rubygems'
-
-## undefined method `to_json' for Array :(
-# if Gem.available? "yajl-ruby"
-# gem "yajl-ruby", ">= 0.7.6"
-# require "yajl"
-# warn "yajl"
-# else
- if Gem.available? "json"
- gem "json", ">= 1.1.3"
- else
- gem "json_pure", ">= 1.1.3"
- end
- require "json"
-# end
View
@@ -2,7 +2,13 @@
require 'pathname'
require 'fileutils'
-require 'sdoc/json_backend'
+if Gem.available? "json"
+ gem "json", ">= 1.1.3"
+else
+ gem "json_pure", ">= 1.1.3"
+end
+require 'json'
+
require 'sdoc/templatable'
class SDoc::Merge
View
@@ -1,94 +1,35 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{sdoc}
- s.version = "0.2.20"
+ s.name = "sdoc"
+ s.version = "0.3.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Volodya Kolesnikov"]
- s.date = %q{2010-08-23}
- s.email = %q{voloko@gmail.com}
- s.executables = ["sdoc", "sdoc-merge"]
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".gitignore",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION.yml",
- "bin/sdoc",
- "bin/sdoc-merge",
- "lib/rdoc/discover.rb",
- "lib/sdoc.rb",
- "lib/sdoc/c_parser_fix.rb",
- "lib/sdoc/generator/shtml.rb",
- "lib/sdoc/generator/template/direct/_context.rhtml",
- "lib/sdoc/generator/template/direct/class.rhtml",
- "lib/sdoc/generator/template/direct/file.rhtml",
- "lib/sdoc/generator/template/direct/index.rhtml",
- "lib/sdoc/generator/template/direct/resources/apple-touch-icon.png",
- "lib/sdoc/generator/template/direct/resources/css/main.css",
- "lib/sdoc/generator/template/direct/resources/css/panel.css",
- "lib/sdoc/generator/template/direct/resources/css/reset.css",
- "lib/sdoc/generator/template/direct/resources/favicon.ico",
- "lib/sdoc/generator/template/direct/resources/i/arrows.png",
- "lib/sdoc/generator/template/direct/resources/i/results_bg.png",
- "lib/sdoc/generator/template/direct/resources/i/tree_bg.png",
- "lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js",
- "lib/sdoc/generator/template/direct/resources/js/jquery-effect.js",
- "lib/sdoc/generator/template/direct/resources/js/main.js",
- "lib/sdoc/generator/template/direct/resources/js/searchdoc.js",
- "lib/sdoc/generator/template/direct/resources/panel/index.html",
- "lib/sdoc/generator/template/merge/index.rhtml",
- "lib/sdoc/generator/template/shtml/_context.rhtml",
- "lib/sdoc/generator/template/shtml/class.rhtml",
- "lib/sdoc/generator/template/shtml/file.rhtml",
- "lib/sdoc/generator/template/shtml/index.rhtml",
- "lib/sdoc/generator/template/shtml/resources/apple-touch-icon.png",
- "lib/sdoc/generator/template/shtml/resources/css/main.css",
- "lib/sdoc/generator/template/shtml/resources/css/panel.css",
- "lib/sdoc/generator/template/shtml/resources/css/reset.css",
- "lib/sdoc/generator/template/shtml/resources/favicon.ico",
- "lib/sdoc/generator/template/shtml/resources/i/arrows.png",
- "lib/sdoc/generator/template/shtml/resources/i/results_bg.png",
- "lib/sdoc/generator/template/shtml/resources/i/tree_bg.png",
- "lib/sdoc/generator/template/shtml/resources/js/jquery-1.3.2.min.js",
- "lib/sdoc/generator/template/shtml/resources/js/main.js",
- "lib/sdoc/generator/template/shtml/resources/js/searchdoc.js",
- "lib/sdoc/generator/template/shtml/resources/panel/index.html",
- "lib/sdoc/github.rb",
- "lib/sdoc/helpers.rb",
- "lib/sdoc/json_backend.rb",
- "lib/sdoc/merge.rb",
- "lib/sdoc/templatable.rb",
- "sdoc.gemspec"
- ]
- s.homepage = %q{http://github.com/voloko/sdoc}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
+ s.authors = ["Vladimir Kolesnikov"]
+ s.date = %q{2010-10-05}
+ s.description = %q{rdoc generator html with javascript search index.}
s.summary = %q{rdoc html with javascript search index.}
+ s.homepage = %q{http://github.com/voloko/sdoc}
+ s.email = %q{voloko@gmail.com}
+
+ s.platform = Gem::Platform::RUBY
+ s.rubygems_version = %q{1.3.6}
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.extra_rdoc_files = ["README.rdoc"]
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rdoc>, ["= 2.4.3"])
- s.add_runtime_dependency(%q<json>, [">= 1.1.3"])
- else
- s.add_dependency(%q<rdoc>, ["= 2.4.3"])
- s.add_dependency(%q<json>, [">= 1.1.3"])
- end
+ s.add_runtime_dependency('rdoc', "~> 3")
+ if defined?(JRUBY_VERSION)
+ s.platform = Gem::Platform.new(['universal', 'java', nil])
+ s.add_runtime_dependency("json_pure", ">= 1.1.3")
else
- s.add_dependency(%q<rdoc>, ["= 2.4.3"])
- s.add_dependency(%q<json>, [">= 1.1.3"])
- end
+ s.add_runtime_dependency("json", ">= 1.1.3")
+ end
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
end

0 comments on commit 71930be

Please sign in to comment.