Skip to content
This repository
Browse code

Simplify gem handling

  • Loading branch information...
commit d9ae669c57283cb949f22deca673686789ef6532 1 parent e2b799c
Martin authored November 04, 2009
1  Manifest
@@ -6,6 +6,7 @@ Rakefile
6 6
 examples.rb
7 7
 gem.watchr
8 8
 lib/nanotest.rb
  9
+nanotest.gemspec
9 10
 specs.watchr
10 11
 test/test_helper.rb
11 12
 test/test_nanotest.rb
38  Rakefile
... ...
@@ -1,39 +1,8 @@
1 1
 # --------------------------------------------------
2  
-# Gem
3  
-# --------------------------------------------------
4  
-def gemspec
5  
-  @gemspec ||= Gem::Specification.new do |s|
6  
-    s.name                = "nanotest"
7  
-    s.summary             = "When all you need is #assert"
8  
-    s.description         = "Extremely mynymal test framework. Perfect for DIY lovers. NanoTest provides the bare mynymum needed; for everything else, there's ruby."
9  
-    s.author              = "Martin Aumont"
10  
-    s.email               = "mynyml@gmail.com"
11  
-    s.homepage            = "http://github.com/mynyml/nanotest"
12  
-    s.rubyforge_project   = "nanotest"
13  
-    s.has_rdoc            =  false
14  
-    s.require_path        = "lib"
15  
-    s.version             = "0.9.2"
16  
-    s.files               =  File.read("Manifest").strip.split("\n")
17  
-
18  
-    s.add_development_dependency 'minitest'
19  
-  end
20  
-end
21  
-
22  
-desc "Create a Ruby GEM package with the given name and version."
23  
-task(:gem) do
24  
-  file = Gem::Builder.new(gemspec).build
25  
-  FileUtils.mkdir 'pkg/' unless File.directory? 'pkg'
26  
-  FileUtils.mv file, "pkg/#{file}", :verbose => true
27  
-end
28  
-
29  
-desc "Create gemspec file"
30  
-task(:gemspec) do
31  
-  open("#{gemspec.name}.gemspec", 'w') {|f| f << YAML.dump(gemspec) }
32  
-end
33  
-
34  
-# --------------------------------------------------
35 2
 # Tests
36 3
 # --------------------------------------------------
  4
+task(:default => "test:all")
  5
+
37 6
 namespace(:test) do
38 7
 
39 8
   desc "Run all tests"
@@ -46,7 +15,7 @@ namespace(:test) do
46 15
 
47 16
   desc "Run all tests on multiple ruby versions (requires rvm)"
48 17
   task(:portability) do
49  
-    versions = %w(  1.8.6  1.8.7  1.9  1.9.2  jruby  jruby\ -v\ 1.4.0RC1  )
  18
+    versions = %w(  1.8.6  1.8.7  1.9  1.9.2  jruby  )
50 19
     versions.each do |version|
51 20
       system <<-BASH
52 21
         bash -c 'source ~/.rvm/scripts/rvm;
@@ -76,6 +45,7 @@ desc "LOC count"
76 45
 task(:loc) do
77 46
   loc = 0
78 47
   Dir['lib/**/*'].each do |file|
  48
+    next if File.directory?(file)
79 49
     File.read(file).each_line do |line|
80 50
       loc += 1 unless line.strip.empty? || line.strip =~ /^#/
81 51
     end
15  nanotest.gemspec
... ...
@@ -0,0 +1,15 @@
  1
+Gem::Specification.new do |s|
  2
+  s.name                = "nanotest"
  3
+  s.summary             = "When all you need is #assert"
  4
+  s.description         = "Extremely mynymal test framework. Perfect for DIY lovers. NanoTest provides the bare mynymum needed; for everything else, there's ruby."
  5
+  s.author              = "Martin Aumont"
  6
+  s.email               = "mynyml@gmail.com"
  7
+  s.homepage            = "http://github.com/mynyml/nanotest"
  8
+  s.rubyforge_project   = "nanotest"
  9
+  s.has_rdoc            =  false
  10
+  s.require_path        = "lib"
  11
+  s.version             = "0.9.2"
  12
+  s.files               =  File.read("Manifest").strip.split("\n")
  13
+
  14
+  s.add_development_dependency 'minitest'
  15
+end

0 notes on commit d9ae669

Please sign in to comment.
Something went wrong with that request. Please try again.