Skip to content

Commit

Permalink
Refactor gemspec and Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Nov 12, 2009
1 parent 2af4507 commit 823a13c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 78 deletions.
57 changes: 30 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
require 'rake/rdoctask'
begin
require 'yard'
rescue LoadError, RuntimeError
end

desc "Generate rdoc documentation."
Rake::RDocTask.new(:rdoc => 'rdoc', :clobber_rdoc => 'rdoc:clean', :rerdoc => 'rdoc:force') { |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.title = "Watchr"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.options << '--charset' << 'utf-8'
rdoc.main = 'README.rdoc'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('TODO.txt')
rdoc.rdoc_files.include('LICENSE')
rdoc.rdoc_files.include('lib/**/*.rb')
}

if defined? YARD
YARD::Rake::YardocTask.new do |t|
t.files = %w( lib/**/*.rb )
t.options = %w( -o doc/yard --readme README.rdoc --files LICENSE,TODO.txt )
end
end
# --------------------------------------------------
# Tests
# --------------------------------------------------
task(:default => "test:all")

namespace(:test) do

Expand All @@ -34,7 +13,7 @@ namespace(:test) do
system cmd
end

desc "Run all tests on multiple ruby versions (requires rvm with 1.8.6 and 1.8.7)"
desc "Run all tests on multiple ruby versions (requires rvm)"
task(:portability) do
versions = %w( 1.8.6 1.8.7 )
versions.each do |version|
Expand All @@ -48,4 +27,28 @@ namespace(:test) do
end
end

task :default => "test:all"
# --------------------------------------------------
# Docs
# --------------------------------------------------
require 'rake/rdoctask'
desc "Generate rdoc documentation."
Rake::RDocTask.new(:rdoc => 'rdoc', :clobber_rdoc => 'rdoc:clean', :rerdoc => 'rdoc:force') do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.title = "Watchr"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.options << '--charset' << 'utf-8'
rdoc.main = 'README.rdoc'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('TODO.txt')
rdoc.rdoc_files.include('LICENSE')
rdoc.rdoc_files.include('lib/**/*.rb')
end

desc "Generate YARD Documentation"
task(:yardoc) do
require 'yard'
files = %w( lib/**/*.rb )
options = %w( -o doc/yard --readme README.rdoc --files LICENSE )
YARD::CLI::Yardoc.run *(options + files)
end

67 changes: 16 additions & 51 deletions watchr.gemspec
Original file line number Diff line number Diff line change
@@ -1,56 +1,21 @@
require 'lib/watchr'

Gem::Specification.new do |s|
s.name = 'watchr'
s.version = '0.5.7'
s.summary = "Modern continious testing (flexible alternative to autotest)"
s.description = "Modern continious testing (flexible alternative to autotest)."
s.author = "mynyml"
s.email = 'mynyml@gmail.com'
s.homepage = 'http://mynyml.com/ruby/flexible-continuous-testing'
s.has_rdoc = true
s.rdoc_options = %w( --main README.rdoc )
s.extra_rdoc_files = %w( README.rdoc )
s.require_path = "lib"
s.bindir = "bin"
s.executables = "watchr"
s.files = %w[
.gitignore
History.txt
LICENSE
Manifest
README.rdoc
Rakefile
TODO.txt
bin/watchr
docs.watchr
gem.watchr
lib/watchr.rb
lib/watchr/controller.rb
lib/watchr/event_handlers/base.rb
lib/watchr/event_handlers/portable.rb
lib/watchr/event_handlers/unix.rb
lib/watchr/script.rb
manifest.watchr
specs.watchr
test/README
test/event_handlers/test_base.rb
test/event_handlers/test_portable.rb
test/event_handlers/test_unix.rb
test/test_controller.rb
test/test_helper.rb
test/test_script.rb
test/test_watchr.rb
watchr.gemspec
]
s.test_files = %w[
test/test_helper.rb
test/test_watchr.rb
test/test_script.rb
test/test_controller.rb
test/event_handlers/test_base.rb
test/event_handlers/test_unix.rb
test/event_handlers/test_portable.rb
]
s.name = "watchr"
s.summary = "Modern continious testing (flexible alternative to autotest)"
s.description = "Modern continious testing (flexible alternative to autotest)."
s.author = "mynyml"
s.email = "mynyml@gmail.com"
s.homepage = "http://mynyml.com/ruby/flexible-continuous-testing"
s.rubyforge_project = "watchr"
s.has_rdoc = true
s.rdoc_options = %w( --main README.rdoc )
s.extra_rdoc_files = %w( README.rdoc )
s.require_path = "lib"
s.bindir = "bin"
s.executables = "watchr"
s.version = Watchr::VERSION
s.files = File.read("Manifest").strip.split("\n")

s.add_development_dependency 'mocha'
s.add_development_dependency 'jeremymcanally-matchy'
Expand Down

0 comments on commit 823a13c

Please sign in to comment.