Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 138 lines (102 sloc) 3.561 kb
c0ff6ec Simone Carletti Simplify Rakefile
authored
1 require 'rubygems'
2 require 'rspec/core/rake_task'
9294603 Simone Carletti rake/gempackagetask is deprecated. Use rubygems/package_task instead.
authored
3 require 'rubygems/package_task'
c0ff6ec Simone Carletti Simplify Rakefile
authored
4 require 'yard'
5 require 'yard/rake/yardoc_task'
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
6
c0ff6ec Simone Carletti Simplify Rakefile
authored
7 $:.unshift(File.dirname(__FILE__) + '/lib')
8 require 'whois'
add6330 Simone Carletti Double quotes
authored
9
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
10
be24e73 Simone Carletti Base GEM skeleton.
authored
11 # Common package properties
c018532 Simone Carletti 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 Simone Carletti 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 Simone Carletti Double quotes
authored
18
19
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
20 # Run test by default.
247a885 Simone Carletti Rename :rspec task to :spec.
authored
21 task :default => :spec
22 task :test => :spec
c018532 Simone Carletti 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 Simone Carletti 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 Simone Carletti Minimum Ruby version is now 1.8.7
authored
34
35 s.required_ruby_version = ">= 1.8.7"
36
70e4604 Simone Carletti Standardize
authored
37 s.authors = ["Simone Carletti"]
38 s.email = ["weppos@weppos.net"]
afd063a Simone Carletti Minimum Ruby version is now 1.8.7
authored
39 s.homepage = "http://www.ruby-whois.org"
c0ff6ec Simone Carletti Simplify Rakefile
authored
40 s.rubyforge_project = "whois"
be24e73 Simone Carletti Base GEM skeleton.
authored
41
5f26417 Simone Carletti Add support for rubygems-test.
authored
42 s.files = %w( Rakefile LICENSE .gemtest .rspec .yardopts ) +
43 Dir.glob("*.{rdoc,gemspec}") +
404a8fd Simone Carletti GoodBye Test::Unit, and thanks for all the fish!
authored
44 Dir.glob("{bin,lib,spec}/**/*")
48351b2 Simone Carletti ruby-whois executable is not installed when the Gem is installed.
authored
45 s.executables = ["ruby-whois"]
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
46 s.require_paths = ["lib"]
be24e73 Simone Carletti Base GEM skeleton.
authored
47
c018532 Simone Carletti 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
8fcab72 Simone Carletti Fixed error "rake is not part of the bundle. Add it to Gemfile."
authored
53 s.add_development_dependency "rake", "~> 0.9"
59b0000 Simone Carletti $ bundle update rspec
authored
54 s.add_development_dependency "rspec", "~> 2.6.0"
8fcab72 Simone Carletti Fixed error "rake is not part of the bundle. Add it to Gemfile."
authored
55 s.add_development_dependency "mocha"
56 s.add_development_dependency "yard"
be24e73 Simone Carletti Base GEM skeleton.
authored
57 end
58
c0ff6ec Simone Carletti Simplify Rakefile
authored
59 # This task actually builds the gem.
60 # We also regenerate a static .gemspec file.
9294603 Simone Carletti rake/gempackagetask is deprecated. Use rubygems/package_task instead.
authored
61 Gem::PackageTask.new(spec) do |pkg|
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
62 pkg.gem_spec = spec
63 end
be24e73 Simone Carletti Base GEM skeleton.
authored
64
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
65 desc "Build the gemspec file #{spec.name}.gemspec"
66 task :gemspec do
67 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
68 File.open(file, "w") {|f| f << spec.to_ruby }
69 end
70
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
71
d3842b6 Simone Carletti Install RSpec 2
authored
72 # Run all the specs in the /spec folder
247a885 Simone Carletti Rename :rspec task to :spec.
authored
73 RSpec::Core::RakeTask.new
d3842b6 Simone Carletti Install RSpec 2
authored
74
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
75
6c55e45 Simone Carletti Update Ruby versions
authored
76 namespace :multitest do
77 RUBIES = %w( ruby-1.8.7-p334 ruby-1.9.2-p180 jruby-1.6.0.RC2 ree-1.8.7-2011.03 )
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
78
149f79c Simone Carletti Cleanup rake test tasks
authored
79 desc "Run tests for all rubies"
6c55e45 Simone Carletti Update Ruby versions
authored
80 task :all => :ensure_rvm do
404a8fd Simone Carletti GoodBye Test::Unit, and thanks for all the fish!
authored
81 sh "rvm #{RUBIES.join(",")} rake test"
149f79c Simone Carletti Cleanup rake test tasks
authored
82 end
83
84 task :ensure_rvm do
85 File.exist?(File.expand_path("~/.rvm/scripts/rvm")) || abort("RVM is not available")
86 end
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
87
6c55e45 Simone Carletti Update Ruby versions
authored
88 RUBIES.each do |ruby|
89 desc "Run tests against Ruby #{ruby}"
90 task ruby => "test:ensure_rvm" do
404a8fd Simone Carletti GoodBye Test::Unit, and thanks for all the fish!
authored
91 sh "rvm #{ruby} rake test"
6c55e45 Simone Carletti Update Ruby versions
authored
92 end
93 end
94
39d7208 Simone Carletti rake multitest:setup/bundleize
authored
95 task :bundleize do
94d1af9 Simone Carletti rake multitest:setup
authored
96 sh "rvm #{RUBIES.join(",")} gem install bundler"
39d7208 Simone Carletti rake multitest:setup/bundleize
authored
97 end
98
99 task :setup do
100 sh "rvm #{RUBIES.join(",")} exec bundle install"
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
101 end
102 end
103
104
70e4604 Simone Carletti Standardize
authored
105 task :clean_gemspec do
106 rm "#{spec.name}.gemspec" rescue nil
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
107 end
108
70e4604 Simone Carletti Standardize
authored
109 task :clean => [:clean_gemspec]
110 task :clobber => [:clobber_package]
c018532 Simone Carletti 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 Simone Carletti Replace RDoc with YARD
authored
115
c0ff6ec Simone Carletti Simplify Rakefile
authored
116 YARD::Rake::YardocTask.new(:yardoc) do |y|
117 y.options = ["--output-dir", "yardoc"]
118 end
4c633ca Simone Carletti Replace RDoc with YARD
authored
119
c0ff6ec Simone Carletti Simplify Rakefile
authored
120 namespace :yardoc do
121 task :clobber do
122 rm_r "yardoc" rescue nil
4c633ca Simone Carletti Replace RDoc with YARD
authored
123 end
124 end
125
c0ff6ec Simone Carletti Simplify Rakefile
authored
126 task :clobber => "yardoc:clobber"
54b1d16 Simone Carletti Added Rake :console task.
authored
127
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
128
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
129 desc "Open an irb session preloaded with this library"
130 task :console do
131 sh "irb -rubygems -I lib -r whois.rb"
132 end
133
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
134
afb4065 Simone Carletti Super simple and super buggy initial version. It works, but sometimes it...
authored
135 Dir["tasks/**/*.rake"].each do |file|
136 load(file)
137 end
Something went wrong with that request. Please try again.