def define_debug_tasks
desc 'Create a fresh ~/.hoerc file.'
task :config_hoe do
with_config do |config, path|
File.open(path, "w") do |f|
YAML.dump(Hoe::DEFAULT_CONFIG.merge(config), f)
end
editor = ENV['EDITOR'] || 'vi'
system "#{editor} #{path}" if ENV['SHOW_EDITOR'] != 'no'
end
end
desc 'Verify the manifest.'
task :check_manifest => :clean do
check_manifest
end
desc 'Show information about the gem.'
task :debug_gem do
puts spec.to_ruby
end
task :isolate
task :irb => :isolate do
name = spec.name.gsub("-", '/')
file = (spec.files.grep(/^lib\/#{name}\.rb$/).first ||
spec.files.grep(/^lib\/[^\/]*\.rb$/).first)
require = File.basename(file, ".rb") if file
require &&= "-r#{require}"
ruby "#{Hoe::RUBY_FLAGS} -S irb #{require}"
end
end