Class: GitTools::CI

Inherits:
Object
  • Object
show all
Defined in:
lib/gitools/ci.rb

Class Method Summary collapse

Class Method Details

.get(options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gitools/ci.rb', line 4

def self.get(options)
  init      = new
  @options  = options
  @yaml     = File.join(@options.yaml, 'config/submodules.yml')
  
  
  case @options.command
  when "setup"
    GitTools::Submodule.setup
  when "add"
    case @options.library
    when "all"
      GitTools::Submodule.add_all(@yaml)
    else
      GitTools::Submodule.add(@yaml, @options.library) unless @options.library.nil? || @options.library.empty?
    end
  when "update"
    case @options.library
    when "all"
      GitTools::Submodule.update_all(@yaml)
    else
      GitTools::Submodule.update(@options.library) unless @options.library.nil? || @options.library.empty?
    end
  else
    puts "Your commands were invalid. See gitools' help: gitools -h"
    exit(0)
  end
  
rescue
  puts "Your commands were invalid. See gitools' help: gitools -h"
  exit(0)
end