Skip to content

Commit

Permalink
Simplify Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Mar 11, 2011
1 parent 039b52d commit c0ff6ec
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 52 deletions.
1 change: 0 additions & 1 deletion LICENSE
Expand Up @@ -20,4 +20,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

75 changes: 24 additions & 51 deletions Rakefile
@@ -1,16 +1,17 @@
require "rubygems"
require "rake/testtask"
require "rspec/core/rake_task"
require "rake/gempackagetask"
require 'rubygems'
require 'rake/testtask'
require 'rspec/core/rake_task'
require 'rake/gempackagetask'
require 'yard'
require 'yard/rake/yardoc_task'

$:.unshift(File.dirname(__FILE__) + "/lib")
require "whois"
$:.unshift(File.dirname(__FILE__) + '/lib')
require 'whois'


# Common package properties
PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
RUBYFORGE_PROJECT = "whois"

if ENV['SNAPSHOT'].to_i == 1
PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
Expand All @@ -30,18 +31,14 @@ spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.summary = "An intelligent pure Ruby WHOIS client and parser."
s.description = <<-EOD
Whois is an intelligent WHOIS client and parser written in pure Ruby. \
It can query registry data for IPv4, IPv6 and top level domains, \
parse and convert responses into easy-to-use Ruby objects.
EOD
s.description = "Whois is an intelligent WHOIS client and parser written in pure Ruby. It can query registry data for IPv4, IPv6 and top level domains, parse and convert responses into easy-to-use Ruby objects."

s.required_ruby_version = ">= 1.8.7"

s.author = "Simone Carletti"
s.email = "weppos@weppos.net"
s.homepage = "http://www.ruby-whois.org"
s.rubyforge_project = RUBYFORGE_PROJECT
s.rubyforge_project = "whois"

s.files = %w( Rakefile LICENSE .gemtest .rspec .yardopts ) +
Dir.glob("*.{rdoc,gemspec}") +
Expand All @@ -59,10 +56,8 @@ spec = Gem::Specification.new do |s|
s.add_development_dependency("yard")
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.
# This task actually builds the gem.
# We also regenerate a static .gemspec file.
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
Expand Down Expand Up @@ -126,46 +121,24 @@ desc "Package the library and generates the gemspec"
task :package => [:gemspec]


begin
require "yard"
require "yard/rake/yardoc_task"
YARD::Rake::YardocTask.new(:yardoc) do |y|
y.options = ["--output-dir", "yardoc"]
end

YARD::Rake::YardocTask.new(:yardoc) do |y|
y.options = ["--output-dir", "yardoc"]
namespace :yardoc do
desc "Publish YARD documentation to the site"
task :publish => ["yardoc:clobber", "yardoc"] do
ENV["username"] || raise(ArgumentError, "Missing ssh username")
sh "rsync -avz --delete yardoc/ #{ENV["username"]}@alamak:/home/#{ENV["username"]}/ruby-whois.org/api"
end

namespace :yardoc do
desc "Publish YARD documentation to the site"
task :publish => ["yardoc:clobber", "yardoc"] do
ENV["username"] || raise(ArgumentError, "Missing ssh username")
sh "rsync -avz --delete yardoc/ #{ENV["username"]}@alamak:/home/#{ENV["username"]}/ruby-whois.org/api"
end

desc "Remove YARD products"
task :clobber do
rm_r "yardoc" rescue nil
end
desc "Remove YARD products"
task :clobber do
rm_r "yardoc" rescue nil
end

task :clobber => "yardoc:clobber"
rescue LoadError
puts "YARD is not available"
end


begin
require "rcov/rcovtask"

desc "Create a code coverage report"
Rcov::RcovTask.new do |t|
t.test_files = FileList["test/**/*_test.rb"]
t.ruby_opts << "-Itest -x mocha,rcov,Rakefile"
t.verbose = true
end
rescue LoadError
task :clobber_rcov
# puts "RCov is not available"
end
task :clobber => "yardoc:clobber"


desc "Open an irb session preloaded with this library"
Expand Down

0 comments on commit c0ff6ec

Please sign in to comment.