Permalink
Browse files

Simplify gem handling

  • Loading branch information...
mynyml committed Nov 5, 2009
1 parent e2b799c commit d9ae669c57283cb949f22deca673686789ef6532
Showing with 20 additions and 34 deletions.
  1. +1 −0 Manifest
  2. +4 −34 Rakefile
  3. +15 −0 nanotest.gemspec
View
@@ -6,6 +6,7 @@ Rakefile
examples.rb
gem.watchr
lib/nanotest.rb
+nanotest.gemspec
specs.watchr
test/test_helper.rb
test/test_nanotest.rb
View
@@ -1,39 +1,8 @@
-# --------------------------------------------------
-# Gem
-# --------------------------------------------------
-def gemspec
- @gemspec ||= Gem::Specification.new do |s|
- s.name = "nanotest"
- s.summary = "When all you need is #assert"
- s.description = "Extremely mynymal test framework. Perfect for DIY lovers. NanoTest provides the bare mynymum needed; for everything else, there's ruby."
- s.author = "Martin Aumont"
- s.email = "mynyml@gmail.com"
- s.homepage = "http://github.com/mynyml/nanotest"
- s.rubyforge_project = "nanotest"
- s.has_rdoc = false
- s.require_path = "lib"
- s.version = "0.9.2"
- s.files = File.read("Manifest").strip.split("\n")
-
- s.add_development_dependency 'minitest'
- end
-end
-
-desc "Create a Ruby GEM package with the given name and version."
-task(:gem) do
- file = Gem::Builder.new(gemspec).build
- FileUtils.mkdir 'pkg/' unless File.directory? 'pkg'
- FileUtils.mv file, "pkg/#{file}", :verbose => true
-end
-
-desc "Create gemspec file"
-task(:gemspec) do
- open("#{gemspec.name}.gemspec", 'w') {|f| f << YAML.dump(gemspec) }
-end
-
# --------------------------------------------------
# Tests
# --------------------------------------------------
+task(:default => "test:all")
+
namespace(:test) do
desc "Run all tests"
@@ -46,7 +15,7 @@ namespace(:test) do
desc "Run all tests on multiple ruby versions (requires rvm)"
task(:portability) do
- versions = %w( 1.8.6 1.8.7 1.9 1.9.2 jruby jruby\ -v\ 1.4.0RC1 )
+ versions = %w( 1.8.6 1.8.7 1.9 1.9.2 jruby )
versions.each do |version|
system <<-BASH
bash -c 'source ~/.rvm/scripts/rvm;
@@ -76,6 +45,7 @@ desc "LOC count"
task(:loc) do
loc = 0
Dir['lib/**/*'].each do |file|
+ next if File.directory?(file)
File.read(file).each_line do |line|
loc += 1 unless line.strip.empty? || line.strip =~ /^#/
end
View
@@ -0,0 +1,15 @@
+Gem::Specification.new do |s|
+ s.name = "nanotest"
+ s.summary = "When all you need is #assert"
+ s.description = "Extremely mynymal test framework. Perfect for DIY lovers. NanoTest provides the bare mynymum needed; for everything else, there's ruby."
+ s.author = "Martin Aumont"
+ s.email = "mynyml@gmail.com"
+ s.homepage = "http://github.com/mynyml/nanotest"
+ s.rubyforge_project = "nanotest"
+ s.has_rdoc = false
+ s.require_path = "lib"
+ s.version = "0.9.2"
+ s.files = File.read("Manifest").strip.split("\n")
+
+ s.add_development_dependency 'minitest'
+end

0 comments on commit d9ae669

Please sign in to comment.