Sha256: 6c070859a9cc83b9f8560d27297d4ed865342afcd8739122c839b9ad6ddbcae5
Contents?: true
Size: 987 Bytes
Versions: 9
Compression:
Stored size: 987 Bytes
Contents
#! /usr/bin/env ruby # = New Project Wizzard # # Creates the directory structure for a new project. # # code: # * George Moschovitis <gm@navel.gr> # # (c) 2004 Navel, all rights reserved. # $Id: new_app.rb 194 2004-12-20 20:23:57Z gmosx $ require 'fileutils' # gmosx, TODO: move to a library # def ll_r(path, &block) Dir.foreach(path) do |f| next if [".", ".."].include?(f) fullname = path + "/" + f yield(fullname) ll_r(fullname, &block) if FileTest.directory?fullname and not FileTest.symlink?fullname end end bin_dir = File.dirname(__FILE__) if base_dir = ARGV[0] # remove the trailing '/' if it exists. base_dir = base_dir.gsub(/\/$/, '') # the following code is win32 compatible. # FileUtils.cp_r "#{bin_dir}/proto", base_dir ll_r(base_dir) { |f| FileUtils.rm_rf(f) if /\.svn$/ =~ f } =begin Unix implementation %x{ cp -R #{bin_dir}/proto #{base_dir} find #{base_dir} | grep "\.svn$" | xargs rm -rf } =end else puts %{ USAGE: new_app base_dir } end
Version data entries
9 entries across 9 versions & 1 rubygems