Permalink
Browse files

Merge pull request #19 from mac-r/master

optional params
  • Loading branch information...
2 parents cc53853 + 9cd9499 commit 2848ab379d473acf8b0ac19712238ef6ea44221a @mac-r mac-r committed Apr 4, 2013
Showing with 10 additions and 8 deletions.
  1. +10 −8 lib/ajaila/console/generators.rb
@@ -15,14 +15,16 @@
if args[0] == "selector"
content = Ajaila::ConsoleHelper.render("selector")
- io = Ajaila::ConsoleHelper.additional_params(args)
- file = Ajaila::ConsoleHelper.get_file(io)
- file_name = Ajaila::ConsoleHelper.get_file(io).split(".").first.upcase
- table = Ajaila::ConsoleHelper.get_table(io)
- all_columns = Ajaila::ConsoleHelper.get_columns(table)
- clast = all_columns.pop
- cleft = all_columns
- content += "\n" + Ajaila::ConsoleHelper.render( "_parser", :columns => cleft, :last => clast, :collection => table, :file => file, :file_name => file_name )
+ if args[2] != nil
+ io = Ajaila::ConsoleHelper.additional_params(args)
+ file = Ajaila::ConsoleHelper.get_file(io)
+ file_name = Ajaila::ConsoleHelper.get_file(io).split(".").first.upcase
+ table = Ajaila::ConsoleHelper.get_table(io)
+ all_columns = Ajaila::ConsoleHelper.get_columns(table)
+ clast = all_columns.pop
+ cleft = all_columns
+ content += "\n" + Ajaila::ConsoleHelper.render( "_parser", :columns => cleft, :last => clast, :collection => table, :file => file, :file_name => file_name )
+ end
end
if args[0] == "miner"

0 comments on commit 2848ab3

Please sign in to comment.