Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 146 lines (118 sloc) 4.022 kb
add6330 @weppos Double quotes
authored
1 require "rubygems"
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
2 require "rake/testtask"
3 require "rake/gempackagetask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Parser...
authored
4 begin
add6330 @weppos Double quotes
authored
5 require "hanna/rdoctask"
7143eb1 @weppos Changed Parsers to use a normalized content version called Whois::Parser...
authored
6 rescue LoadError
add6330 @weppos Double quotes
authored
7 require "rake/rdoctask"
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
8 end
9
add6330 @weppos Double quotes
authored
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
13
be24e73 @weppos Base GEM skeleton.
authored
14 # Common package properties
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
15 PKG_NAME = ENV['PKG_NAME'] || Whois::GEM
16 PKG_VERSION = ENV['PKG_VERSION'] || Whois::VERSION
add6330 @weppos Double quotes
authored
17 RUBYFORGE_PROJECT = "whois"
be24e73 @weppos Base GEM skeleton.
authored
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
22
23
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
24 # Run all the tests in the /test folder
25 Rake::TestTask.new do |t|
26 t.libs << "test"
27 t.test_files = FileList["test/**/*_test.rb"]
28 t.verbose = true
29 end
30
31 # Generate documentation
32 Rake::RDocTask.new do |rd|
33 rd.main = "README.rdoc"
34 rd.rdoc_files.include("*.rdoc", "lib/**/*.rb")
35 rd.rdoc_dir = "rdoc"
36 end
37
38 # Run test by default.
39 task :default => ["test"]
40
41
42 # This builds the actual gem. For details of what all these options
43 # mean, and other ones you can add, check the documentation here:
44 #
45 # http://rubygems.org/read/chapter/20
46 #
47 spec = Gem::Specification.new do |s|
48
49 s.name = PKG_NAME
50 s.version = PKG_VERSION
51 s.summary = "An intelligent pure Ruby WHOIS client and parser."
52 s.author = "Simone Carletti"
53 s.email = "weppos@weppos.net"
54 s.homepage = "http://www.ruby-whois.org"
55 s.description = <<-EOD
578b5fc @weppos No longer a simple client! :)
authored
56 Whois is an intelligent WHOIS client and parser written in pure Ruby. \
50efc7e @weppos Updated project page
authored
57 It can query registry data for IPv4, IPv6 and top level domains, \
578b5fc @weppos No longer a simple client! :)
authored
58 parse and convert responses into easy-to-use Ruby objects.
c98aec4 @weppos Release Whois 0.5.0
authored
59 EOD
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
60 s.rubyforge_project = RUBYFORGE_PROJECT
be24e73 @weppos Base GEM skeleton.
authored
61
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
62 s.has_rdoc = true
63 # You should probably have a README of some kind. Change the filename
64 # as appropriate
65 s.extra_rdoc_files = Dir.glob("*.rdoc")
66 s.rdoc_options = %w(--main README.rdoc)
be24e73 @weppos Base GEM skeleton.
authored
67
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
68 # 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 of t...
authored
69 s.files = %w() + Dir.glob("*.{rdoc,gemspec}") + Dir.glob("{bin,lib}/**/*")
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
70 s.require_paths = ["lib"]
be24e73 @weppos Base GEM skeleton.
authored
71
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
72 # If you want to depend on other gems, add them here, along with any
73 # relevant versions
74 # s.add_dependency("some_other_gem", "~> 0.1.0")
75
76 # If your tests use any gems, include them here
77 s.add_development_dependency("mocha")
be24e73 @weppos Base GEM skeleton.
authored
78 end
79
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
80 # This task actually builds the gem. We also regenerate a static
81 # .gemspec file, which is useful if something (i.e. GitHub) will
82 # be automatically building a gem for this project. If you're not
83 # using GitHub, edit as appropriate.
84 Rake::GemPackageTask.new(spec) do |pkg|
85 pkg.gem_spec = spec
86 end
be24e73 @weppos Base GEM skeleton.
authored
87
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
88 desc "Build the gemspec file #{spec.name}.gemspec"
89 task :gemspec do
90 file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
91 File.open(file, "w") {|f| f << spec.to_ruby }
92 end
93
94 desc "Remove any temporary products, including gemspec"
95 task :clean => [:clobber] do
96 rm "#{spec.name}.gemspec" if File.file?("#{spec.name}.gemspec")
97 end
98
99 desc "Remove any generated file"
100 task :clobber => [:clobber_rdoc, :clobber_rcov, :clobber_package]
101
102 desc "Package the library and generates the gemspec"
103 task :package => [:gemspec]
104
105 begin
106 require "rcov/rcovtask"
107
108 desc "Create a code coverage report"
109 Rcov::RcovTask.new do |t|
110 t.test_files = FileList["test/**/*_test.rb"]
111 t.ruby_opts << "-Itest -x mocha,rcov,Rakefile"
112 t.verbose = true
113 end
114 rescue LoadError
115 task :clobber_rcov
116 puts "RCov is not available"
54b1d16 @weppos Added Rake :console task.
authored
117 end
118
be24e73 @weppos Base GEM skeleton.
authored
119 begin
add6330 @weppos Double quotes
authored
120 require "code_statistics"
be24e73 @weppos Base GEM skeleton.
authored
121 desc "Show library's code statistics"
122 task :stats do
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
123 CodeStatistics.new(["Public Suffix Service", "lib"],
be24e73 @weppos Base GEM skeleton.
authored
124 ["Tests", "test"]).to_s
125 end
126 rescue LoadError
127 puts "CodeStatistics (Rails) is not available"
128 end
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes it...
authored
129
3337771 @weppos Namespace publish_rdoc task and rename it to rdoc:publish
authored
130 namespace :rdoc do
131 desc "Publish RDoc documentation to the site"
132 task :publish => [:clobber_rdoc, :rdoc] do
133 sh "rsync -avz --delete rdoc/ weppos@dads:/home/weppos/ruby-whois.org/api"
134 end
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
135 end
136
c018532 @weppos Drop dependency from Echoe and rewrite the Rakefile from scratch.
authored
137 desc "Open an irb session preloaded with this library"
138 task :console do
139 sh "irb -rubygems -I lib -r whois.rb"
140 end
141
1f4d414 @weppos Change :publish_docs task to deploy on my server instead of RubyGems.
authored
142
afb4065 @weppos Super simple and super buggy initial version. It works, but sometimes it...
authored
143 Dir["tasks/**/*.rake"].each do |file|
144 load(file)
145 end
Something went wrong with that request. Please try again.