Class: PapyTools::Commande
- Inherits:
-
Object
- Object
- PapyTools::Commande
- Defined in:
- lib/papy-tools/commande.rb
Direct Known Subclasses
CommandeCreate, CommandeHelp, CommandeInit, CommandeListTemplate
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Commande
constructor
A new instance of Commande.
- #run(options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Commande
Returns a new instance of Commande.
8 9 10 |
# File 'lib/papy-tools/commande.rb', line 8 def initialize end |
Class Method Details
.instance ⇒ Object
12 13 14 |
# File 'lib/papy-tools/commande.rb', line 12 def self.instance() @instance||=new() end |
Instance Method Details
#run(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/papy-tools/commande.rb', line 16 def run(={}) Dir.glob(File.join(Dir.pwd,"helper","*.rb")).each do |f| require f end if ARGV.length<1 CommandeHelp.instance.run() exit(0) end commande=ARGV.first case commande when "create" CommandeCreate.instance.run() when "list-template" CommandeListTemplate.instance.run() when "init" CommandeInit.instance.run() else CommandeHelp.instance.run() end end |