Skip to content

Remove hoe from development #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/lib/rdoc/markdown.rb
/pkg
/tmp
Gemfile.lock
28 changes: 13 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
---
before_script:
- gem install hoe kpeg racc json --no-rdoc --no-ri
- gem install minitest -v '~> 4.0'
before_install:
- gem install bundler --no-document
language: ruby
notifications:
email:
- [email protected]
rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.10
- 2.2.5
- 2.3.1
- ruby-head
- jruby-1.7.25
- jruby-9.1.0.0
- rbx-2
- rbx
script: rake test
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.10
- 2.2.5
- 2.3.1
- ruby-head
- rbx-2
- jruby-1.7.25
- jruby-9.1.0.0
script: rake
matrix:
allow_failures:
- rvm: jruby-1.7.25
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gemspec
130 changes: 42 additions & 88 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,95 +1,28 @@
$:.unshift File.expand_path 'lib'
require 'rdoc'
require 'hoe'
require 'bundler/gem_tasks'
require 'rake/testtask'

ENV['BENCHMARK'] = 'yes'

task :docs => :generate
task :test => :generate

PARSER_FILES = %w[
lib/rdoc/rd/block_parser.rb
lib/rdoc/rd/inline_parser.rb
lib/rdoc/markdown.rb
lib/rdoc/markdown/literals_1_8.rb
lib/rdoc/markdown/literals_1_9.rb
lib/rdoc/rd/block_parser.ry
lib/rdoc/rd/inline_parser.ry
lib/rdoc/markdown.kpeg
lib/rdoc/markdown/literals_1_8.kpeg
lib/rdoc/markdown/literals_1_9.kpeg
]

Hoe.plugin :git
Hoe.plugin :kpeg
Hoe.plugin :minitest

$rdoc_rakefile = true

hoe = Hoe.spec 'rdoc' do
developer 'Eric Hodel', '[email protected]'
developer 'Dave Thomas', ''
developer 'Phil Hagelberg', '[email protected]'
developer 'Tony Strauss', '[email protected]'

self.rsync_args = '-avz'
rdoc_locations << 'docs.seattlerb.org:/data/www/docs.seattlerb.org/rdoc/'
rdoc_locations << '[email protected]:/var/www/gforge-projects/rdoc/'

spec_extras[:post_install_message] = <<-MESSAGE
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
MESSAGE

self.licenses << 'Ruby'
self.readme_file = 'README.rdoc'
self.history_file = 'History.rdoc'
self.testlib = :minitest
self.extra_rdoc_files += %w[
CVE-2013-0256.rdoc
CONTRIBUTING.rdoc
ExampleMarkdown.md
ExampleRDoc.rdoc
History.rdoc
LEGAL.rdoc
LICENSE.rdoc
README.rdoc
RI.rdoc
TODO.rdoc
]

self.clean_globs += PARSER_FILES
self.kpeg_flags = '-fsv' if self.respond_to? :kpeg_flags= # no plugin

require_ruby_version '>= 1.8.7'
extra_deps << ['json', '~> 1.4']
extra_dev_deps << ['racc', '~> 1.4', '> 1.4.10']
extra_dev_deps << ['minitest', '~> 4']

extra_rdoc_files << 'Rakefile'
spec_extras['required_rubygems_version'] = '>= 1.3'
spec_extras['homepage'] = 'http://docs.seattlerb.org/rdoc'
end

hoe.test_prelude = 'gem "minitest", "~> 4.0"'

def rake(*args)
sh $0, *args
end

need_racc = PARSER_FILES.any? do |rb_file|
ry_file = rb_file.gsub(/\.rb\z/, ".ry")
not File.exist?(rb_file) or
(File.exist?(ry_file) and File.mtime(rb_file) < File.mtime(ry_file))
end

if need_racc
Rake::Task["default"].prerequisites.clear
task :default do
rake "check_extra_deps"
rake "install_plugins"
rake "newb"
end
end
task :default => :test

Rake::Task['docs'].actions.clear
task :docs do
Expand All @@ -106,28 +39,49 @@ task :docs do
RDoc::RDoc.new.document options
end

