Class: Tweemux
- Inherits:
-
Object
- Object
- Tweemux
- Defined in:
- lib/tweemux.rb,
lib/tweemux/action.rb,
lib/tweemux/version.rb
Defined Under Namespace
Classes: Action
Constant Summary collapse
- SOCK =
'/tmp/tweemux.sock'
- VERSION =
'1.4.2'
Class Method Summary collapse
Class Method Details
.die(msg) ⇒ Object
16 17 18 19 |
# File 'lib/tweemux.rb', line 16 def die msg warn msg exit 1 end |
.run(args) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/tweemux.rb', line 9 def run args action = understand args action.call rescue Tweemux::Action::NoRestartsException => e die e..color :error end |
.understand(args) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/tweemux.rb', line 21 def understand args args = ['Help'] if args.empty? args = ['Version'] if args.first[/^--?v/i] args = ['Help'] if args.first[/^-/] # dash args are out of fashion! action = args.shift klass = Tweemux::Action.const_get action.capitalize klass.new args end |