Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 180 lines (139 sloc) 4.696 kb
add6330 @weppos Double quotes
authored
1 require "rubygems"
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
2 require "rake/testtask"
d3842b6 @weppos Install RSpec 2
authored
3 require "rspec/core/rake_task"
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
4 require "rake/gempackagetask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Parser...
authored
5 begin
add6330 @weppos Double quotes
authored
6 require "hanna/rdoctask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Parser...
authored
7 rescue LoadError
add6330 @weppos Double quotes
authored
8 require "rake/rdoctask"
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
9 end
10
add6330 @weppos Double quotes
authored
11 $:.unshift(File.dirname(__FILE__) + "/lib")
12 require "whois"
13
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
14
be24e73 @weppos Base GEM skeleton.
authored
15 # Common package properties
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
16 PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
17 PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
add6330 @weppos Double quotes
authored
18 RUBYFORGE_PROJECT = "whois"
be24e73 @weppos Base GEM skeleton.
authored
19
20 if ENV['SNAPSHOT'].to_i == 1
21 PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
22 end
add6330 @weppos Double quotes
authored
23
24
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
25 # Run test by default.
d3842b6 @weppos Install RSpec 2
authored
26 task :default => [:rspec, :test]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
27
28 # This builds the actual gem. For details of what all these options
29 # mean, and other ones you can add, check the documentation here:
30 #
31 # http://rubygems.org/read/chapter/20
32 #
33 spec = Gem::Specification.new do |s|
34 s.name = PKG_NAME
35 s.version = PKG_VERSION
36 s.summary = "An intelligent pure Ruby WHOIS client and parser."
37 s.description = <<-EOD
578b5fc @weppos No longer a simple client! :)
authored
38 Whois is an intelligent WHOIS client and parser written in pure Ruby. \
50efc7e @weppos Updated project page
authored
39 It can query registry data for IPv4, IPv6 and top level domains, \
578b5fc @weppos No longer a simple client! :)
authored
40 parse and convert responses into easy-to-use Ruby objects.
c98aec4 @weppos Release Whois 0.5.0
authored
41 EOD
afd063a @weppos Minimum Ruby version is now 1.8.7
authored
42
43 s.required_ruby_version = ">= 1.8.7"
44
45 s.author = "Simone Carletti"
46 s.email = "weppos@weppos.net"
47 s.homepage = "http://www.ruby-whois.org"
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
48 s.rubyforge_project = RUBYFORGE_PROJECT
be24e73 @weppos Base GEM skeleton.
authored
49
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
50 s.has_rdoc = true
51 s.extra_rdoc_files = Dir.glob("*.rdoc")
4c633ca @weppos Replace RDoc with YARD
authored
52 s.rdoc_options = %w( --main README.rdoc )
be24e73 @weppos Base GEM skeleton.
authored
53
afd063a @weppos Minimum Ruby version is now 1.8.7
authored
54 s.files = Dir.glob("*.{rdoc,gemspec}") + Dir.glob("{bin,lib}/**/*")
48351b2 @weppos ruby-whois executable is not installed when the Gem is installed.
authored
55 s.executables = ["ruby-whois"]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
56 s.require_paths = ["lib"]
be24e73 @weppos Base GEM skeleton.
authored
57
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
58 # If you want to depend on other gems, add them here, along with any
59 # relevant versions
60 # s.add_dependency("some_other_gem", "~> 0.1.0")
61
62 # If your tests use any gems, include them here
e70b8df @weppos Upgrade to rspec 2.3.0
authored
63 s.add_development_dependency("rspec", "~> 2.3.0")
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
64 s.add_development_dependency("mocha")
803568b @weppos Add YARD development dependency.
authored
65 s.add_development_dependency("yard")
be24e73 @weppos Base GEM skeleton.
authored
66 end
67
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
68 # This task actually builds the gem. We also regenerate a static
69 # .gemspec file, which is useful if something (i.e. GitHub) will
70 # be automatically building a gem for this project. If you're not
71 # using GitHub, edit as appropriate.
72 Rake::GemPackageTask.new(spec) do |pkg|
73 pkg.gem_spec = spec
74 end
be24e73 @weppos Base GEM skeleton.
authored
75
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
76 desc "Build the gemspec file #{spec.name}.gemspec"
77 task :gemspec do
78 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
79 File.open(file, "w") {|f| f << spec.to_ruby }
80 end
81
d9ad2e0 @weppos Add cross-ruby test tasks
authored
82
d3842b6 @weppos Install RSpec 2
authored
83 # Run all the specs in the /spec folder
84 RSpec::Core::RakeTask.new(:rspec)
85
d9ad2e0 @weppos Add cross-ruby test tasks
authored
86 # Run all the tests in the /test folder
87 Rake::TestTask.new do |t|
88 t.libs << "test"
89 t.test_files = FileList["test/**/*_test.rb"]
90 t.verbose = true
91 end
92
149f79c @weppos Cleanup rake test tasks
authored
93 namespace :test do
d9ad2e0 @weppos Add cross-ruby test tasks
authored
94
149f79c @weppos Cleanup rake test tasks
authored
95 RUBIES = %w( 1.8.7-p302 1.9.1-p378 1.9.2-p0 jruby-1.5.3 ree-1.8.7-2010.02 )
d9ad2e0 @weppos Add cross-ruby test tasks
authored
96
149f79c @weppos Cleanup rake test tasks
authored
97 desc "Run tests for all rubies"
98 task :rubies => :ensure_rvm do
99 sh "rvm #{RUBIES.join(",")} rake default"
100 end
101
102 task :ensure_rvm do
103 File.exist?(File.expand_path("~/.rvm/scripts/rvm")) || abort("RVM is not available")
104 end
d9ad2e0 @weppos Add cross-ruby test tasks
authored
105
149f79c @weppos Cleanup rake test tasks
authored
106 namespace :ruby do
107 RUBIES.each do |ruby|
108 desc "Run tests against Ruby #{ruby}"
109 task ruby => "test:ensure_rvm" do
110 sh "rvm #{ruby} rake default"
111 end
112 end
d9ad2e0 @weppos Add cross-ruby test tasks
authored
113 end
114 end
115
116
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
117 desc "Remove any temporary products, including gemspec"
118 task :clean => [:clobber] do
119 rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")
120 end
121
122 desc "Remove any generated file"
4c633ca @weppos Replace RDoc with YARD
authored
123 task :clobber => [:clobber_rcov, :clobber_package]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
124
125 desc "Package the library and generates the gemspec"
126 task :package => [:gemspec]
127
4c633ca @weppos Replace RDoc with YARD
authored
128
129 begin
130 require "yard"
131 require "yard/rake/yardoc_task"
132
133 YARD::Rake::YardocTask.new(:yardoc) do |y|
134 y.options = ["--output-dir", "yardoc"]
135 end
136
137 namespace :yardoc do
138 desc "Publish YARD documentation to the site"
139 task :publish => ["yardoc:clobber", "yardoc"] do
140 ENV["username"] || raise(ArgumentError, "Missing ssh username")
141 sh "rsync -avz --delete yardoc/ #{ENV["username"]}@alamak:/home/#{ENV["username"]}/ruby-whois.org/api"
142 end
143
144 desc "Remove YARD products"
145 task :clobber do
146 rm_r "yardoc" rescue nil
147 end
148 end
149
150 task :clobber => "yardoc:clobber"
151 rescue LoadError
152 puts "YARD is not available"
153 end
154
155
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
156 begin
157 require "rcov/rcovtask"
158
159 desc "Create a code coverage report"
160 Rcov::RcovTask.new do |t|
161 t.test_files = FileList["test/**/*_test.rb"]
162 t.ruby_opts << "-Itest -x mocha,rcov,Rakefile"
163 t.verbose = true
164 end
165 rescue LoadError
166 task :clobber_rcov
b35722d @weppos Simply ignore optional libraries
authored
167 # puts "RCov is not available"
54b1d16 @weppos Added Rake :console task.
authored
168 end
169
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
170
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
171 desc "Open an irb session preloaded with this library"
172 task :console do
173 sh "irb -rubygems -I lib -r whois.rb"
174 end
175
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
176
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes it...
authored
177 Dir["tasks/**/*.rake"].each do |file|
178 load(file)
179 end
Something went wrong with that request. Please try again.