Sha256: d5e11b35975e85e06ff2575b6339fd578b32bb473843584fd6071c3b98c06fcd
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
#!/usr/bin/env ruby require 'nitro' require 'ftools' require 'nano/dir/recurse' PROTO_DIR = File.join(Nitro::LibPath, '..', 'proto') def usage puts <<-USAGE NAME nitrogen - frontend for the Nitro generator mechanism. SYNOPSIS nitrogen app [full path] DESCRIPTION This is a frontend to the Nitro generator mechanism. Nitro generators are used to 'bootstrap' development by creating a standard directory structure and files for common tasks. app: This will create some basic files to get you started fleshing out your Nitro web application. EXAMPLE nitrogen app ~/my_application This will generate a new Nitro application in the ~/my_application folder. USAGE exit 1 end def run case command = ARGV[0] || usage() when 'app' path = ARGV[1] || usage() path = File.expand_path(path) if File.exists?(path) STDERR.puts "ERROR: Path #{path} already exists! Aborting!" exit 1 end FileUtils.cp_r(PROTO_DIR, path) Dir.recurse(path) do |f| FileUtils.rm_rf(f) if /\.svn$/ =~ f end else usage() end end run # This script is based on Michael Neumann's Wee creator script.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nitro-0.23.0 | bin/nitrogen |