Sha256: cf76ef072af85922db7d6dfaab5162d7fd9b93c76a1d161eb96db70f05cc226f
Contents?: true
Size: 1.29 KB
Versions: 12
Compression:
Stored size: 1.29 KB
Contents
#! /bin/env ruby # vi: set ft=ruby: require 'optparse' require 'corundum/configuration-store' require 'rake/application' skelfiles = [ { :source => 'skel-files/rakefile', :target => 'Rakefile', :unless => Rake::Application::DEFAULT_RAKEFILES, }, { :source => 'skel-files/simplecov', :target => '.simplecov', :unless => ['.simplecov'] }, { :source => 'skel-files/travis', :target => '.travis.yml', :unless => ['.travis.yml'] }, { :source => 'skel-files/gemspec', :target => 'gem.gemspec', :unless => ['gemspec.rb', '*.gemspec'], }, { :source => 'skel-files/gemfile', :target => 'Gemfile', :unless => ['Gemfile'], } ] if %w{-h --help -help help}.include?(ARGV[0]) puts "Spits out skeleton files to start a gem with." puts puts "Will emit these files:" puts skelfiles.map{|desc| desc[:target]}.join(", ") puts puts "Files are copied from the skel-files directory out of this search path:" puts Corundum.configuration_store.valise exit 0 end skelfiles.each do |desc| unless (found = desc[:unless].map{|pattern| Dir.glob(pattern)}.flatten).empty? puts "Refusing to clobber existing '#{found.first}'" else File::open(desc[:target], "w") do |file| file.write(Corundum.configuration_store.loaded[desc[:source]]) end puts "Created #{desc[:target]}" end end
Version data entries
12 entries across 12 versions & 1 rubygems