Class: Braid::Command
Defined Under Namespace
Classes: InvalidRevision
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from T::Sig
sig
git, git_cache
Class Method Details
.msg(str) ⇒ Object
30
31
32
|
# File 'lib/braid/command.rb', line 30
def self.msg(str)
puts "Braid: #{str}"
end
|
.run(command, *args) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/braid/command.rb', line 12
def self.run(command, *args)
verify_git_version!
check_working_dir!
klass = Commands.const_get(command.to_s)
klass.new.run(*args)
rescue BraidError => error
case error
when Operations::ShellExecutionError
msg "Shell error: #{error.message}"
else
msg "Error: #{error.message}"
end
exit(1)
end
|
Instance Method Details
#config ⇒ Object
39
40
41
|
# File 'lib/braid/command.rb', line 39
def config
@config ||= Config.new({'mode' => config_mode})
end
|
#force? ⇒ Boolean
49
50
51
|
# File 'lib/braid/command.rb', line 49
def force?
Braid.force
end
|
#msg(str) ⇒ Object
35
36
37
|
# File 'lib/braid/command.rb', line 35
def msg(str)
self.class.msg(str)
end
|
#verbose? ⇒ Boolean
44
45
46
|
# File 'lib/braid/command.rb', line 44
def verbose?
Braid.verbose
end
|