hss 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hss +9 -2
  3. metadata +1 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d5c79902b5fb1f6ebd427f9e102be805065f0c4
4
- data.tar.gz: 3661bd22b41352027e3f08443dc404f6aea4e760
3
+ metadata.gz: 183948d88f7b2935a6282e65c8c2a7516a21ac02
4
+ data.tar.gz: 8115548ff012d8a166658f4c93198dc7e419c214
5
5
  SHA512:
6
- metadata.gz: 4a52f03e0b3fa344956b34a30951d2106628266618bcc00c903a6809c15151091f609f0ba112c3512787f8afe25ae00c2502f3bec000daed6f52a301d4b1f1f7
7
- data.tar.gz: b9af3f1e1322b63cddc11bb0c65f101954a1d5700ebf5cabbaa37fff8c9ca139eb031d2061eff68ea166d017573ecb81c90ca089b9813c21743553e54320ef23
6
+ metadata.gz: aacaad14ddcfb54597a32aedd3c0222dd3b836db4c5144e5b23d4551581373e0215b62299fb3532098780b038300f20e7e003587dade8f75d4a7055a7b2b00da
7
+ data.tar.gz: dd2a9d31e0a47b2a2e31f077caac6c38e4ecb3ae5d2191cd8c819682d08e96e27de3964c1b51c3a9449da94634546bcd72dbba4438617a242e357829dec2d493
data/lib/hss CHANGED
@@ -21,6 +21,8 @@ def default(a, b)
21
21
  a.nil? ? a : b
22
22
  end
23
23
 
24
+ Debug = (ENV.include? 'HSS_DEBUG') ? true : false
25
+
24
26
  possible_paths = [
25
27
  File.expand_path(ENV['HSS_CONFIG'].to_s),
26
28
  File.expand_path('~/.hss.yml'),
@@ -33,7 +35,7 @@ if possible_paths.empty?
33
35
  end
34
36
 
35
37
  Conf = open(possible_paths[0]) { |file| YAML.load(file.read) }
36
- Input = ARGV.delete_at ARGV.find_index { |x| x[0] != '-' }
38
+ Input = ARGV.shift
37
39
  Args = ARGV.inject('') { |memo, obj| memo += " '" + obj.gsub(/([$"])/, '\1') + "'" }
38
40
 
39
41
  if Input.nil? or Input == 'help'
@@ -45,7 +47,12 @@ else
45
47
  next unless Input.match(pattern['short'])
46
48
  long_form = eval '"' + pattern['long'] + '"'
47
49
  #long_form = ERB.new('<%= "' + pattern['long'] + '" %>').result
48
- exec "ssh #{long_form} #{Args}"
50
+ if Debug
51
+ puts "ssh #{long_form} #{Args}"
52
+ exit
53
+ else
54
+ exec "ssh #{long_form} #{Args}"
55
+ end
49
56
  end
50
57
  puts "Couldn't find a matching host for: #{Input}"
51
58
  exit 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
@@ -43,4 +43,3 @@ signing_key:
43
43
  specification_version: 4
44
44
  summary: SSH helper
45
45
  test_files: []
46
- has_rdoc: