Module: Canals::Cli::Helpers
- Included in:
- Application, Session
- Defined in:
- lib/canals/cli/helpers.rb
Instance Method Summary collapse
- #check_completion ⇒ Object
-
#checkmark(bool) ⇒ Object
transform boolean into ✓ / ✗.
- #startup_checks ⇒ Object
- #trestart(name) ⇒ Object
- #tstart(name) ⇒ Object
- #tstop(name) ⇒ Object
Instance Method Details
#check_completion ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/canals/cli/helpers.rb', line 30 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 |
#checkmark(bool) ⇒ Object
transform boolean into ✓ / ✗
40 41 42 |
# File 'lib/canals/cli/helpers.rb', line 40 def checkmark(bool) bool ? "\u2713".encode('utf-8') : "\u2717".encode('utf-8') end |
#startup_checks ⇒ Object
26 27 28 |
# File 'lib/canals/cli/helpers.rb', line 26 def startup_checks check_completion end |
#trestart(name) ⇒ Object
21 22 23 24 |
# File 'lib/canals/cli/helpers.rb', line 21 def trestart(name) tstop(name) tstart(name) end |
#tstart(name) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/canals/cli/helpers.rb', line 14 def tstart(name) pid = Canals.start(name) tunnel = Canals.repository.get(name) say "Created tunnel #{name.inspect} with pid #{pid}. You can access it using '#{tunnel.bind_address}:#{tunnel.local_port}'" pid end |