Browse files

Removed unnecessary code that came from newgem. Tweaked gemspec. Upda…

…ted rake tasks.
  • Loading branch information...
1 parent ab25dfb commit a86c87191e9679e3c5905194dc4484f55b1eef5c Myron Marston committed Mar 27, 2009
Showing with 56 additions and 95 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 CHANGELOG
  3. +0 −4 History.txt
  4. +5 −6 Manifest.txt
  5. +0 −7 PostInstall.txt
  6. +1 −1 README.rdoc
  7. +39 −25 Rakefile
  8. +1 −4 lib/test_benchmarker.rb
  9. +0 −10 script/console
  10. +0 −14 script/destroy
  11. +0 −14 script/generate
  12. +6 −10 test_benchmarker.gemspec
View
1 .gitignore
@@ -0,0 +1 @@
+test_benchmarker-*.gem
View
3 CHANGELOG
@@ -0,0 +1,3 @@
+== 1.0.0 2009-03-27
+
+* Initial release
View
4 History.txt
@@ -1,4 +0,0 @@
-== 0.0.1 2009-03-26
-
-* 1 major enhancement:
- * Initial release
View
11 Manifest.txt
@@ -1,15 +1,14 @@
-History.txt
+CHANGELOG
Manifest.txt
-PostInstall.txt
README.rdoc
Rakefile
+lib
+lib/test_benchmarker
lib/test_benchmarker.rb
lib/test_benchmarker/core_ext.rb
lib/test_benchmarker/test_benchmarks.rb
lib/test_benchmarker/test_suite.rb
-script/console
-script/destroy
-script/generate
-text/test_core_ext.rb
+test
+test/test_core_ext.rb
test/test_helper.rb
test/test_test_benchmarker.rb
View
7 PostInstall.txt
@@ -1,7 +0,0 @@
-
-For more information on test_benchmarker, see http://test_benchmarker.rubyforge.org
-
-NOTE: Change this information in PostInstall.txt
-You can also delete it if you don't want it.
-
-
View
2 README.rdoc
@@ -26,7 +26,7 @@ FIX (describe your package)
(The MIT License)
-Copyright (c) 2009 FIXME full name
+Copyright (c) 2009 Myron Marston, Kashless.org
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
64 Rakefile
@@ -1,28 +1,42 @@
-%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
-require File.dirname(__FILE__) + '/lib/test_benchmarker'
+require 'rubygems'
+require 'rake/gempackagetask'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+task :default => :test
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-$hoe = Hoe.new('test_benchmarker', TestBenchmarker::VERSION) do |p|
- p.developer('FIXME full name', 'FIXME email')
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
- p.rubyforge_name = p.name # TODO this is default value
- # p.extra_deps = [
- # ['activesupport','>= 2.0.2'],
- # ]
- p.extra_dev_deps = [
- ['newgem', ">= #{::Newgem::VERSION}"]
- ]
-
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
- p.rsync_args = '-av --delete --ignore-errors'
+desc "Run All Tests"
+Rake::TestTask.new :test do |test|
+ test.test_files = ["test/**/*.rb"]
+ test.verbose = true
end
-require 'newgem/tasks' # load /tasks/*.rake
-Dir['tasks/**/*.rake'].each { |t| load t }
-
-# TODO - want other tests/tasks run by default? Add them to the list
-# task :default => [:spec, :features]
+desc %{Update ".manifest" with the latest list of project filenames. Respect\
+.gitignore by excluding everything that git ignores. Update `files` and\
+`test_files` arrays in "*.gemspec" file if it's present.}
+task :manifest do
+ list = Dir['**/*'].sort
+ spec_file = Dir['*.gemspec'].first
+ list -= [spec_file] if spec_file
+
+ if File.exist?('.gitignore')
+ File.read('.gitignore').each_line do |glob|
+ glob = glob.chomp.sub(/^\//, '')
+ list -= Dir[glob]
+ list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
+ puts "excluding #{glob}"
+ end
+ end
+
+ if spec_file
+ spec = File.read spec_file
+ spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
+ assignment = $1
+ bunch = $2 ? list.grep(/^test\//) : list
+ '%s%%w(%s)' % [assignment, bunch.join(' ')]
+ end
+
+ File.open(spec_file, 'w') {|f| f << spec }
+ end
+ File.open('manifest.txt', 'w') {|f| f << list.join("\n") }
+end
View
5 lib/test_benchmarker.rb
@@ -1,8 +1,5 @@
-$:.unshift(File.dirname(__FILE__)) unless
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-
module TestBenchmarker
- VERSION = '0.0.1'
+ VERSION = '0.9.0'
end
require 'lib/test_benchmarker/test_benchmarks'
View
10 script/console
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-# File: script/console
-irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
-
-libs = " -r irb/completion"
-# Perhaps use a console_lib to store any extra methods I may want available in the cosole
-# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
-libs << " -r #{File.dirname(__FILE__) + '/../lib/test_benchmarker.rb'}"
-puts "Loading test_benchmarker gem"
-exec "#{irb} #{libs} --simple-prompt"
View
14 script/destroy
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/destroy'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
-RubiGen::Scripts::Destroy.new.run(ARGV)
View
14 script/generate
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/generate'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
-RubiGen::Scripts::Generate.new.run(ARGV)
View
16 test_benchmarker.gemspec
@@ -1,20 +1,16 @@
Gem::Specification.new do |s|
- s.name = "text_benchmarker"
- s.version = "0.0.1"
+ s.name = "test_benchmarker"
+ s.version = "0.9.0"
s.date = "2009-03-27"
s.summary = "A tool for benchmarking ruby Test::Unit tests"
s.homepage = "http://github.com/myronmarston/test_benchmarker"
s.has_rdoc = true
s.authors = ["Myron Marston"]
s.email = "myron.marston@gmail.com"
- s.files = %w(CHANGELOG LICENSE.txt README.rdoc Rakefile lib lib/fake_web lib/fake_web.rb lib/fake_web/ext lib/fake_web/ext/net_http.rb lib/fake_web/registry.rb lib/fake_web/responder.rb lib/fake_web/response.rb lib/fake_web/stub_socket.rb lib/fakeweb.rb test test/fixtures test/fixtures/google_response_from_curl test/fixtures/google_response_with_transfer_encoding test/fixtures/google_response_without_transfer_encoding test/fixtures/test_example.txt test/fixtures/test_txt_file test/test_allow_net_connect.rb test/test_fake_web.rb test/test_fake_web_open_uri.rb test/test_helper.rb test/test_query_string.rb)
- s.test_files = %w(test/fixtures test/fixtures/google_response_from_curl test/fixtures/google_response_with_transfer_encoding test/fixtures/google_response_without_transfer_encoding test/fixtures/test_example.txt test/fixtures/test_txt_file test/test_allow_net_connect.rb test/test_fake_web.rb test/test_fake_web_open_uri.rb test/test_helper.rb test/test_query_string.rb)
+ s.files = %w(CHANGELOG Manifest.txt README.rdoc Rakefile lib lib/test_benchmarker lib/test_benchmarker.rb lib/test_benchmarker/core_ext.rb lib/test_benchmarker/test_benchmarks.rb lib/test_benchmarker/test_suite.rb test test/test_core_ext.rb test/test_helper.rb test/test_test_benchmarker.rb)
+ s.test_files = %w(test/test_core_ext.rb test/test_helper.rb test/test_test_benchmarker.rb)
s.rdoc_options = ["--main", "README.rdoc",
"--title", "TestBenchmarker Documentation",
- "--charset", "utf-8",
- "--line-numbers",
- "--inline-source"]
- #s.extra_rdoc_files = ["CHANGELOG", "LICENSE.txt", "README.rdoc"]
- #s.rubyforge_project = "fakeweb"
- #s.add_development_dependency "mocha", ">= 0.9.5"
+ "--charset", "utf-8"]
+ s.extra_rdoc_files = ["CHANGELOG", "README.rdoc"]
end

0 comments on commit a86c871

Please sign in to comment.