Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 151 lines (108 sloc) 3.74 kb
c0ff6ec Simone Carletti Simplify Rakefile
authored
1 require 'rubygems'
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
2
c0ff6ec Simone Carletti Simplify Rakefile
authored
3 $:.unshift(File.dirname(__FILE__) + '/lib')
4 require 'whois'
add6330 Simone Carletti Double quotes
authored
5
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
6
be24e73 Simone Carletti Base GEM skeleton.
authored
7 # Common package properties
52e0b51 Simone Carletti SHAPSHOT feature is no longer required
authored
8 PKG_NAME = Whois::GEM
9 PKG_VERSION = Whois::VERSION
add6330 Simone Carletti Double quotes
authored
10
11
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
12 # Run test by default.
247a885 Simone Carletti Rename :rspec task to :spec.
authored
13 task :default => :spec
14 task :test => :spec
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
15
16 spec = Gem::Specification.new do |s|
17 s.name = PKG_NAME
18 s.version = PKG_VERSION
19 s.summary = "An intelligent pure Ruby WHOIS client and parser."
c0ff6ec Simone Carletti Simplify Rakefile
authored
20 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
21
22 s.required_ruby_version = ">= 1.8.7"
23
70e4604 Simone Carletti Standardize
authored
24 s.authors = ["Simone Carletti"]
25 s.email = ["weppos@weppos.net"]
afd063a Simone Carletti Minimum Ruby version is now 1.8.7
authored
26 s.homepage = "http://www.ruby-whois.org"
c0ff6ec Simone Carletti Simplify Rakefile
authored
27 s.rubyforge_project = "whois"
be24e73 Simone Carletti Base GEM skeleton.
authored
28
1590606 Simone Carletti Packaged gem is missing .md files
authored
29 s.files = %w( Rakefile LICENSE .gemtest .yardopts ) +
30 Dir.glob("*.{md,gemspec}") +
404a8fd Simone Carletti GoodBye Test::Unit, and thanks for all the fish!
authored
31 Dir.glob("{bin,lib,spec}/**/*")
eb5bd31 Simone Carletti Code cleanups
authored
32 s.executables = %w( ruby-whois )
33 s.require_paths = %w( lib )
be24e73 Simone Carletti Base GEM skeleton.
authored
34
8fcab72 Simone Carletti Fixed error "rake is not part of the bundle. Add it to Gemfile."
authored
35 s.add_development_dependency "rake", "~> 0.9"
1d5f3da Simone Carletti Upgrade to rspec 2.10.x
authored
36 s.add_development_dependency "rspec", "~> 2.10.0"
8fcab72 Simone Carletti Fixed error "rake is not part of the bundle. Add it to Gemfile."
authored
37 s.add_development_dependency "mocha"
38 s.add_development_dependency "yard"
e58b1a8 Simone Carletti Add post-install message
authored
39
40 s.post_install_message = <<EOS
41 ********************************************************************************
42
43 Thank you for installing the whois gem!
44
45 If you like this gem, please support the project.
46 http://pledgie.com/campaigns/11383
47
48 Does your project or organization use this gem? Add it to the apps wiki.
49 https://github.com/weppos/whois/wiki/apps
50
51 Are you looking for a quick and convenient way to perform WHOIS queries?
52 Check out RoboWhois WHOIS API.
53 http://www.robowhois.com/
54
55 ********************************************************************************
56 EOS
be24e73 Simone Carletti Base GEM skeleton.
authored
57 end
58
1785e41 Simone Carletti Move require statements near to the corresponding usage
authored
59
60 require 'rubygems/package_task'
61
9294603 Simone Carletti rake/gempackagetask is deprecated. Use rubygems/package_task instead.
authored
62 Gem::PackageTask.new(spec) do |pkg|
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
63 pkg.gem_spec = spec
64 end
be24e73 Simone Carletti Base GEM skeleton.
authored
65
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
66 desc "Build the gemspec file #{spec.name}.gemspec"
67 task :gemspec do
68 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
69 File.open(file, "w") {|f| f << spec.to_ruby }
70 end
71
52e0b51 Simone Carletti SHAPSHOT feature is no longer required
authored
72 desc "Remove any temporary products, including gemspec"
73 task :clean => [:clobber] do
74 rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")
75 end
76
77 desc "Remove any generated file"
78 task :clobber => [:clobber_package]
79
80 desc "Package the library and generates the gemspec"
81 task :package => [:gemspec]
82
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
83
1785e41 Simone Carletti Move require statements near to the corresponding usage
authored
84 require 'rspec/core/rake_task'
67bf22e Simone Carletti Don't force Fuubar as dependency.
authored
85 begin
86 require 'fuubar'
87 rescue LoadError
88 end
1785e41 Simone Carletti Move require statements near to the corresponding usage
authored
89
0fec60c Simone Carletti Don't run rake task in verbose mode by default
authored
90 RSpec::Core::RakeTask.new do |t|
91 t.verbose = !!ENV["VERBOSE"]
67bf22e Simone Carletti Don't force Fuubar as dependency.
authored
92 t.rspec_opts = []
93 t.rspec_opts << ['--format', 'Fuubar'] if defined?(Fuubar)
0fec60c Simone Carletti Don't run rake task in verbose mode by default
authored
94 end
d3842b6 Simone Carletti Install RSpec 2
authored
95
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
96
6c55e45 Simone Carletti Update Ruby versions
authored
97 namespace :multitest do
5f7a124 Simone Carletti Update rubies
authored
98 RUBIES = %w( ruby-1.8.7 ruby-1.9.2 jruby ree )
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
99
149f79c Simone Carletti Cleanup rake test tasks
authored
100 desc "Run tests for all rubies"
6c55e45 Simone Carletti Update Ruby versions
authored
101 task :all => :ensure_rvm do
404a8fd Simone Carletti GoodBye Test::Unit, and thanks for all the fish!
authored
102 sh "rvm #{RUBIES.join(",")} rake test"
149f79c Simone Carletti Cleanup rake test tasks
authored
103 end
104
105 task :ensure_rvm do
106 File.exist?(File.expand_path("~/.rvm/scripts/rvm")) || abort("RVM is not available")
107 end
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
108
6c55e45 Simone Carletti Update Ruby versions
authored
109 RUBIES.each do |ruby|
110 desc "Run tests against Ruby #{ruby}"
111 task ruby => "test:ensure_rvm" do
404a8fd Simone Carletti GoodBye Test::Unit, and thanks for all the fish!
authored
112 sh "rvm #{ruby} rake test"
6c55e45 Simone Carletti Update Ruby versions
authored
113 end
114 end
115
39d7208 Simone Carletti rake multitest:setup/bundleize
authored
116 task :bundleize do
94d1af9 Simone Carletti rake multitest:setup
authored
117 sh "rvm #{RUBIES.join(",")} gem install bundler"
39d7208 Simone Carletti rake multitest:setup/bundleize
authored
118 end
119
120 task :setup do
121 sh "rvm #{RUBIES.join(",")} exec bundle install"
d9ad2e0 Simone Carletti Add cross-ruby test tasks
authored
122 end
123 end
124
125
1785e41 Simone Carletti Move require statements near to the corresponding usage
authored
126 require 'yard'
127 require 'yard/rake/yardoc_task'
128
c0ff6ec Simone Carletti Simplify Rakefile
authored
129 YARD::Rake::YardocTask.new(:yardoc) do |y|
130 y.options = ["--output-dir", "yardoc"]
131 end
4c633ca Simone Carletti Replace RDoc with YARD
authored
132
c0ff6ec Simone Carletti Simplify Rakefile
authored
133 namespace :yardoc do
134 task :clobber do
135 rm_r "yardoc" rescue nil
4c633ca Simone Carletti Replace RDoc with YARD
authored
136 end
137 end
138
c0ff6ec Simone Carletti Simplify Rakefile
authored
139 task :clobber => "yardoc:clobber"
54b1d16 Simone Carletti Added Rake :console task.
authored
140
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
141
c018532 Simone Carletti Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
142 desc "Open an irb session preloaded with this library"
143 task :console do
144 sh "irb -rubygems -I lib -r whois.rb"
145 end
146
1f4d414 Simone Carletti Change :publish_docs task to deploy on my server instead of RubyGems.
authored
147
afb4065 Simone Carletti Super simple and super buggy initial version. It works, but sometimes it...
authored
148 Dir["tasks/**/*.rake"].each do |file|
149 load(file)
150 end
Something went wrong with that request. Please try again.