con_ssh 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a69a63424980fd5fccf434a35cf1e075936755f
4
- data.tar.gz: 62ebe2134ea1539a65dd1fd662dabfb8cb76dbf5
3
+ metadata.gz: 137f168cdca2e68c14620a3cf7a2a607e907fdd4
4
+ data.tar.gz: f1407e891cb892b15642cb5a32c191ff2fb34489
5
5
  SHA512:
6
- metadata.gz: 24816e63f52de103b370eec1cc4615b3807bb8b6c0a453128ffe1fcdca80a8624980e5aaf44bb3716e60cf478f51948bbbe1b9a2b666f7296be68ddbc20d02bb
7
- data.tar.gz: 263466696e1bee2bb90bb309d877ee4074e56a103501653875f8992e340683b87975ea8fea73c93a7c84e68ecc6b14ab218da7af71bc810cebe9090bbbc1e991
6
+ metadata.gz: d27d00f6549f552792aacaf9c8860204fa7a9d560b4f58e6c98f2335f2bfb312335cec66793907bae65a5a6f7d21040242c781eb56906831b64d3504f9af8bf5
7
+ data.tar.gz: 46421bc2a2c28170a083c9c7f0040f4cf757d1a565c8d1353218d853e65391efdff5d6ac8807894761dd6fafee6973d8e8efea739626e4f8adccba7580c27877
data/.rubocop-custom.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
2
  DisabledByDefault: true
3
- TargetRubyVersion: 2.3
3
+ TargetRubyVersion: 2.0
4
4
 
5
5
  #################### Lint ################################
6
6
 
@@ -20,7 +20,7 @@ Lint/AmbiguousRegexpLiteral:
20
20
  Lint/AssignmentInCondition:
21
21
  Description: "Don't use assignment in conditions."
22
22
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
23
- Enabled: true
23
+ Enabled: false
24
24
 
25
25
  Lint/BlockAlignment:
26
26
  Description: 'Align block ends correctly.'
@@ -230,6 +230,7 @@ Metrics/CyclomaticComplexity:
230
230
  A complexity metric that is strongly correlated to the number
231
231
  of test cases needed to validate a method.
232
232
  Enabled: true
233
+ Max: 10
233
234
 
234
235
  Metrics/LineLength:
235
236
  Description: 'Limit lines to 80 characters.'
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+
2
+ source 'https://rubygems.org'
3
+
data/Gemfile.lock ADDED
@@ -0,0 +1,11 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+
5
+ PLATFORMS
6
+ ruby
7
+
8
+ DEPENDENCIES
9
+
10
+ BUNDLED WITH
11
+ 1.14.6
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
1
  con_ssh
2
2
  =================
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/con_ssh.svg)](https://badge.fury.io/rb/con_ssh)
4
+ [![Gem Version](https://badge.fury.io/rb/con_ssh.svg)](https://badge.fury.io/rb/con_ssh)
5
+ [![Code Climate](https://codeclimate.com/github/tomlobato/con_ssh.svg)](https://codeclimate.com/github/tomlobato/con_ssh)
6
+ ![](http://ruby-gem-downloads-badge.herokuapp.com/con_ssh?type=total&label=gem%20downloads)
7
+
8
+ By [Bettercall.io](https://bettercall.io/).
data/bin/con CHANGED
@@ -3,4 +3,4 @@
3
3
  require 'ostruct'
4
4
  require 'con_ssh'
5
5
 
6
- SSHCon.new.run *ARGV
6
+ SSHCon.new.run(*ARGV)
data/con_ssh.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "con_ssh"
3
- s.version = "0.0.2"
3
+ s.version = "0.0.3"
4
4
  s.authors = ["Tom Lobato"]
5
5
  s.email = "lobato@bettercall.io"
6
6
  # s.homepage = "http://sys-watchdog.bettercall.io/"
@@ -13,6 +13,6 @@ Gem::Specification.new do |s|
13
13
  s.test_files = `git ls-files -- test/*`.split("\n")
14
14
  s.require_paths = ["lib"]
15
15
  s.executables = %w(con)
16
- s.required_ruby_version = '>= 2.3.0'
16
+ s.required_ruby_version = '>= 2.0.0'
17
17
  end
18
18
 
data/lib/con_ssh.rb CHANGED
@@ -69,7 +69,7 @@ class SSHCon
69
69
  Please install: 'apt-get install knockd', 'brew install knock', ...".strip_text
70
70
  warn msg
71
71
  return
72
- end
72
+ end
73
73
  run_cmd "knock #{ host } #{ ports.join ' ' }", false
74
74
  end
75
75
 
@@ -88,7 +88,7 @@ class SSHCon
88
88
  def add_connection line
89
89
  return if skip_line? line
90
90
 
91
- values = line.split /\s+/
91
+ values = line.split(/\s+/)
92
92
 
93
93
  conn_conf = OpenStruct.new
94
94
  CONF_LINE_FIELDS.each_with_index do |field, idx|
@@ -117,7 +117,7 @@ class SSHCon
117
117
  end
118
118
 
119
119
  def adjust_conn_conf c
120
- c.knock = c.knock.split ',' if c.knock
120
+ c.knock = c.knock.split ',' if c.knock
121
121
  c.unknock = c.unknock.split ',' if c.unknock
122
122
 
123
123
  if c.host =~ /^(.*?)@(.*?)$/
@@ -167,9 +167,9 @@ class SSHCon
167
167
 
168
168
  def run_cmd cmd, print = true
169
169
  puts "run: #{cmd}" if print
170
- output = `#{cmd} 2>&1`
171
- exit_status = $?.to_i
172
- unless exit_status == 0
170
+ output = `#{cmd} 2>&1`
171
+ exit_status = $?.to_i
172
+ unless exit_status == 0
173
173
  warn "Non-zero output: #{output}"
174
174
  end
175
175
  [exit_status, output]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: con_ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lobato
@@ -21,6 +21,8 @@ files:
21
21
  - ".gitignore"
22
22
  - ".rubocop-custom.yml"
23
23
  - ".ruby-version"
24
+ - Gemfile
25
+ - Gemfile.lock
24
26
  - README.md
25
27
  - Rakefile
26
28
  - TODO
@@ -42,7 +44,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
42
44
  requirements:
43
45
  - - ">="
44
46
  - !ruby/object:Gem::Version
45
- version: 2.3.0
47
+ version: 2.0.0
46
48
  required_rubygems_version: !ruby/object:Gem::Requirement
47
49
  requirements:
48
50
  - - ">="