From 573260290a77a814f2e614ea8c2f9fdf1db1ef01 Mon Sep 17 00:00:00 2001 From: Ismael Celis Date: Fri, 16 Sep 2011 10:43:06 +0100 Subject: [PATCH] init commands asks for file name if not provided --- lib/jbundle/command_line.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jbundle/command_line.rb b/lib/jbundle/command_line.rb index 0b7e559..725abca 100644 --- a/lib/jbundle/command_line.rb +++ b/lib/jbundle/command_line.rb @@ -68,7 +68,8 @@ def self.source_root desc 'init', 'Create example JFile and test stubs. Usage: jbundle init foo.js' method_option :tests, :default => 'qunit', :aliases => '-t' - def init(name) + def init(name = nil) + name = ask("Name of your library (ie. foo.js, awesome.js, etc.):") unless name @name = name @klass_name = name.sub('.js', '').split(/[^a-z0-9]/i).map{|w| w.capitalize}.join