lib/bones/main.rb in bones-1.3.4 vs lib/bones/main.rb in bones-1.3.5
- old
+ new
@@ -1,6 +1,6 @@
-# $Id: main.rb 543 2008-02-20 04:36:46Z tim_pease $
+# $Id: main.rb 561 2008-02-27 23:28:19Z tim_pease $
require 'fileutils'
require 'optparse'
require 'erb'
@@ -37,11 +37,12 @@
opts.on('-u', '--update',
'update the rake tasks for the project') {self.update = true}
opts.on('-v', '--verbose',
'enable verbose output') {self.verbose = true}
opts.on('-d', '--directory DIRECTORY', String,
- 'project directory to create') {|dir| self.output_dir = dir}
+ 'project directory to create',
+ '(defaults to project_name)') {|dir| self.output_dir = dir}
opts.separator ''
opts.on('--freeze', 'freeze the project skeleton') {freeze; exit}
opts.on('--unfreeze', 'use the standard project skeleton') {unfreeze; exit}
opts.on('-i', '--info',
@@ -83,10 +84,10 @@
# Returns the project name but converted to be usable as a Ruby class
# name.
#
def classname
- name.split('_').map {|x| x.capitalize}.join
+ name.tr('-','_').split('_').map {|x| x.capitalize}.join
end
# Create a new project from the bones/data project template.
#
def create