Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 134 lines (94 sloc) 3.231 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"
dae9cf3 @weppos Update development dependencies
authored
45 s.add_development_dependency "rspec", "~> 2.7.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
247a885 @weppos Rename :rspec task to :spec.
authored
66 RSpec::Core::RakeTask.new
d3842b6 @weppos Install RSpec 2
authored
67
d9ad2e0 @weppos Add cross-ruby test tasks
authored
68
6c55e45 @weppos Update Ruby versions
authored
69 namespace :multitest do
5f7a124 @weppos Update rubies
authored
70 RUBIES = %w( ruby-1.8.7 ruby-1.9.2 jruby ree )
d9ad2e0 @weppos Add cross-ruby test tasks
authored
71
149f79c @weppos Cleanup rake test tasks
authored
72 desc "Run tests for all rubies"
6c55e45 @weppos Update Ruby versions
authored
73 task :all => :ensure_rvm do
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
74 sh "rvm #{RUBIES.join(",")} rake test"
149f79c @weppos Cleanup rake test tasks
authored
75 end
76
77 task :ensure_rvm do
78 File.exist?(File.expand_path("~/.rvm/scripts/rvm")) || abort("RVM is not available")
79 end
d9ad2e0 @weppos Add cross-ruby test tasks
authored
80
6c55e45 @weppos Update Ruby versions
authored
81 RUBIES.each do |ruby|
82 desc "Run tests against Ruby #{ruby}"
83 task ruby => "test:ensure_rvm" do
404a8fd @weppos GoodBye Test::Unit, and thanks for all the fish!
authored
84 sh "rvm #{ruby} rake test"
6c55e45 @weppos Update Ruby versions
authored
85 end
86 end
87
39d7208 @weppos rake multitest:setup/bundleize
authored
88 task :bundleize do
94d1af9 @weppos rake multitest:setup
authored
89 sh "rvm #{RUBIES.join(",")} gem install bundler"
39d7208 @weppos rake multitest:setup/bundleize
authored
90 end
91
92 task :setup do
93 sh "rvm #{RUBIES.join(",")} exec bundle install"
d9ad2e0 @weppos Add cross-ruby test tasks
authored
94 end
95 end
96
97
70e4604 @weppos Standardize
authored
98 task :clean_gemspec do
99 rm "#{spec.name}.gemspec" rescue nil
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
100 end
101
70e4604 @weppos Standardize
authored
102 task :clean => [:clean_gemspec]
103 task :clobber => [:clobber_package]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
104
105 desc "Package the library and generates the gemspec"
106 task :package => [:gemspec]
107
4c633ca @weppos Replace RDoc with YARD
authored
108
1785e41 @weppos Move require statements near to the corresponding usage
authored
109 require 'yard'
110 require 'yard/rake/yardoc_task'
111
c0ff6ec @weppos Simplify Rakefile
authored
112 YARD::Rake::YardocTask.new(:yardoc) do |y|
113 y.options = ["--output-dir", "yardoc"]
114 end
4c633ca @weppos Replace RDoc with YARD
authored
115
c0ff6ec @weppos Simplify Rakefile
authored
116 namespace :yardoc do
117 task :clobber do
118 rm_r "yardoc" rescue nil
4c633ca @weppos Replace RDoc with YARD
authored
119 end
120 end
121
c0ff6ec @weppos Simplify Rakefile
authored
122 task :clobber => "yardoc:clobber"
54b1d16 @weppos Added Rake :console task.
authored
123
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
124
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
125 desc "Open an irb session preloaded with this library"
126 task :console do
127 sh "irb -rubygems -I lib -r whois.rb"
128 end
129
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
130
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes…
authored
131 Dir["tasks/**/*.rake"].each do |file|
132 load(file)
133 end
Something went wrong with that request. Please try again.