PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Rakefile

https://gitlab.com/intruxxer/ipaddress
Rakefile | 83 lines | 82 code | 1 blank | 0 comment | 0 complexity | e18c0d51ca9c10167ae42618de415292 MD5 | raw file
  1. require 'rubygems'
  2. require 'rake'
  3. require 'rake/clean'
  4. begin
  5. require 'jeweler'
  6. Jeweler::Tasks.new do |gem|
  7. gem.name = "ipaddress"
  8. gem.summary = %Q{IPv4/IPv6 addresses manipulation library}
  9. gem.email = "ceresa@gmail.com"
  10. gem.homepage = "http://github.com/bluemonk/ipaddress"
  11. gem.authors = ["Marco Ceresa"]
  12. gem.description = <<-EOD
  13. IPAddress is a Ruby library designed to make manipulation
  14. of IPv4 and IPv6 addresses both powerful and simple. It mantains
  15. a layer of compatibility with Ruby's own IPAddr, while
  16. addressing many of its issues.
  17. EOD
  18. end
  19. rescue LoadError
  20. puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
  21. end
  22. require 'rake/testtask'
  23. Rake::TestTask.new(:test) do |test|
  24. test.libs << 'lib' << 'test'
  25. test.pattern = 'test/**/*_test.rb'
  26. test.verbose = true
  27. end
  28. begin
  29. require 'rcov/rcovtask'
  30. Rcov::RcovTask.new do |test|
  31. test.libs << 'test'
  32. test.pattern = 'test/**/*_test.rb'
  33. test.verbose = true
  34. end
  35. rescue LoadError
  36. task :rcov do
  37. abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
  38. end
  39. end
  40. task :default => :test
  41. require 'rdoc/task'
  42. Rake::RDocTask.new do |rdoc|
  43. if File.exist?('VERSION.yml')
  44. config = YAML.load(File.read('VERSION.yml'))
  45. version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
  46. else
  47. version = ""
  48. end
  49. rdoc.rdoc_dir = 'rdoc'
  50. rdoc.title = "ipaddress #{version}"
  51. rdoc.rdoc_files.include('README*')
  52. rdoc.rdoc_files.include('lib/**/*.rb')
  53. end
  54. desc "Open an irb session preloaded with this library"
  55. task :console do
  56. sh "irb -rubygems -I lib -r ipaddress.rb"
  57. end
  58. desc "Look for TODO and FIXME tags in the code"
  59. task :todo do
  60. def egrep(pattern)
  61. Dir['**/*.rb'].each do |fn|
  62. count = 0
  63. open(fn) do |f|
  64. while line = f.gets
  65. count += 1
  66. if line =~ pattern
  67. puts "#{fn}:#{count}:#{line}"
  68. end
  69. end
  70. end
  71. end
  72. end
  73. egrep /(FIXME|TODO|TBD)/
  74. end