pipe2me-client 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42624605ab61b1e56bf53471eebe5d321699f5bb
4
- data.tar.gz: 7624869dc720e1ecc272f86c67d1be7d66ec06a8
3
+ metadata.gz: e6818635298fc7716a54a99493e062c5ebcd2cbc
4
+ data.tar.gz: b169f038d22b5a93a2391e1da087fad6e1c1a452
5
5
  SHA512:
6
- metadata.gz: 156fa716529c419b83c0fe2859758ef291991b37966dfe1c0455a3b2b9d5d7aad8fd8dcbe55224c1f18235d65d788e4600f02ee4f2765118810463497ca92fea
7
- data.tar.gz: 2d053da9bc4a94e57b2fcfa4f1eb35fc43b33eb329ce0b7f9a170ed86eb6e8ce7df7dd881508817678d54c5a0b35a3d6f2fd9b9c584a027c30d8237c2a4dac5b
6
+ metadata.gz: 16c8586bb0e9894c22eeddaaf2bef2d5bb49b0fa9d945821ea79582d441809ce0148aef8eeea7c634f9e5808c29513e1591382c13effe669478e893b02ea04fb
7
+ data.tar.gz: ec4679ba8efc33f46c0c9bbecb4344ac6fcb4b557881a51f2d66732cf341184bb1b679ada24d470e66e80736daf585ecffb05deca043ffd54b25562e8cd4e580
@@ -2,6 +2,8 @@ class Pipe2me::CLI < Thor
2
2
  desc "start", "Start tunnels"
3
3
  option :echo, :type => :boolean, :banner => "Also run echo servers"
4
4
  def start
5
+ handle_global_options
6
+
5
7
  procfile = options[:echo] ? "pipe2me.procfile.echo" : "pipe2me.procfile"
6
8
 
7
9
  File.open procfile, "w" do |io|
@@ -3,6 +3,8 @@ class Pipe2me::CLI < Thor
3
3
  option :port, :default => 5555, :banner => "control port"
4
4
  option :echo, :type => :boolean, :banner => "Also run echo servers"
5
5
  def monit(*args)
6
+ handle_global_options
7
+
6
8
  monitrc_file = create_monitrc
7
9
 
8
10
  UI.warn "Running: monit -c #{monitrc_file} #{args.join(" ")}"
@@ -13,6 +15,8 @@ class Pipe2me::CLI < Thor
13
15
  option :port, :default => 5555, :banner => "control port"
14
16
  option :echo, :type => :boolean, :banner => "Also run echo servers"
15
17
  def monitrc
18
+ handle_global_options
19
+
16
20
  monitrc_file = create_monitrc
17
21
  Kernel.exec "monit", "-c", monitrc_file, "-t"
18
22
  end
data/lib/pipe2me/cli.rb CHANGED
@@ -1,10 +1,37 @@
1
1
  require "thor"
2
2
 
3
3
  class Pipe2me::CLI < Thor
4
+ class_option :dir, :type => :string
5
+ class_option :verbose, :type => :boolean, :aliases => :v
6
+ class_option :quiet, :type => :boolean, :aliases => :q
7
+ class_option :silent, :type => :boolean
8
+
9
+ private
10
+
11
+ def handle_global_options
12
+ UI.verbosity = 2
13
+ if options[:verbose]
14
+ UI.verbosity = 3
15
+ elsif options[:quiet]
16
+ UI.verbosity = 1
17
+ elsif options[:silent]
18
+ UI.verbosity = -1
19
+ end
20
+
21
+ if options[:dir]
22
+ Dir.chdir options[:dir]
23
+ UI.info "Changed into", options[:dir]
24
+ end
25
+ end
26
+
27
+ public
28
+
4
29
  def self.exit_on_failure?; true; end
5
30
 
6
31
  desc "version", "print version information"
7
32
  def version
33
+ handle_global_options
34
+
8
35
  puts Pipe2me::VERSION
9
36
  end
10
37
 
@@ -14,6 +41,8 @@ class Pipe2me::CLI < Thor
14
41
  option :protocols, :default => "https" # "protocol names, e.g. 'http,https,imap'"
15
42
  option :ports, :type => :string # "local ports, one per protocol"
16
43
  def setup
44
+ handle_global_options
45
+
17
46
  Pipe2me::Config.server = options[:server]
18
47
  server_info = Pipe2me::Tunnel.setup options
19
48
 
@@ -23,17 +52,23 @@ class Pipe2me::CLI < Thor
23
52
 
24
53
  desc "env", "show tunnel configuration"
25
54
  def env(*args)
55
+ handle_global_options
56
+
26
57
  puts File.read("pipe2me.local.inc")
27
58
  puts File.read("pipe2me.info.inc")
28
59
  end
29
60
 
30
61
  desc "verify", "Verify the tunnel"
31
62
  def verify
63
+ handle_global_options
64
+
32
65
  Pipe2me::Tunnel.verify
33
66
  end
34
67
 
35
68
  desc "update", "Updates configuration"
36
69
  def update
70
+ handle_global_options
71
+
37
72
  Pipe2me::Tunnel.update
38
73
  end
39
74
  end
@@ -1,4 +1,4 @@
1
1
  module Pipe2me
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  BANNER = "pipe2.me command line client V#{Pipe2me::VERSION}; (c) The kink team, 2013, 2014."
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe2me-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: pipe2.me command line client V0.2.2; (c) The kink team, 2013, 2014.
69
+ description: pipe2.me command line client V0.2.3; (c) The kink team, 2013, 2014.
70
70
  email: contact@kinko.me
71
71
  executables:
72
72
  - pipe2me
@@ -131,5 +131,5 @@ rubyforge_project:
131
131
  rubygems_version: 2.2.1
132
132
  signing_key:
133
133
  specification_version: 4
134
- summary: pipe2.me command line client V0.2.2; (c) The kink team, 2013, 2014.
134
+ summary: pipe2.me command line client V0.2.3; (c) The kink team, 2013, 2014.
135
135
  test_files: []