Module: Canals::Cli::Helpers
- Included in:
- Application, Session
- Defined in:
- lib/canals/cli/helpers.rb
Instance Method Summary collapse
- #check_completion ⇒ Object
- #startup_checks ⇒ Object
- #trestart(name) ⇒ Object
- #tstart(name) ⇒ Object
- #tstop(name) ⇒ Object
Instance Method Details
#check_completion ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/canals/cli/helpers.rb', line 28 def check_completion if Canals.config[:completion_version] if Canals.config[:completion_version] != Canals::VERSION Canals::Tools::Completion.update_completion say "bash completion script upgraded, use `source #{Canals::Tools::Completion.cmp_file}` to reload it", :red end end end |
#startup_checks ⇒ Object
24 25 26 |
# File 'lib/canals/cli/helpers.rb', line 24 def startup_checks check_completion end |
#trestart(name) ⇒ Object
19 20 21 22 |
# File 'lib/canals/cli/helpers.rb', line 19 def trestart(name) tstop(name) tstart(name) end |
#tstart(name) ⇒ Object
13 14 15 16 17 |
# File 'lib/canals/cli/helpers.rb', line 13 def tstart(name) pid = Canals.start(name) say "Created tunnel #{name.inspect} with pid #{pid}" pid end |
#tstop(name) ⇒ Object
8 9 10 11 |
# File 'lib/canals/cli/helpers.rb', line 8 def tstop(name) Canals.stop(name) say "Tunnel #{name.inspect} stopped." end |