Rakefile in rego-1.6.0 vs Rakefile in rego-1.7.0

- old
+ new

@@ -1,10 +1,13 @@ This.rubyforge_project = 'codeforpeople' This.author = "Ara T. Howard" This.email = "ara.t.howard@gmail.com" This.homepage = "https://github.com/ahoward/#{ This.lib }" +task :license do + open('LICENSE', 'w'){|fd| fd.puts "Ruby"} +end task :default do puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort) end @@ -27,11 +30,11 @@ div = ('=' * 119) line = ('-' * 119) test_rbs.each_with_index do |test_rb, index| testno = index + 1 - command = "#{ File.basename(This.ruby) } -I ./lib -I ./test/lib #{ test_rb }" + command = "#{ This.ruby } -w -I ./lib -I ./test/lib #{ test_rb }" puts say(div, :color => :cyan, :bold => true) say("@#{ testno } => ", :bold => true, :method => :print) say(command, :color => :cyan, :bold => true) @@ -58,11 +61,11 @@ task :gemspec do ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem'] ignore_directories = ['pkg'] - ignore_files = ['test/log', 'a.rb'] + Dir['db/*'] + %w'db' + ignore_files = ['test/log'] shiteless = lambda do |list| list.delete_if do |entry| next unless test(?e, entry) @@ -85,24 +88,24 @@ object = This.object version = This.version files = shiteless[Dir::glob("**/**")] executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)} #has_rdoc = true #File.exist?('doc') - test_files = test(?e, "test/#{ lib }.rb") ? "test/#{ lib }.rb" : nil + test_files = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb") summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass" description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass" + license = object.respond_to?(:license) ? object.license : "Ruby" if This.extensions.nil? This.extensions = [] extensions = This.extensions %w( Makefile configure extconf.rb ).each do |ext| extensions << ext if File.exists?(ext) end end extensions = [extensions].flatten.compact -# TODO if This.dependencies.nil? dependencies = [] else case This.dependencies when Hash @@ -125,10 +128,11 @@ spec.name = <%= lib.inspect %> spec.version = <%= version.inspect %> spec.platform = Gem::Platform::RUBY spec.summary = <%= lib.inspect %> spec.description = <%= description.inspect %> + spec.license = <%= license.inspect %> spec.files =\n<%= files.sort.pretty_inspect %> spec.executables = <%= executables.inspect %> spec.require_path = "lib" @@ -186,12 +190,12 @@ cmd = "ruby -e'STDOUT.sync=true; exec %(ruby -I ./lib #{ sample })'" samples << Util.indent(`#{ cmd } 2>&1`, 4) << "\n" end template = - if test(?e, 'readme.erb') - Template{ IO.read('readme.erb') } + if test(?e, 'README.erb') + Template{ IO.read('README.erb') } else Template { <<-__ NAME #{ lib } @@ -291,10 +295,10 @@ abort('no lib') unless This.lib abort('no version') unless This.version # discover full path to this ruby executable # - c = RbConfig::CONFIG + c = Config::CONFIG bindir = c["bindir"] || c['BINDIR'] ruby_install_name = c['ruby_install_name'] || c['RUBY_INSTALL_NAME'] || 'ruby' ruby_ext = c['EXEEXT'] || '' ruby = File.join(bindir, (ruby_install_name + ruby_ext)) This.ruby = ruby