Class: Pipe2me::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/pipe2me/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


35
# File 'lib/pipe2me/cli.rb', line 35

def self.exit_on_failure?; true; end

Instance Method Details

#checkObject



82
83
84
85
86
# File 'lib/pipe2me/cli.rb', line 82

def check
  handle_global_options

  Pipe2me::Tunnel.check
end

#clearObject



102
103
104
105
106
107
108
109
# File 'lib/pipe2me/cli.rb', line 102

def clear
  handle_global_options

  UI.error "This will remove the configuration in #{Dir.getwd}. Continue? (^C to cancel)"
  STDIN.gets

  Pipe2me::Tunnel.clear
end

#env(*args) ⇒ Object



60
61
62
63
64
65
# File 'lib/pipe2me/cli.rb', line 60

def env(*args)
  handle_global_options

  puts File.read("pipe2me.local.inc")
  puts File.read("pipe2me.info.inc")
end

#setupObject



49
50
51
52
53
54
55
56
57
# File 'lib/pipe2me/cli.rb', line 49

def setup
  handle_global_options

  Pipe2me.server = options[:server]
  server_info = Pipe2me::Tunnel.setup options

  update
  puts server_info[:fqdn]
end

#startObject



89
90
91
92
93
94
95
96
97
98
99
# File 'lib/pipe2me/cli.rb', line 89

def start
  handle_global_options

  Pipe2me::Tunnel.tunnels.each do |tunnel|
    UI.info "Setting up", tunnel
  end

  cmd = Pipe2me::Tunnel.command
  UI.info cmd
  Kernel.exec cmd
end

#updateObject



75
76
77
78
79
# File 'lib/pipe2me/cli.rb', line 75

def update
  handle_global_options

  Pipe2me::Tunnel.update
end

#verifyObject



68
69
70
71
72
# File 'lib/pipe2me/cli.rb', line 68

def verify
  handle_global_options

  Pipe2me::Tunnel.verify
end

#versionObject



38
39
40
41
42
# File 'lib/pipe2me/cli.rb', line 38

def version
  handle_global_options

  puts Pipe2me::VERSION
end