Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 145 lines (108 sloc) 3.937 kB
c0ff6ec @weppos Simplify Rakefile
authored
1 require 'rubygems'
2 require 'rspec/core/rake_task'
3 require 'rake/gempackagetask'
4 require 'yard'
5 require 'yard/rake/yardoc_task'
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
6
c0ff6ec @weppos Simplify Rakefile
authored
7 $:.unshift(File.dirname(__FILE__) + '/lib')
8 require 'whois'
add6330 @weppos Double quotes
authored
9
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
10
be24e73 @weppos Base GEM skeleton.
authored
11 # Common package properties
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
12 PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
13 PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
be24e73 @weppos Base GEM skeleton.
authored
14
15 if ENV['SNAPSHOT'].to_i == 1
16 PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
17 end
add6330 @weppos Double quotes
authored
18
19
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
20 # Run test by default.
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
21 task :default => :rspec
22 task :test => :rspec
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
23
24 # This builds the actual gem. For details of what all these options
25 # mean, and other ones you can add, check the documentation here:
26 #
27 # http://rubygems.org/read/chapter/20
28 #
29 spec = Gem::Specification.new do |s|
30 s.name = PKG_NAME
31 s.version = PKG_VERSION
32 s.summary = "An intelligent pure Ruby WHOIS client and parser."
c0ff6ec @weppos Simplify Rakefile
authored
33 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."
afd063a @weppos Minimum Ruby version is now 1.8.7
authored
34
35 s.required_ruby_version = ">= 1.8.7"
36
37 s.author = "Simone Carletti"
38 s.email = "weppos@weppos.net"
39 s.homepage = "http://www.ruby-whois.org"
c0ff6ec @weppos Simplify Rakefile
authored
40 s.rubyforge_project = "whois"
be24e73 @weppos Base GEM skeleton.
authored
41
5f26417 @weppos Add support for rubygems-test.
authored
42 s.files = %w( Rakefile LICENSE .gemtest .rspec .yardopts ) +
43 Dir.glob("*.{rdoc,gemspec}") +
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
44 Dir.glob("{bin,lib,spec}/**/*")
48351b2 @weppos ruby-whois executable is not installed when the Gem is installed.
authored
45 s.executables = ["ruby-whois"]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
46 s.require_paths = ["lib"]
be24e73 @weppos Base GEM skeleton.
authored
47
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
48 # If you want to depend on other gems, add them here, along with any
49 # relevant versions
50 # s.add_dependency("some_other_gem", "~> 0.1.0")
51
52 # If your tests use any gems, include them here
5077808 @weppos Upgrade to RSpec 2.5.0
authored
53 s.add_development_dependency("rspec", "~> 2.5.0")
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
54 s.add_development_dependency("mocha")
803568b @weppos Add YARD development dependency.
authored
55 s.add_development_dependency("yard")
be24e73 @weppos Base GEM skeleton.
authored
56 end
57
c0ff6ec @weppos Simplify Rakefile
authored
58 # This task actually builds the gem.
59 # We also regenerate a static .gemspec file.
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
60 Rake::GemPackageTask.new(spec) do |pkg|
61 pkg.gem_spec = spec
62 end
be24e73 @weppos Base GEM skeleton.
authored
63
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
64 desc "Build the gemspec file #{spec.name}.gemspec"
65 task :gemspec do
66 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
67 File.open(file, "w") {|f| f << spec.to_ruby }
68 end
69
d9ad2e0 @weppos Add cross-ruby test tasks
authored
70
d3842b6 @weppos Install RSpec 2
authored
71 # Run all the specs in the /spec folder
72 RSpec::Core::RakeTask.new(:rspec)
73
d9ad2e0 @weppos Add cross-ruby test tasks
authored
74
6c55e45 @weppos Update Ruby versions
authored
75 namespace :multitest do
76 RUBIES = %w( ruby-1.8.7-p334 ruby-1.9.2-p180 jruby-1.6.0.RC2 ree-1.8.7-2011.03 )
d9ad2e0 @weppos Add cross-ruby test tasks
authored
77
149f79c @weppos Cleanup rake test tasks
authored
78 desc "Run tests for all rubies"
6c55e45 @weppos Update Ruby versions
authored
79 task :all => :ensure_rvm do
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
80 sh "rvm #{RUBIES.join(",")} rake test"
149f79c @weppos Cleanup rake test tasks
authored
81 end
82
83 task :ensure_rvm do
84 File.exist?(File.expand_path("~/.rvm/scripts/rvm")) || abort("RVM is not available")
85 end
d9ad2e0 @weppos Add cross-ruby test tasks
authored
86
6c55e45 @weppos Update Ruby versions
authored
87 RUBIES.each do |ruby|
88 desc "Run tests against Ruby #{ruby}"
89 task ruby => "test:ensure_rvm" do
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
90 sh "rvm #{ruby} rake test"
6c55e45 @weppos Update Ruby versions
authored
91 end
92 end
93
39d7208 @weppos rake multitest:setup/bundleize
authored
94 task :bundleize do
94d1af9 @weppos rake multitest:setup
authored
95 sh "rvm #{RUBIES.join(",")} gem install bundler"
39d7208 @weppos rake multitest:setup/bundleize
authored
96 end
97
98 task :setup do
99 sh "rvm #{RUBIES.join(",")} exec bundle install"
d9ad2e0 @weppos Add cross-ruby test tasks
authored
100 end
101 end
102
103
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
104 desc "Remove any temporary products, including gemspec"
105 task :clean => [:clobber] do
106 rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")
107 end
108
109 desc "Remove any generated file"
4c633ca @weppos Replace RDoc with YARD
authored
110 task :clobber => [:clobber_rcov, :clobber_package]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
111
112 desc "Package the library and generates the gemspec"
113 task :package => [:gemspec]
114
4c633ca @weppos Replace RDoc with YARD
authored
115
c0ff6ec @weppos Simplify Rakefile
authored
116 YARD::Rake::YardocTask.new(:yardoc) do |y|
117 y.options = ["--output-dir", "yardoc"]
118 end
4c633ca @weppos Replace RDoc with YARD
authored
119
c0ff6ec @weppos Simplify Rakefile
authored
120 namespace :yardoc do
121 desc "Publish YARD documentation to the site"
122 task :publish => ["yardoc:clobber", "yardoc"] do
123 ENV["username"] || raise(ArgumentError, "Missing ssh username")
124 sh "rsync -avz --delete yardoc/ #{ENV["username"]}@alamak:/home/#{ENV["username"]}/ruby-whois.org/api"
4c633ca @weppos Replace RDoc with YARD
authored
125 end
126
c0ff6ec @weppos Simplify Rakefile
authored
127 desc "Remove YARD products"
128 task :clobber do
129 rm_r "yardoc" rescue nil
4c633ca @weppos Replace RDoc with YARD
authored
130 end
131 end
132
c0ff6ec @weppos Simplify Rakefile
authored
133 task :clobber => "yardoc:clobber"
54b1d16 @weppos Added Rake :console task.
authored
134
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
135
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
136 desc "Open an irb session preloaded with this library"
137 task :console do
138 sh "irb -rubygems -I lib -r whois.rb"
139 end
140
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
141
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes…
authored
142 Dir["tasks/**/*.rake"].each do |file|
143 load(file)
144 end
Something went wrong with that request. Please try again.