Included Modules

Bones::Plugins::Rubyforge

Public Instance Methods

define_tasks() click to toggle source
    # File lib/bones/plugins/rubyforge.rb, line 41
41:   def define_tasks
42:     return unless have? :rubyforge
43:     config = ::Bones.config
44: 
45:     namespace :rubyforge do
46:       desc 'Package gem and upload to RubyForge'
47:       task :release => ['gem:clobber_package', 'gem:package'] do |t|
48:         v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
49:         abort "Versions don't match #{v} vs #{config.version}" if v != config.version
50:         pkg = "pkg/#{config.gem._spec.full_name}"
51: 
52:         rf = RubyForge.new
53:         rf.configure rescue nil
54:         puts 'Logging in'
55:         rf.login
56: 
57:         c = rf.userconfig
58:         c['release_notes'] = config.description if config.description
59:         c['release_changes'] = config.changes if config.changes
60:         c['preformatted'] = true
61: 
62:         files = Dir.glob("#{pkg}*.*")
63: 
64:         puts "Releasing #{config.name} v. #{config.version}"
65:         rf.add_release config.rubyforge.name, config.name, config.version, *files
66:       end
67: 
68:       desc 'Publish RDoc to RubyForge'
69:       task :doc_release => %(doc:clobber_rdoc doc:rdoc) do
70:         rubyforge_config = YAML.load(
71:           File.read(File.expand_path('~/.rubyforge/user-config.yml'))
72:         )
73: 
74:         host = "#{rubyforge_config['username']}@rubyforge.org"
75:         remote_dir = "/var/www/gforge-projects/#{config.rubyforge.name}/"
76:         remote_dir << config.rdoc.remote_dir if config.rdoc.remote_dir
77:         local_dir = config.rdoc.dir
78: 
79:         Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
80:       end
81:     end
82: 
83:   end
initialize_rubyforge() click to toggle source
    # File lib/bones/plugins/rubyforge.rb, line 6
 6:   def initialize_rubyforge
 7:     require 'rubyforge'
 8:     require 'rake/contrib/sshpublisher'
 9:     have?(:rubyforge) { true }
10: 
11:     ::Bones.config {
12:       desc 'Configuration settings for RubyForge publishing.'
13:       rubyforge {
14:         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.
15:       }
16: 
17:       rdoc {
18:         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.
19:       }
20:     }
21:   rescue LoadError
22:     have?(:rubyforge) { false }
23:   end
post_load() click to toggle source
    # File lib/bones/plugins/rubyforge.rb, line 35
35:   def post_load
36:     return unless have? :rubyforge
37:     config = ::Bones.config
38:     config.rubyforge.name ||= config.name
39:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.