Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
189 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
module Bones::Plugins::Rubyforge | ||
include ::Bones::Helpers | ||
extend self | ||
|
||
def initialize_rubyforge | ||
require 'rubyforge' | ||
require 'rake/contrib/sshpublisher' | ||
have?(:rubyforge) { true } | ||
|
||
::Bones.config { | ||
desc 'Configuration settings for RubyForge publishing.' | ||
rubyforge { | ||
name nil, :desc => <<-__ | ||
The RubyForge project name where your code will be published. If not | ||
supplied, the RubyForge name will default to the base 'name' of your | ||
gem. The RubyForge name is used when your gem name differs from the | ||
registered project name; for example if you release multiple gems | ||
under the same project. | ||
__ | ||
} | ||
|
||
rdoc { | ||
remote_dir nil, :desc => <<-__ | ||
This is the remote directory to use when publishing RDoc HTML | ||
documentation to your RubyForge project page. If not specified, this | ||
defaults to the root of the project page. | ||
__ | ||
} | ||
} | ||
rescue LoadError | ||
have?(:rubyforge) { false } | ||
end | ||
|
||
def post_load | ||
return unless have? :rubyforge | ||
config = ::Bones.config | ||
config.rubyforge.name ||= config.name | ||
end | ||
|
||
def define_tasks | ||
return unless have? :rubyforge | ||
config = ::Bones.config | ||
|
||
namespace :rubyforge do | ||
desc 'Package gem and upload to RubyForge' | ||
task :release => ['gem:clobber_package', 'gem:package'] do |t| | ||
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z' | ||
abort "Versions don't match #{v} vs #{config.version}" if v != config.version | ||
pkg = "pkg/#{config.gem._spec.full_name}" | ||
|
||
rf = RubyForge.new | ||
rf.configure rescue nil | ||
puts 'Logging in' | ||
rf.login | ||
|
||
c = rf.userconfig | ||
c['release_notes'] = config.description if config.description | ||
c['release_changes'] = config.changes if config.changes | ||
c['preformatted'] = true | ||
|
||
files = Dir.glob("#{pkg}*.*") | ||
|
||
puts "Releasing #{config.name} v. #{config.version}" | ||
rf.add_release config.rubyforge.name, config.name, config.version, *files | ||
end | ||
|
||
desc 'Publish RDoc to RubyForge' | ||
task :doc_release => %w(doc:clobber_rdoc doc:rdoc) do | ||
rubyforge_config = YAML.load( | ||
File.read(File.expand_path('~/.rubyforge/user-config.yml')) | ||
) | ||
|
||
host = "#{rubyforge_config['username']}@rubyforge.org" | ||
remote_dir = "/var/www/gforge-projects/#{config.rubyforge.name}/" | ||
remote_dir << config.rdoc.remote_dir if config.rdoc.remote_dir | ||
local_dir = config.rdoc.dir | ||
|
||
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload | ||
end | ||
end | ||
|
||
end | ||
|
||
end # module Bones::Plugins::Rubyforge | ||
|
||
# EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
|
||
module Bones::Plugins::Yard | ||
include ::Bones::Helpers | ||
extend self | ||
|
||
def initialize_yard | ||
require 'yard' | ||
require 'yard/rake/yardoc_task' | ||
have?(:yard) { true } | ||
|
||
::Bones.config { | ||
desc 'Configuration settings for yard' | ||
yard { | ||
opts [], :desc => 'Array of yard options to use when generating documentation.' | ||
|
||
include %w(^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$), :desc => <<-__ | ||
An array of patterns that will be used to find the files for which | ||
documentation should be generated. This is an array of strings that | ||
will be converted in regular expressions. | ||
__ | ||
|
||
exclude %w(extconf\.rb$), :desc => <<-__ | ||
An array of patterns that will be used to exclude files from yard | ||
processing. This is an array of strings that will be converted in | ||
regular expressions. | ||
__ | ||
|
||
main nil, :desc => <<-__ | ||
The main yard file for the project. This defaults to the project's | ||
README file. | ||
__ | ||
|
||
dir 'doc', :desc => 'Output directory for generated documentation.' | ||
} | ||
} | ||
rescue LoadError | ||
have?(:yard) { false } | ||
end | ||
|
||
def post_load | ||
return unless have? :yard | ||
config = ::Bones.config | ||
|
||
config.exclude << "^#{Regexp.escape(config.yard.dir)}/" | ||
config.yard.main ||= config.readme_file | ||
end | ||
|
||
def define_tasks | ||
return unless have?(:yard) | ||
config = ::Bones.config | ||
|
||
namespace :doc do | ||
desc 'Generate Yard documentation' | ||
YARD::Rake::YardocTask.new(:yard) do |yd| | ||
yard = config.yard | ||
|
||
incl = Regexp.new(yard.include.join('|')) | ||
excl = Regexp.new(yard.exclude.join('|')) | ||
yd.files = config.gem.files.find_all do |fn| | ||
case fn | ||
when excl; false | ||
when incl; true | ||
else false end | ||
end | ||
|
||
yd.options << '--main' << yard.main | ||
yd.options << '--output-dir' << yard.dir | ||
yd.options << '--title' << "#{config.name}-#{config.version} Documentation" | ||
|
||
yd.options.concat(yard.opts) | ||
end | ||
|
||
task :clobber_yard do | ||
rm_r config.yard.dir rescue nil | ||
end | ||
end # namespace :doc | ||
|
||
desc 'Alias to doc:yard' | ||
task :doc => 'doc:yard' | ||
|
||
task :clobber => %w(doc:clobber_yard) | ||
end | ||
|
||
end | ||
|
||
# EOF |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.0 | ||
1.0.0 |