Class: Rake::XForge::Release
- Defined in:
- lib/rake/contrib/xforge/release.rb
Overview
This Rake task releases files to RubyForge or other SourceForge clones. In its most simple usage it looks like:
# Create a new release of the xforge project on Rubyforge.
task :release => [:gem] do
Rake::XForge::Release.new('xforge') {}
end
The previous example will use defaults where it can. It will prompt you for your RubyForge user name and password before it uploads all gems under the pkg folder and creates a RubyForge release.
While defaults are nice, you may want a little more control. You can specify additional attributes:
:include: /doc/base_attrs.rdoc
-
files - an array of files that should go into the release
-
release_name - name of the release
Example:
task :release => [:gem] do
release_files = FileList[
'pkg/*.gem',
'CHANGES'
]
Rake::XForge::Release.new('xforge') do |xf|
# Never hardcode user name and password in the Rakefile!
xf.user_name = ENV['RUBYFORGE_USER']
xf.password = ENV['RUBYFORGE_PASSWORD']
xf.files = release_files.to_a
xf.release_name = "XForge 0.1"
end
end
This can be invoked from the command line:
rake release RUBYFORGE_USER=aslak_hellesoy RUBYFORGE_PASSWORD=nahnotreal
If you don’t like blocks, you can do like this:
task :release => [:gem] do
xf = Rake::XForge::Release.new('xforge')
... # Set additional attributes
xf.execute
end
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#release_name ⇒ Object
Returns the value of attribute release_name.
Method Summary
Methods inherited from Base
Constructor Details
This class inherits a constructor from Rake::XForge::Base
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
53 54 55 |
# File 'lib/rake/contrib/xforge/release.rb', line 53 def files @files end |
#release_name ⇒ Object
Returns the value of attribute release_name.
53 54 55 |
# File 'lib/rake/contrib/xforge/release.rb', line 53 def release_name @release_name end |