Permalink
Browse files

Remove dependency from Jeweler and make the library compatible with B…

…undler.
  • Loading branch information...
1 parent 967d3cc commit aef30bcf83861b08ee9e0ffd2424c1149e630a4b @weppos weppos committed Jun 21, 2011
Showing with 109 additions and 57 deletions.
  1. +4 −0 CHANGELOG.rdoc
  2. +4 −0 Gemfile
  3. +14 −0 Gemfile.lock
  4. +60 −57 Rakefile
  5. +27 −0 net-dns.gemspec
View
@@ -7,6 +7,10 @@
* CHANGED: Rewritten and simplified Net::DNS::Classes. Improved test harness.
+* CHANGED: Removed Jeweler development dependency.
+
+* CHANGED: The library is now compatible with Bundler.
+
== Release 0.6.1
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in whois.gemspec
+gemspec
View
@@ -0,0 +1,14 @@
+PATH
+ remote: .
+ specs:
+ net-dns (0.6.1)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ net-dns!
View
117 Rakefile
@@ -1,74 +1,77 @@
require 'rubygems'
-require 'rake'
-require 'rake/clean'
+require 'rubygems/package_task'
+require 'bundler'
+require 'rake/testtask'
+require 'yard'
+require 'yard/rake/yardoc_task'
+
+$:.unshift(File.dirname(__FILE__) + '/lib')
require 'net/dns'
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gemspec|
- gemspec.name = "net-dns"
- gemspec.summary = "Pure Ruby DNS library"
- gemspec.description = "Net::DNS is a pure Ruby DNS library, with a clean OO interface and an extensible API"
- gemspec.authors = ["Marco Ceresa", "Simone Carletti"]
- gemspec.email = ["ceresa@gmail.com", "weppos@weppos.net"]
- gemspec.homepage = "http://github.com/bluemonk/net-dns"
- gemspec.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "AUTHORS.rdoc", "THANKS.rdoc"]
- gemspec.rubyforge_project = "net-dns"
-
- gemspec.add_development_dependency "rake"
- gemspec.add_development_dependency "jeweler", "~> 1.4.0"
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler not available."
+
+# Common package properties
+PKG_NAME = ENV['PKG_NAME'] || 'net-dns'
+PKG_VERSION = ENV['PKG_VERSION'] || Net::DNS::VERSION
+
+if ENV['SNAPSHOT'].to_i == 1
+ PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
end
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = true
+
+# Run test by default.
+task :default => :test
+
+# This builds the actual gem. For details of what all these options
+# mean, and other ones you can add, check the documentation here:
+#
+# http://rubygems.org/read/chapter/20
+#
+spec = Gem::Specification.new do |s|
+ s.name = PKG_NAME
+ s.version = PKG_VERSION
+ s.summary = "Pure Ruby DNS library."
+ s.description = "Net::DNS is a pure Ruby DNS library, with a clean OO interface and an extensible API."
+
+ s.authors = ["Marco Ceresa", "Simone Carletti"]
+ s.email = ["ceresa@gmail.com", "weppos@weppos.net"]
+ s.homepage = "http://github.com/bluemonk/net-dns"
+ s.rubyforge_project = "net-dns"
+
+ s.files = %w( Rakefile ) +
+ Dir.glob("*.{rdoc,gemspec}") +
+ Dir.glob("{demo,lib,test}/**/*")
+ s.require_paths = ["lib"]
+
+ # If you want to depend on other gems, add them here, along with any
+ # relevant versions
+ # s.add_dependency("some_other_gem", "~> 0.1.0")
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new(:rcov) do |test|
- test.libs << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov => :check_dependencies
+# This task actually builds the gem.
+# We also regenerate a static .gemspec file.
+Gem::PackageTask.new(spec) do |pkg|
+ pkg.gem_spec = spec
+end
+
+desc "Build the gemspec file #{spec.name}.gemspec"
+task :gemspec do
+ file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
+ File.open(file, "w") {|f| f << spec.to_ruby }
end
-task :default => :test
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "net-dns #{Net::DNS::VERSION}"
- rdoc.rdoc_files.include('*.rdoc')
- rdoc.rdoc_files.include('lib/**/*.rb')
+# Run all the tests in the /test folder
+Rake::TestTask.new do |t|
+ t.libs << "test"
+ t.test_files = FileList["test/**/*_test.rb"]
+ t.verbose = true
end
-desc "Look for TODO and FIXME tags in the code"
-task :todo do
- def egrep(pattern)
- Dir['**/*.rb'].each do |fn|
- count = 0
- open(fn) do |f|
- while line = f.gets
- count += 1
- if line =~ pattern
- puts "#{fn}:#{count}:#{line}"
- end
- end
- end
- end
- end
- egrep /(FIXME|TODO|TBD)/
+YARD::Rake::YardocTask.new(:yardoc) do |y|
+ y.options = ["--output-dir", "yardoc"]
end
+
desc "Open an irb session preloaded with this library"
task :console do
sh "irb -rubygems -I lib -r net/dns.rb"
View
@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{net-dns}
+ s.version = "0.6.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = [%q{Marco Ceresa}, %q{Simone Carletti}]
+ s.date = %q{2011-06-21}
+ s.description = %q{Net::DNS is a pure Ruby DNS library, with a clean OO interface and an extensible API.}
+ s.email = [%q{ceresa@gmail.com}, %q{weppos@weppos.net}]
+ s.files = [%q{Rakefile}, %q{AUTHORS.rdoc}, %q{CHANGELOG.rdoc}, %q{README.rdoc}, %q{THANKS.rdoc}, %q{net-dns.gemspec}, %q{demo/check_soa.rb}, %q{demo/threads.rb}, %q{lib/net}, %q{lib/net/dns}, %q{lib/net/dns/core_ext.rb}, %q{lib/net/dns/header.rb}, %q{lib/net/dns/names.rb}, %q{lib/net/dns/packet.rb}, %q{lib/net/dns/question.rb}, %q{lib/net/dns/resolver}, %q{lib/net/dns/resolver/socks.rb}, %q{lib/net/dns/resolver/timeouts.rb}, %q{lib/net/dns/resolver.rb}, %q{lib/net/dns/rr}, %q{lib/net/dns/rr/a.rb}, %q{lib/net/dns/rr/aaaa.rb}, %q{lib/net/dns/rr/classes.rb}, %q{lib/net/dns/rr/cname.rb}, %q{lib/net/dns/rr/hinfo.rb}, %q{lib/net/dns/rr/mr.rb}, %q{lib/net/dns/rr/mx.rb}, %q{lib/net/dns/rr/ns.rb}, %q{lib/net/dns/rr/null.rb}, %q{lib/net/dns/rr/ptr.rb}, %q{lib/net/dns/rr/soa.rb}, %q{lib/net/dns/rr/srv.rb}, %q{lib/net/dns/rr/txt.rb}, %q{lib/net/dns/rr/types.rb}, %q{lib/net/dns/rr.rb}, %q{lib/net/dns/version.rb}, %q{lib/net/dns.rb}, %q{test/header_test.rb}, %q{test/packet_test.rb}, %q{test/question_test.rb}, %q{test/resolver}, %q{test/resolver/timeouts_test.rb}, %q{test/resolver_test.rb}, %q{test/rr}, %q{test/rr/a_test.rb}, %q{test/rr/aaaa_test.rb}, %q{test/rr/classes_test.rb}, %q{test/rr/cname_test.rb}, %q{test/rr/hinfo_test.rb}, %q{test/rr/mr_test.rb}, %q{test/rr/mx_test.rb}, %q{test/rr/ns_test.rb}, %q{test/rr/types_test.rb}, %q{test/rr_test.rb}, %q{test/test_helper.rb}]
+ s.homepage = %q{http://github.com/bluemonk/net-dns}
+ s.require_paths = [%q{lib}]
+ s.rubyforge_project = %q{net-dns}
+ s.rubygems_version = %q{1.8.3}
+ s.summary = %q{Pure Ruby DNS library.}
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end

0 comments on commit aef30bc

Please sign in to comment.