Skip to content
Newer
Older
100644 175 lines (135 sloc) 4.51 KB
add6330 @weppos Double quotes
authored Apr 12, 2010
1 require "rubygems"
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
2 require "rake/testtask"
d3842b6 @weppos Install RSpec 2
authored Sep 22, 2010
3 require "rspec/core/rake_task"
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
4 require "rake/gempackagetask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Par…
authored Feb 10, 2010
5 begin
add6330 @weppos Double quotes
authored Apr 12, 2010
6 require "hanna/rdoctask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Par…
authored Feb 10, 2010
7 rescue LoadError
add6330 @weppos Double quotes
authored Apr 12, 2010
8 require "rake/rdoctask"
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
9 end
10
add6330 @weppos Double quotes
authored Apr 12, 2010
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 Jun 16, 2010
14
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
15 # Common package properties
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
16 PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
17 PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
add6330 @weppos Double quotes
authored Apr 12, 2010
18 RUBYFORGE_PROJECT = "whois"
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
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 Apr 12, 2010
23
24
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
25 # Run test by default.
d3842b6 @weppos Install RSpec 2
authored Sep 22, 2010
26 task :default => [:rspec, :test]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
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 Sep 28, 2009
38 Whois is an intelligent WHOIS client and parser written in pure Ruby. \
50efc7e @weppos Updated project page
authored Feb 3, 2010
39 It can query registry data for IPv4, IPv6 and top level domains, \
578b5fc @weppos No longer a simple client! :)
authored Sep 28, 2009
40 parse and convert responses into easy-to-use Ruby objects.
c98aec4 @weppos Release Whois 0.5.0
authored Aug 9, 2009
41 EOD
afd063a @weppos Minimum Ruby version is now 1.8.7
authored Oct 21, 2010
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 Aug 12, 2010
48 s.rubyforge_project = RUBYFORGE_PROJECT
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
49
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
50 s.has_rdoc = true
51 s.extra_rdoc_files = Dir.glob("*.rdoc")
4c633ca @weppos Replace RDoc with YARD
authored Dec 20, 2010
52 s.rdoc_options = %w( --main README.rdoc )
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
53
afd063a @weppos Minimum Ruby version is now 1.8.7
authored Oct 21, 2010
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 Sep 10, 2010
55 s.executables = ["ruby-whois"]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
56 s.require_paths = ["lib"]
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
57
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
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 Dec 13, 2010
63 s.add_development_dependency("rspec", "~> 2.3.0")
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
64 s.add_development_dependency("mocha")
803568b @weppos Add YARD development dependency.
authored Dec 20, 2010
65 s.add_development_dependency("yard")
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
66 end
67
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
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 Jun 29, 2009
75
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
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 Aug 19, 2010
82
d3842b6 @weppos Install RSpec 2
authored Sep 22, 2010
83 # Run all the specs in the /spec folder
84 RSpec::Core::RakeTask.new(:rspec)
85
d9ad2e0 @weppos Add cross-ruby test tasks
authored Aug 19, 2010
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
93 task "ensure_rvm" do
94 raise "RVM is not available" unless File.exist?(File.expand_path("~/.rvm/scripts/rvm"))
95 end
96
afd063a @weppos Minimum Ruby version is now 1.8.7
authored Oct 21, 2010
97 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 Aug 19, 2010
98
99 desc "Run tests for all rubies"
100 task "test_rubies" => "ensure_rvm" do
d3842b6 @weppos Install RSpec 2
authored Sep 22, 2010
101 sh "rvm #{RUBIES.join(",")} rake default"
d9ad2e0 @weppos Add cross-ruby test tasks
authored Aug 19, 2010
102 end
103
104 RUBIES.each do |ruby|
105 desc "Run tests on Ruby #{ruby}"
106 task "test_ruby_#{ruby}"=> "ensure_rvm" do
d3842b6 @weppos Install RSpec 2
authored Sep 22, 2010
107 sh "rvm #{ruby} rake default"
d9ad2e0 @weppos Add cross-ruby test tasks
authored Aug 19, 2010
108 end
109 end
110
111
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
112 desc "Remove any temporary products, including gemspec"
113 task :clean => [:clobber] do
114 rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")
115 end
116
117 desc "Remove any generated file"
4c633ca @weppos Replace RDoc with YARD
authored Dec 20, 2010
118 task :clobber => [:clobber_rcov, :clobber_package]
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
119
120 desc "Package the library and generates the gemspec"
121 task :package => [:gemspec]
122
4c633ca @weppos Replace RDoc with YARD
authored Dec 20, 2010
123
124 begin
125 require "yard"
126 require "yard/rake/yardoc_task"
127
128 YARD::Rake::YardocTask.new(:yardoc) do |y|
129 y.options = ["--output-dir", "yardoc"]
130 end
131
132 namespace :yardoc do
133 desc "Publish YARD documentation to the site"
134 task :publish => ["yardoc:clobber", "yardoc"] do
135 ENV["username"] || raise(ArgumentError, "Missing ssh username")
136 sh "rsync -avz --delete yardoc/ #{ENV["username"]}@alamak:/home/#{ENV["username"]}/ruby-whois.org/api"
137 end
138
139 desc "Remove YARD products"
140 task :clobber do
141 rm_r "yardoc" rescue nil
142 end
143 end
144
145 task :clobber => "yardoc:clobber"
146 rescue LoadError
147 puts "YARD is not available"
148 end
149
150
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
151 begin
152 require "rcov/rcovtask"
153
154 desc "Create a code coverage report"
155 Rcov::RcovTask.new do |t|
156 t.test_files = FileList["test/**/*_test.rb"]
157 t.ruby_opts << "-Itest -x mocha,rcov,Rakefile"
158 t.verbose = true
159 end
160 rescue LoadError
161 task :clobber_rcov
b35722d @weppos Simply ignore optional libraries
authored Aug 19, 2010
162 # puts "RCov is not available"
54b1d16 @weppos Added Rake :console task.
authored Jun 29, 2009
163 end
164
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
165
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
166 desc "Open an irb session preloaded with this library"
167 task :console do
168 sh "irb -rubygems -I lib -r whois.rb"
169 end
170
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
171
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes…
authored Jul 1, 2009
172 Dir["tasks/**/*.rake"].each do |file|
173 load(file)
174 end
Something went wrong with that request. Please try again.