Skip to content

Commit

Permalink
init commands asks for file name if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
ismasan committed Sep 16, 2011
1 parent 6f47291 commit 5732602
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/jbundle/command_line.rb
Expand Up @@ -68,7 +68,8 @@ def self.source_root


desc 'init', 'Create example JFile and test stubs. Usage: jbundle init foo.js' desc 'init', 'Create example JFile and test stubs. Usage: jbundle init foo.js'
method_option :tests, :default => 'qunit', :aliases => '-t' 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 @name = name
@klass_name = name.sub('.js', '').split(/[^a-z0-9]/i).map{|w| w.capitalize}.join @klass_name = name.sub('.js', '').split(/[^a-z0-9]/i).map{|w| w.capitalize}.join


Expand Down

0 comments on commit 5732602

Please sign in to comment.