Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 136 lines (96 sloc) 3.273 kb
c0ff6ec @weppos Simplify Rakefile
authored
1 require 'rubygems'
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
2
c0ff6ec @weppos Simplify Rakefile
authored
3 $:.unshift(File.dirname(__FILE__) + '/lib')
4 require 'whois'
add6330 @weppos Double quotes
authored
5
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
6
be24e73 @weppos Base GEM skeleton.
authored
7 # Common package properties
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
8 PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
9 PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
be24e73 @weppos Base GEM skeleton.
authored
10
11 if ENV['SNAPSHOT'].to_i == 1
12 PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
13 end
add6330 @weppos Double quotes
authored
14
15
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
16 # Run test by default.
247a885 @weppos Rename :rspec task to :spec.
authored
17 task :default => :spec
18 task :test => :spec
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
19
20 spec = Gem::Specification.new do |s|
21 s.name = PKG_NAME
22 s.version = PKG_VERSION
23 s.summary = "An intelligent pure Ruby WHOIS client and parser."
c0ff6ec @weppos Simplify Rakefile
authored
24 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
25
26 s.required_ruby_version = ">= 1.8.7"
27
70e4604 @weppos Standardize
authored
28 s.authors = ["Simone Carletti"]
29 s.email = ["weppos@weppos.net"]
afd063a @weppos Minimum Ruby version is now 1.8.7
authored
30 s.homepage = "http://www.ruby-whois.org"
c0ff6ec @weppos Simplify Rakefile
authored
31 s.rubyforge_project = "whois"
be24e73 @weppos Base GEM skeleton.
authored
32
5f26417 @weppos Add support for rubygems-test.
authored
33 s.files = %w( Rakefile LICENSE .gemtest .rspec .yardopts ) +
34 Dir.glob("*.{rdoc,gemspec}") +
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
35 Dir.glob("{bin,lib,spec}/**/*")
48351b2 @weppos ruby-whois executable is not installed when the Gem is installed.
authored
36 s.executables = ["ruby-whois"]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
37 s.require_paths = ["lib"]
be24e73 @weppos Base GEM skeleton.
authored
38
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
39 # If you want to depend on other gems, add them here, along with any
40 # relevant versions
41 # s.add_dependency("some_other_gem", "~> 0.1.0")
42
43 # If your tests use any gems, include them here
8fcab72 @weppos Fixed error "rake is not part of the bundle. Add it to Gemfile."
authored
44 s.add_development_dependency "rake", "~> 0.9"
77d2220 @weppos Upgrade to rspec 2.8
authored
45 s.add_development_dependency "rspec", "~> 2.8.0"
8fcab72 @weppos Fixed error "rake is not part of the bundle. Add it to Gemfile."
authored
46 s.add_development_dependency "mocha"
47 s.add_development_dependency "yard"
be24e73 @weppos Base GEM skeleton.
authored
48 end
49
1785e41 @weppos Move require statements near to the corresponding usage
authored
50
51 require 'rubygems/package_task'
52
9294603 @weppos rake/gempackagetask is deprecated. Use rubygems/package_task instead.
authored
53 Gem::PackageTask.new(spec) do |pkg|
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
54 pkg.gem_spec = spec
55 end
be24e73 @weppos Base GEM skeleton.
authored
56
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
57 desc "Build the gemspec file #{spec.name}.gemspec"
58 task :gemspec do
59 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
60 File.open(file, "w") {|f| f << spec.to_ruby }
61 end
62
d9ad2e0 @weppos Add cross-ruby test tasks
authored
63
1785e41 @weppos Move require statements near to the corresponding usage
authored
64 require 'rspec/core/rake_task'
65
0fec60c @weppos Don't run rake task in verbose mode by default
authored
66 RSpec::Core::RakeTask.new do |t|
67 t.verbose = !!ENV["VERBOSE"]
68 end
d3842b6 @weppos Install RSpec 2
authored
69
d9ad2e0 @weppos Add cross-ruby test tasks
authored
70
6c55e45 @weppos Update Ruby versions
authored
71 namespace :multitest do
5f7a124 @weppos Update rubies
authored
72 RUBIES = %w( ruby-1.8.7 ruby-1.9.2 jruby ree )
d9ad2e0 @weppos Add cross-ruby test tasks
authored
73
149f79c @weppos Cleanup rake test tasks
authored
74 desc "Run tests for all rubies"
6c55e45 @weppos Update Ruby versions
authored
75 task :all => :ensure_rvm do
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
76 sh "rvm #{RUBIES.join(",")} rake test"
149f79c @weppos Cleanup rake test tasks
authored
77 end
78
79 task :ensure_rvm do
80 File.exist?(File.expand_path("~/.rvm/scripts/rvm")) || abort("RVM is not available")
81 end
d9ad2e0 @weppos Add cross-ruby test tasks
authored
82
6c55e45 @weppos Update Ruby versions
authored
83 RUBIES.each do |ruby|
84 desc "Run tests against Ruby #{ruby}"
85 task ruby => "test:ensure_rvm" do
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
86 sh "rvm #{ruby} rake test"
6c55e45 @weppos Update Ruby versions
authored
87 end
88 end
89
39d7208 @weppos rake multitest:setup/bundleize
authored
90 task :bundleize do
94d1af9 @weppos rake multitest:setup
authored
91 sh "rvm #{RUBIES.join(",")} gem install bundler"
39d7208 @weppos rake multitest:setup/bundleize
authored
92 end
93
94 task :setup do
95 sh "rvm #{RUBIES.join(",")} exec bundle install"
d9ad2e0 @weppos Add cross-ruby test tasks
authored
96 end
97 end
98
99
70e4604 @weppos Standardize
authored
100 task :clean_gemspec do
101 rm "#{spec.name}.gemspec" rescue nil
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
102 end
103
70e4604 @weppos Standardize
authored
104 task :clean => [:clean_gemspec]
105 task :clobber => [:clobber_package]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
106
107 desc "Package the library and generates the gemspec"
108 task :package => [:gemspec]
109
4c633ca @weppos Replace RDoc with YARD
authored
110
1785e41 @weppos Move require statements near to the corresponding usage
authored
111 require 'yard'
112 require 'yard/rake/yardoc_task'
113
c0ff6ec @weppos Simplify Rakefile
authored
114 YARD::Rake::YardocTask.new(:yardoc) do |y|
115 y.options = ["--output-dir", "yardoc"]
116 end
4c633ca @weppos Replace RDoc with YARD
authored
117
c0ff6ec @weppos Simplify Rakefile
authored
118 namespace :yardoc do
119 task :clobber do
120 rm_r "yardoc" rescue nil
4c633ca @weppos Replace RDoc with YARD
authored
121 end
122 end
123
c0ff6ec @weppos Simplify Rakefile
authored
124 task :clobber => "yardoc:clobber"
54b1d16 @weppos Added Rake :console task.
authored
125
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
126
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
127 desc "Open an irb session preloaded with this library"
128 task :console do
129 sh "irb -rubygems -I lib -r whois.rb"
130 end
131
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
132
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes it...
authored
133 Dir["tasks/**/*.rake"].each do |file|
134 load(file)
135 end
Something went wrong with that request. Please try again.