task/gemgem.rb in rack-rails-logger-1.0.0 vs task/gemgem.rb in rack-rails-logger-1.0.1

- old
+ new

@@ -10,30 +10,39 @@ def create yield(spec = Gem::Specification.new{ |s| s.authors = ['Lin Jen-Shin (godfat)'] s.email = ['godfat (XD) godfat.org'] - description = File.read("#{Gemgem.dir}/README"). + description = readme. match(/DESCRIPTION:\n\n(.+?)(?=\n\n[^\n]+:\n)/m)[1]. lines.to_a s.description = description.join s.summary = description.first - s.extra_rdoc_files = %w[CHANGES CONTRIBUTORS LICENSE TODO].select{ |f| - File.exist?(f) } - s.rdoc_options = %w[--main README] s.rubygems_version = Gem::VERSION s.date = Time.now.strftime('%Y-%m-%d') s.files = gem_files s.test_files = gem_files.grep(%r{^test/(.+?/)*test_.+?\.rb$}) + s.executables = Dir['bin/*'].map{ |f| File.basename(f) } s.require_paths = %w[lib] }) spec.homepage ||= "https://github.com/godfat/#{spec.name}" spec end + def readme + path = %w[README.md README].find{ |name| + File.exist?("#{Gemgem.dir}/#{name}") + } + if path + File.read(path) + else + "DESCRIPTION:\n\n \n\nEND:\n" + end + end + def gem_tag "#{spec.name}-#{spec.version}" end def write @@ -149,19 +158,15 @@ task :test do require 'bacon' Bacon.extend(Bacon::TestUnitOutput) Bacon.summary_on_exit $LOAD_PATH.unshift('lib') - Dir['test/test_*.rb'].each{ |file| load file } + Dir['./test/**/test_*.rb'].each{ |file| require file[0..-4] } end desc 'Run tests with shell' task 'test:shell', :RUBY_OPTS do |t, args| - files = unless defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' - 'test/test_*.rb' - else - Dir['test/test_*.rb'].join(' ') - end + files = Dir['test/**/test_*.rb'].join(' ') cmd = [Gem.ruby, args[:RUBY_OPTS], '-I', 'lib', '-S', 'bacon', '--quiet', files] sh(cmd.compact.join(' '))