Class: PapyTools::Commande

Inherits:
Object
  • Object
show all
Defined in:
lib/papy-tools/commande.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommande

Returns a new instance of Commande.



8
9
10
# File 'lib/papy-tools/commande.rb', line 8

def initialize
   
end

Class Method Details

.instanceObject



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(options={})

    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