Class | CommandLine |
In: |
lib/command_line.rb
|
Parent: | Object |
Sets the correct Rails application to use. -m demo -> Becomes the /path/to/browsercms/gem/templates/demo.rb -m module -> Becomes the /path/to/browsercms/gem/templates/modeule.rb If blank, becomes the /path/to/browsercms/gem/templates/blank.rb
# File lib/command_line.rb, line 7 7: def self.set_template(args) 8: if args.include?("-m") 9: index = args.index("-m") 10: if args[index + 1] == "demo" 11: args[index + 1] = template("demo.rb") 12: elsif args[index+1] == "module" 13: args[index + 1] = template("module.rb") 14: end 15: elsif args.include?("--template") 16: index = args.index("--template") 17: if args[index + 1] == "demo" 18: args[index + 1] = template("demo.rb") 19: elsif args[index+1] == "module" 20: args[index + 1] = template("module.rb") 21: end 22: else 23: args << "-m" << template("blank.rb") 24: end 25: 26: end