Skip to content

Commit

Permalink
updated rakefile with gem info
Browse files Browse the repository at this point in the history
  • Loading branch information
kernow committed Jan 29, 2010
1 parent c7e9cb0 commit 5fb02f2
Showing 1 changed file with 8 additions and 172 deletions.
180 changes: 8 additions & 172 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,153 +18,32 @@ spec = Gem::Specification.new do |s|
# Change these as appropriate
s.name = "cpanel-gem"
s.version = "0.1.0"
s.summary = "What this thing does"
s.author = "JamieD"
s.email = "youremail@example.com"
s.homepage = "http://yoursite.example.com"
s.summary = "A gem for communicating with cPanel"
s.author = "Jamie Dyer"
s.email = "jamie@kernowsoul.com"
s.homepage = "http://kernowsoul.com"

s.has_rdoc = true
s.has_rdoc = false
# You should probably have a README of some kind. Change the filename
# as appropriate
# s.extra_rdoc_files = %w(README)
# s.rdoc_options = %w(--main README)

# Add any extra files to include in the gem (like your README)
s.files = %w() + Dir.glob("{**/*}")

# You need to put your code in a directory which can then be added to
# the $LOAD_PATH by rubygems. Typically this is lib, but you don't seem
# to have that directory. You'll need to set the line below to whatever
# directory your code is in. Rubygems is going to assume lib if you leave
# this blank.
#
# s.require_paths = ["lib"]

# If you want to depend on other gems, add them here, along with any
# relevant versions
# s.add_dependency("some_other_gem", "~> 0.1.0")

# If your tests use any gems, include them here
# s.add_development_dependency("mocha") # for example

# If you want to publish automatically to rubyforge, you'll may need
# to tweak this, and the publishing task below too.
s.rubyforge_project = "cpanel-gem"
end

# This task actually builds the gem. We also regenerate a static
# .gemspec file, which is useful if something (i.e. GitHub) will
# be automatically building a gem for this project. If you're not
# using GitHub, edit as appropriate.
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec

# Generate the gemspec file for github.
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
File.open(file, "w") {|f| f << spec.to_ruby }
end

# Generate documentation
Rake::RDocTask.new do |rd|
s.test_files = Dir.glob('test/fixtures/*') + Dir.glob('test/*.rb') + Dir.glob('test/*.example')

rd.rdoc_files.include("lib/**/*.rb")
rd.rdoc_dir = "rdoc"
end

desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end

# If you want to publish to RubyForge automatically, here's a simple
# task to help do that. If you don't, just get rid of this.
# Be sure to set up your Rubyforge account details with the Rubyforge
# gem; you'll need to run `rubyforge setup` and `rubyforge config` at
# the very least.
begin
require "rake/contrib/sshpublisher"
namespace :rubyforge do

desc "Release gem and RDoc documentation to RubyForge"
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]

namespace :release do
desc "Release a new version of this gem"
task :gem => [:package] do
require 'rubyforge'
rubyforge = RubyForge.new
rubyforge.configure
rubyforge.login
rubyforge.userconfig['release_notes'] = spec.summary
path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{spec.name}-#{spec.version}.gem")
puts "Publishing #{spec.name}-#{spec.version.to_s} to Rubyforge..."
rubyforge.add_release(spec.rubyforge_project, spec.name, spec.version.to_s, path_to_gem)
end

desc "Publish RDoc to RubyForge."
task :docs => [:rdoc] do
config = YAML.load(
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
)

host = "#{config['username']}@rubyforge.org"
remote_dir = "/var/www/gforge-projects/cpanel-gem/" # Should be the same as the rubyforge project name
local_dir = 'rdoc'

Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
end
end
end
rescue LoadError
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
end


require "rubygems"
require "rake/gempackagetask"
require "rake/rdoctask"



task :default => :package do
puts "Don't forget to write some tests!"
end

# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
#
# http://rubygems.org/read/chapter/20
#
spec = Gem::Specification.new do |s|

# Change these as appropriate
s.name = "cpanel-gem"
s.version = "0.1.0"
s.summary = "What this thing does"
s.author = "JamieD"
s.email = "youremail@example.com"
s.homepage = "http://yoursite.example.com"

s.has_rdoc = true
# You should probably have a README of some kind. Change the filename
# as appropriate
# s.extra_rdoc_files = %w(README)
# s.rdoc_options = %w(--main README)

# Add any extra files to include in the gem (like your README)
s.files = %w(Rakefile) + Dir.glob("{lib/**/*}")
s.require_paths = ["lib"]
s.require_paths = ["lib"]

# If you want to depend on other gems, add them here, along with any
# relevant versions
# s.add_dependency("some_other_gem", "~> 0.1.0")

# If your tests use any gems, include them here
# s.add_development_dependency("mocha") # for example
s.add_development_dependency("shoulda")

# If you want to publish automatically to rubyforge, you'll may need
# to tweak this, and the publishing task below too.
s.rubyforge_project = "cpanel-gem"
end

# This task actually builds the gem. We also regenerate a static
Expand All @@ -190,46 +69,3 @@ desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end

# If you want to publish to RubyForge automatically, here's a simple
# task to help do that. If you don't, just get rid of this.
# Be sure to set up your Rubyforge account details with the Rubyforge
# gem; you'll need to run `rubyforge setup` and `rubyforge config` at
# the very least.
begin
require "rake/contrib/sshpublisher"
namespace :rubyforge do

desc "Release gem and RDoc documentation to RubyForge"
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]

namespace :release do
desc "Release a new version of this gem"
task :gem => [:package] do
require 'rubyforge'
rubyforge = RubyForge.new
rubyforge.configure
rubyforge.login
rubyforge.userconfig['release_notes'] = spec.summary
path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{spec.name}-#{spec.version}.gem")
puts "Publishing #{spec.name}-#{spec.version.to_s} to Rubyforge..."
rubyforge.add_release(spec.rubyforge_project, spec.name, spec.version.to_s, path_to_gem)
end

desc "Publish RDoc to RubyForge."
task :docs => [:rdoc] do
config = YAML.load(
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
)

host = "#{config['username']}@rubyforge.org"
remote_dir = "/var/www/gforge-projects/cpanel-gem/" # Should be the same as the rubyforge project name
local_dir = 'rdoc'

Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
end
end
end
rescue LoadError
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
end

0 comments on commit 5fb02f2

Please sign in to comment.