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

Version Path
corundum-0.4.1 bin/corundum-skel
corundum-0.4.0 bin/corundum-skel
corundum-0.3.9 bin/corundum-skel
corundum-0.3.8 bin/corundum-skel
corundum-0.3.7 bin/corundum-skel
corundum-0.3.6 bin/corundum-skel
corundum-0.3.5 bin/corundum-skel
corundum-0.3.4 bin/corundum-skel
corundum-0.3.3 bin/corundum-skel
corundum-0.3.2 bin/corundum-skel
corundum-0.3.1 bin/corundum-skel
corundum-0.3 bin/corundum-skel