Skip to content
Newer
Older
100644 166 lines (133 sloc) 4.42 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"
3 require "rake/gempackagetask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Par…
authored Feb 10, 2010
4 begin
add6330 @weppos Double quotes
authored Apr 12, 2010
5 require "hanna/rdoctask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Par…
authored Feb 10, 2010
6 rescue LoadError
add6330 @weppos Double quotes
authored Apr 12, 2010
7 require "rake/rdoctask"
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
8 end
9
add6330 @weppos Double quotes
authored Apr 12, 2010
10 $:.unshift(File.dirname(__FILE__) + "/lib")
11 require "whois"
12
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
13
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
14 # Common package properties
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
15 PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
16 PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
add6330 @weppos Double quotes
authored Apr 12, 2010
17 RUBYFORGE_PROJECT = "whois"
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
18
19 if ENV['SNAPSHOT'].to_i == 1
20 PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
21 end
add6330 @weppos Double quotes
authored Apr 12, 2010
22
23
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
24 # Run test by default.
25 task :default => ["test"]
26
27 # This builds the actual gem. For details of what all these options
28 # mean, and other ones you can add, check the documentation here:
29 #
30 # http://rubygems.org/read/chapter/20
31 #
32 spec = Gem::Specification.new do |s|
33
34 s.name = PKG_NAME
35 s.version = PKG_VERSION
36 s.summary = "An intelligent pure Ruby WHOIS client and parser."
37 s.author = "Simone Carletti"
38 s.email = "weppos@weppos.net"
39 s.homepage = "http://www.ruby-whois.org"
40 s.description = <<-EOD
578b5fc @weppos No longer a simple client! :)
authored Sep 28, 2009
41 Whois is an intelligent WHOIS client and parser written in pure Ruby. \
50efc7e @weppos Updated project page
authored Feb 3, 2010
42 It can query registry data for IPv4, IPv6 and top level domains, \
578b5fc @weppos No longer a simple client! :)
authored Sep 28, 2009
43 parse and convert responses into easy-to-use Ruby objects.
c98aec4 @weppos Release Whois 0.5.0
authored Aug 9, 2009
44 EOD
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
45 s.rubyforge_project = RUBYFORGE_PROJECT
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
46
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
47 s.has_rdoc = true
48 # You should probably have a README of some kind. Change the filename
49 # as appropriate
50 s.extra_rdoc_files = Dir.glob("*.rdoc")
51 s.rdoc_options = %w(--main README.rdoc)
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
52
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
53 # Add any extra files to include in the gem (like your README)
e491910 @weppos Excluded test folder from the packaged .gem file to reduce the size o…
authored Aug 12, 2010
54 s.files = %w() + 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
63 s.add_development_dependency("mocha")
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
64 end
65
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
66 # This task actually builds the gem. We also regenerate a static
67 # .gemspec file, which is useful if something (i.e. GitHub) will
68 # be automatically building a gem for this project. If you're not
69 # using GitHub, edit as appropriate.
70 Rake::GemPackageTask.new(spec) do |pkg|
71 pkg.gem_spec = spec
72 end
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
73
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
74 desc "Build the gemspec file #{spec.name}.gemspec"
75 task :gemspec do
76 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
77 File.open(file, "w") {|f| f << spec.to_ruby }
78 end
79
d9ad2e0 @weppos Add cross-ruby test tasks
authored Aug 19, 2010
80
81 # Generate documentation
82 Rake::RDocTask.new do |rd|
83 rd.main = "README.rdoc"
84 rd.rdoc_files.include("*.rdoc", "lib/**/*.rb")
85 rd.rdoc_dir = "rdoc"
86 end
87
88 # Run all the tests in the /test folder
89 Rake::TestTask.new do |t|
90 t.libs << "test"
91 t.test_files = FileList["test/**/*_test.rb"]
92 t.verbose = true
93 end
94
95 task "ensure_rvm" do
96 raise "RVM is not available" unless File.exist?(File.expand_path("~/.rvm/scripts/rvm"))
97 end
98
187c84f @weppos Update rubies to Ruby 1.9.2 stable and jRuby 1.5.2
authored Aug 24, 2010
99 RUBIES = %w(1.8.6-p399 1.8.7-p249 1.9.1-p378 1.9.2-p0 rbx-1.0.1-20100603 jruby-1.5.2 ree-1.8.7-2010.02)
d9ad2e0 @weppos Add cross-ruby test tasks
authored Aug 19, 2010
100
101 desc "Run tests for all rubies"
102 task "test_rubies" => "ensure_rvm" do
103 sh "rvm #{RUBIES.join(",")} rake test"
104 end
105
106 RUBIES.each do |ruby|
107 desc "Run tests on Ruby #{ruby}"
108 task "test_ruby_#{ruby}"=> "ensure_rvm" do
109 sh "rvm #{ruby} rake test"
110 end
111 end
112
113
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
114 desc "Remove any temporary products, including gemspec"
115 task :clean => [:clobber] do
116 rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")
117 end
118
119 desc "Remove any generated file"
120 task :clobber => [:clobber_rdoc, :clobber_rcov, :clobber_package]
121
122 desc "Package the library and generates the gemspec"
123 task :package => [:gemspec]
124
125 begin
126 require "rcov/rcovtask"
127
128 desc "Create a code coverage report"
129 Rcov::RcovTask.new do |t|
130 t.test_files = FileList["test/**/*_test.rb"]
131 t.ruby_opts << "-Itest -x mocha,rcov,Rakefile"
132 t.verbose = true
133 end
134 rescue LoadError
135 task :clobber_rcov
b35722d @weppos Simply ignore optional libraries
authored Aug 19, 2010
136 # puts "RCov is not available"
54b1d16 @weppos Added Rake :console task.
authored Jun 29, 2009
137 end
138
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
139 begin
add6330 @weppos Double quotes
authored Apr 12, 2010
140 require "code_statistics"
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
141 desc "Show library's code statistics"
142 task :stats do
59dc638 @weppos Hello, I am Whois
authored Aug 23, 2010
143 CodeStatistics.new(["Whois", "lib"],
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
144 ["Tests", "test"]).to_s
145 end
146 rescue LoadError
b35722d @weppos Simply ignore optional libraries
authored Aug 19, 2010
147 # puts "CodeStatistics (Rails) is not available"
be24e73 @weppos Base GEM skeleton.
authored Jun 29, 2009
148 end
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes…
authored Jul 1, 2009
149
3337771 @weppos Namespace publish_rdoc task and rename it to rdoc:publish
authored Aug 19, 2010
150 namespace :rdoc do
151 desc "Publish RDoc documentation to the site"
152 task :publish => [:clobber_rdoc, :rdoc] do
153 sh "rsync -avz --delete rdoc/ weppos@dads:/home/weppos/ruby-whois.org/api"
154 end
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
155 end
156
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored Aug 12, 2010
157 desc "Open an irb session preloaded with this library"
158 task :console do
159 sh "irb -rubygems -I lib -r whois.rb"
160 end
161
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored Jun 16, 2010
162
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes…
authored Jun 30, 2009
163 Dir["tasks/**/*.rake"].each do |file|
164 load(file)
165 end
Something went wrong with that request. Please try again.