Class: Vam::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/vam/cli.rb

Class Method Summary collapse

Class Method Details

.installObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/vam/cli.rb', line 34

def self.install
  vamfile = File.join Dir.pwd, 'Vamfile'
  dsl = Dsl.evaluate vamfile

  dsl.vams.each do |vam|
    dest = File.join Dir.pwd, 'vendor', 'assets', 'components'
    vam.install dest
  end

end


30
31
32
# File 'lib/vam/cli.rb', line 30

def self.print_version
  puts "Vam: version #{VERSION}"
end

.scanObject



46
47
48
49
# File 'lib/vam/cli.rb', line 46

def self.scan
  dir = Dir.getwd
  Repo.scan dir
end

.start(argv) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/vam/cli.rb', line 9

def self.start(argv)
  Dir.mkdir VAMROOT unless File.directory? VAMROOT
  if argv.length > 0

    case argv[0]
      when 'install'
        install
      when 'scan'
        scan
      when '-v'
        print_version
      else
        print_version
    end

  elsif
    print_version
  end
end