summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2008-12-05 11:21:28 -0800
committerRyan Davis <ryand@zenspider.com>2008-12-05 11:21:28 -0800
commita1bcb8e6373fb9d35499b1010071706b21238e9a (patch)
treef9975c009bebd17304b305edfd47b559eb6047b0 /bin
parent6e9c20b418ddd5f873f491afea5141821e3e0a90 (diff)
downloadhoe-a1bcb8e6373fb9d35499b1010071706b21238e9a.tar.gz
Refactored sow's naming code to Hoe.normalize_names and wrote some tests to flush out inconsistencies
[git-p4: depot-paths = "//src/hoe/dev/": change = 4498]
Diffstat (limited to 'bin')
-rwxr-xr-xbin/sow13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/sow b/bin/sow
index 42dbbc4..4341b0c 100755
--- a/bin/sow
+++ b/bin/sow
@@ -3,6 +3,9 @@
$t ||= false
$d ||= false
+require 'rubygems'
+require 'hoe'
+
if defined? $h then
puts "usage: #{File.dirname($0)} [-d|-t] project"
puts " -t = add project to subdir under 'trunk'"
@@ -20,15 +23,7 @@ abort "You must supply a project name on the commandline" unless project
abort "Project #{project} seems to exist" if test ?d, project
puts "creating project #{project}"
-case project
-when /_/ then
- file_name = project
- project = project.capitalize.gsub(/_([a-z])/) {$1.upcase}
- klass = project
-else
- file_name = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
- klass = project.capitalize.gsub(/_([a-z])/) {$1.upcase}
-end
+project, file_name, klass = Hoe.normalize_names project
Dir.mkdir project
Dir.chdir project do