# requires ruby 1.8 and ruby 1.8 to build
hoe.clean_globs -= PARSER_FILES.grep(/literals_/)
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/test_*.rb']
end

task :generate => :isolate
task :generate => PARSER_FILES
task :check_manifest => :generate
path = "pkg/#{Bundler::GemHelper.gemspec.full_name}"

package_parser_files = PARSER_FILES.map do |parser_file|
name = File.basename(parser_file, File.extname(parser_file))
_path = File.dirname(parser_file)
package_parser_file = "#{path}/#{name}.rb"
parsed_file = "#{_path}/#{name}.rb"

rule '.rb' => '.ry' do |t|
racc = Gem.bin_path 'racc', 'racc'
file package_parser_file => parsed_file # ensure copy runs before racc

ruby "-rubygems #{racc} -l -o #{t.name} #{t.source}"
package_parser_file
end

path = "pkg/#{hoe.spec.full_name}"
parsed_files = PARSER_FILES.map do |parser_file|
name = File.basename(parser_file, File.extname(parser_file))
_path = File.dirname(parser_file)
parsed_file = "#{_path}/#{name}.rb"

file parsed_file do |t|
puts "Generating #{parsed_file}..."
if parser_file =~ /\.ry\z/ # need racc
racc = Gem.bin_path 'racc', 'racc'
rb_file = parser_file.gsub(/\.ry\z/, ".rb")
ruby "-rubygems #{racc} -l -o #{rb_file} #{parser_file}"
elsif parser_file =~ /\.kpeg\z/ # need kpeg
kpeg = Gem.bin_path 'kpeg', 'kpeg'
rb_file = parser_file.gsub(/\.kpeg\z/, ".rb")
ruby "-rubygems #{kpeg} -fsv -o #{rb_file} #{parser_file}"
end
end

package_parser_files = PARSER_FILES.map do |parser_file|
package_parser_file = "#{path}/#{parser_file}"
file package_parser_file => parser_file # ensure copy runs before racc
package_parser_file
parsed_file
end

task "#{path}.gem" => package_parser_files
task :generate => parsed_files
task :check_manifest => :generate

# These tasks expect to have the following directory structure:
#
Expand Down
66 changes: 66 additions & 0 deletions rdoc.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require 'rdoc'

Gem::Specification.new do |s|
s.name = "rdoc"
s.version = RDoc::VERSION

s.required_rubygems_version = Gem::Requirement.new(">= 1.3") if
s.respond_to? :required_rubygems_version=

s.require_paths = ["lib"]
s.authors = [
"Eric Hodel",
"Dave Thomas",
"Phil Hagelberg",
"Tony Strauss",
"Zachary Scott"
]

s.description = <<-DESCRIPTION
RDoc produces HTML and command-line documentation for Ruby projects.
RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentation from the command-line.
DESCRIPTION

s.email = ["[email protected]", "[email protected]"]

s.executables = ["rdoc", "ri"]

s.extra_rdoc_files += %w[
CVE-2013-0256.rdoc
CONTRIBUTING.rdoc
ExampleMarkdown.md
ExampleRDoc.rdoc
History.rdoc
LEGAL.rdoc
LICENSE.rdoc
README.rdoc
RI.rdoc
TODO.rdoc
]

s.files = File.readlines("Manifest.txt").map { |l| l.gsub("\n",'') }

s.homepage = "http://docs.seattlerb.org/rdoc"
s.licenses = ["Ruby"]
s.post_install_message = <<-MESSAGE
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
MESSAGE

s.rdoc_options = ["--main", "README.rdoc"]
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
s.rubygems_version = "2.5.2"
s.summary = "RDoc produces HTML and command-line documentation for Ruby projects"

s.add_runtime_dependency("json", "~> 1.4")
s.add_development_dependency("rake", "~> 10.5")
s.add_development_dependency("racc", "~> 1.4", "> 1.4.10")
s.add_development_dependency("kpeg", "~> 0.9")
s.add_development_dependency("minitest", "~> 4")
end