bastion-cli 0.6.0 → 0.7.2

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: ef6a160a28190efc08e733c625ddfffec4dcac21
4
- data.tar.gz: 327a6b108b622e2bf95075ff099d0a1118e1112d
3
+ metadata.gz: 267c81dfe441a4e125c78f29299c0a46d851eb3e
4
+ data.tar.gz: 23d5c1f334a39934d14f235d1deafa66cec272c5
5
5
  SHA512:
6
- metadata.gz: 4ee06e37f9f3b1fed8bf6a4553be3d7f2c4d1a1dba4676c811687f359f3dbeb240bec42b8a92806889ae3af8d2d4bb3158653f92951cc70c422c8eb4d44d07e6
7
- data.tar.gz: 2d9792397b963c9abaab58d515819e5e16b0f6fe7ca516d681105cb31f01f7db131a18c23cbc00828293e8ac7af332b1fcd1a43a32fc69104b80f4e150a59a26
6
+ metadata.gz: e16b99e527f4b0b0c55bb87ed0229d10e4595c90a043ea8d1ab67c73bb1fcc5bd74cfbbf6034fbfb2b89766d41c58f814fc72734fdf89fe2c232676548f86a5b
7
+ data.tar.gz: 59974408b9d5d635895ab7c26cc31984cc3f43b40cd0fdcd2a0564c9ac87f768da6d88379040fac02a54efae40c8ce06a42e3f0a837d127e7ec957729eddf996
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  *.gem
2
2
  .bundle/
3
+ pkg/
3
4
  Gemfile.lock
@@ -13,6 +13,9 @@ Style/MutableConstant:
13
13
  Style/TrailingCommaInLiteral:
14
14
  Enabled: false
15
15
 
16
+ Metrics/MethodLength:
17
+ Enabled: false
18
+
16
19
  AllCops:
17
20
  Include:
18
21
  - Rakefile
data/Rakefile CHANGED
@@ -6,6 +6,24 @@ RuboCop::RakeTask.new do |task|
6
6
  # task.fail_on_error = false
7
7
  end
8
8
 
9
+ desc "Cleans up stuff"
10
+ task :clean do
11
+ system("rm -fr pkg")
12
+ end
13
+
14
+ desc "Reinstalls"
15
+ task :reinstall do
16
+ system("sudo gem uninstall -x bastion-cli")
17
+ system("sudo gem install bastion-cli")
18
+ end
19
+
20
+ task go: [
21
+ :rubocop,
22
+ :release,
23
+ :clean,
24
+ :reinstall,
25
+ ]
26
+
9
27
  task default: [
10
28
  :rubocop,
11
29
  ]
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2
2
 
3
3
  require "date"
4
- require "bastion"
4
+ require "bastion/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "bastion-cli"
@@ -7,51 +7,53 @@ require "thor"
7
7
  require "bastion"
8
8
 
9
9
  module Bastion
10
- # Cli class
11
- #
12
- #
10
+ ### Main cli class
11
+ ###
13
12
  class Cli < Thor
14
13
  Config.load
15
14
 
15
+ desc "version", "Shows current version"
16
+ def version
17
+ puts "v#{VERSION}"
18
+ end
19
+
20
+ desc "host [HOST]", "Show or set the default bastion host"
21
+ def host(address = nil)
22
+ return Config.save(address) if address
23
+ puts Config.host
24
+ end
25
+
16
26
  desc "ssh [INSTANCE]", "Logs into an instance"
17
27
  option :host
18
28
  option :save, type: :boolean
29
+ option :v, type: :boolean
19
30
  def ssh(instance = nil)
20
31
  host = options[:host] || Config.host
32
+ verb = options[:v] ? " -vvv" : ""
21
33
  Config.save host if options[:save]
22
34
  if instance
23
35
  puts "==> Using #{host}"
24
36
  puts "==> Logging into #{instance}"
25
- exec "ssh -A -t #{host} ssh #{instance}"
37
+ exec "ssh -A -t #{host} ssh #{instance}#{verb}"
26
38
  else
27
39
  puts "==> Logging into #{host}"
28
- exec "ssh -A #{host}"
40
+ exec "ssh -A #{host}#{verb}"
29
41
  end
30
42
  end
31
43
 
32
- desc "host [HOST]", "Show or set the default bastion host"
33
- def host(address = nil)
34
- return Config.save(address) if address
35
-
36
- puts "DEFAULT #{Config.default}"
37
- puts "SAVED #{Config.file}"
38
- puts "ENV #{Config.env}"
39
- puts "ACTUAL #{Config.host}"
40
- end
41
-
42
44
  desc "tunnel [PORT]", "Starts a new tunnel"
43
45
  option :host
44
46
  option :save, type: :boolean
47
+ option :v, type: :boolean
45
48
  def tunnel(port = 1200)
46
49
  host = options[:host] || Config.host
47
- SshConfig.save host if options[:save]
50
+ Config.save host if options[:save]
48
51
  puts "==> Starting tunnel to host #{host} on port #{port}"
49
52
  exec "ssh -D#{port} #{host}"
50
53
  end
51
54
 
52
- desc "version", "Shows current version"
53
- def version
54
- puts "v#{VERSION}"
55
+ def method_missing(name)
56
+ ssh name
55
57
  end
56
58
  end
57
59
  end
@@ -1,5 +1,2 @@
1
1
  require "bastion/config"
2
-
3
- module Bastion
4
- VERSION = "0.6.0"
5
- end
2
+ require "bastion/version"
@@ -0,0 +1,4 @@
1
+
2
+ module Bastion
3
+ VERSION = "0.7.2"
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bastion-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ptdorf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -69,6 +69,7 @@ files:
69
69
  - bin/bastion
70
70
  - lib/bastion.rb
71
71
  - lib/bastion/config.rb
72
+ - lib/bastion/version.rb
72
73
  - license.txt
73
74
  - readme.md
74
75
  homepage: https://github.com/ptdorf/bastion-cli