Class: Metaverse::Cli

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

Instance Method Summary collapse

Instance Method Details

#branchesObject



12
13
14
15
# File 'lib/metaverse/cli.rb', line 12

def branches
  init
  @meta.branches
end

#check(command) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/metaverse/cli.rb', line 63

def check command
  init
  case command
  when 'consistency' then @meta.checkConsistency
  when 'dirtiness' then @meta.checkDirtiness
  end
end

#checkout(name) ⇒ Object



57
58
59
60
# File 'lib/metaverse/cli.rb', line 57

def checkout name
  init
  @meta.checkout name
end

#developObject



51
52
53
54
# File 'lib/metaverse/cli.rb', line 51

def develop
  init
  @meta.checkout 'develop'
end

#feature(command, name) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/metaverse/cli.rb', line 28

def feature command, name
  init
  case command
    when 'new' then @meta.createFeature name
    when 'load' then @meta.loadFeature name
    when 'deploy' then @meta.deploy "feature/#{name}"
  end
end

#initObject



7
8
9
# File 'lib/metaverse/cli.rb', line 7

def init
  @meta = Base.new Dir.pwd
end

#snapshot(command, name) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/metaverse/cli.rb', line 18

def snapshot command, name
  init
  case command
    when 'new' then @meta.createSnapshot name
    when 'load' then @meta.loadSnapshot name
    when 'deploy' then @meta.deploy "tags/#{name}"
  end
end

#statusObject



38
39
40
41
42
# File 'lib/metaverse/cli.rb', line 38

def status
  init
  puts "System is at #{@meta.systemState.first}"
  @meta.status
end

#update(remote = nil) ⇒ Object



45
46
47
48
# File 'lib/metaverse/cli.rb', line 45

def update remote = nil
  init
  @meta.update remote
end