Class: Metaverse::Cli

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

Instance Method Summary collapse

Instance Method Details

#branchesObject



18
19
20
21
# File 'lib/metaverse/cli.rb', line 18

def branches
  init
  @meta.branches
end

#bugfix(command, name, remote = nil) ⇒ Object



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

def bugfix command, name, remote = nil
  init
  case command
    when 'new' then @meta.create_state 'bugfix', name
    when 'load' then @meta.load_state 'bugfix', name, remote, options[:branch]
    when 'send' then @meta.send_state 'bugfix', name, remote
    when 'close' then @meta.send_state 'bugfix', name, remote, true
  end
end

#check(command) ⇒ Object



97
98
99
100
101
102
103
# File 'lib/metaverse/cli.rb', line 97

def check command
  init
  case command
  when 'dirtiness' then @meta.check_dirtiness
  when 'consistency' then @meta.check_consistency
  end
end

#checkout(name) ⇒ Object



91
92
93
94
# File 'lib/metaverse/cli.rb', line 91

def checkout name
  init
  @meta.checkout name
end

#developObject



85
86
87
88
# File 'lib/metaverse/cli.rb', line 85

def develop
  init
  @meta.checkout 'develop'
end

#exec(*command) ⇒ Object



120
121
122
123
# File 'lib/metaverse/cli.rb', line 120

def exec *command
  init
  @meta.exec ENV, command.join(' ')
end

#feature(command, name, remote = nil) ⇒ Object



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

def feature command, name, remote = nil
  init
  case command
    when 'new' then @meta.create_state 'feature', name
    when 'load' then @meta.load_state 'feature', name, remote, options[:branch]
    when 'send' then @meta.send_state 'feature', name, remote
    when 'close' then @meta.send_state 'feature', name, remote, true
  end
end

#initObject



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

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

#pullObject



106
107
108
109
# File 'lib/metaverse/cli.rb', line 106

def pull
  init
  @meta.pull
end

#release(command, name, remote = nil) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/metaverse/cli.rb', line 48

def release command, name, remote = nil
  init
  case command
    when 'new' then @meta.create_state 'release', name
    when 'load' then @meta.load_state 'release', name, remote, options[:branch]
    when 'send' then @meta.send_state 'release', name, remote
    when 'close' then @meta.send_state 'release', name, remote, true
  end
end

#remote(command, name, url) ⇒ Object



112
113
114
115
116
117
# File 'lib/metaverse/cli.rb', line 112

def remote command, name, url
  init
  case command
  when 'add' then @meta.add_remote name, url
  end
end

#resetObject



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

def reset
  init
  @meta.clear_repos
end

#snapshot(command, name, remote = nil) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/metaverse/cli.rb', line 24

def snapshot command, name, remote = nil
  init
  case command
    when 'new' then @meta.create_state 'snapshot', name
    when 'load' then @meta.load_state 'snapshot', name, remote
    when 'send' then @meta.send_state 'snapshot', name, remote
  end
end

#statusObject



72
73
74
75
76
# File 'lib/metaverse/cli.rb', line 72

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

#update(remote = nil) ⇒ Object



79
80
81
82
# File 'lib/metaverse/cli.rb', line 79

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