Class: Braid::Command
- Inherits:
-
Object
- Object
- Braid::Command
- Extended by:
- Operations::VersionControl
- Includes:
- Operations::VersionControl
- Defined in:
- lib/braid/command.rb
Direct Known Subclasses
Braid::Commands::Add, Braid::Commands::Diff, Braid::Commands::Push, Braid::Commands::Remove, Braid::Commands::Setup, Braid::Commands::Status, Braid::Commands::Update, Braid::Commands::UpgradeConfig
Defined Under Namespace
Classes: InvalidRevision
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Operations::VersionControl
Class Method Details
.msg(str) ⇒ Object
26 27 28 |
# File 'lib/braid/command.rb', line 26 def self.msg(str) puts "Braid: #{str}" end |
.run(command, *args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/braid/command.rb', line 9 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.}" else msg "Error: #{error.}" end exit(1) end |