deplomat 0.1.8 → 0.1.10

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
  SHA256:
3
- metadata.gz: a070fff3ba8c13d46c60d70a64bb7447e2bb906add40ed17405b3d110d4eceeb
4
- data.tar.gz: 85cc1dcb4fe7cdd507c9edcef7f68fa33a0c2533ab5d6aa91d69f9bf5266daf7
3
+ metadata.gz: a4e61e49e58a7d0202392bb9690e92d883dddc085e6ec8e0299d6a7fb8836e23
4
+ data.tar.gz: 63e359530d746474cb083690cadcebb28effa41a5c0d7003bdeda1c292297559
5
5
  SHA512:
6
- metadata.gz: 6c4e018f50fd7f861337f80c2e544db64cb6c18f10c644fd056c6e17f69547d7c51bc5cccf7f13b7f7aeb07e781982087b3f78662c61466936b6b077d53ba75a
7
- data.tar.gz: 629ccd23463c44944e0b8d7e6b686d88206e755113e6105f72383c30e847034e86d40753dc5d99467600e6c74ccd9dea716ca606f1ed6fc7c47691f08cbd668b
6
+ metadata.gz: 4ac78323205e268c84f106d871185d0625ac3779040ec9a05df6f6b88280c26d71143add369156c07d06b4c8fba2f554c61125a42006d3964bf4b8a93dd32167
7
+ data.tar.gz: '0108070dd2c3ea71abe830397bc2e367f4bd90b75506f2659e4a38fdf851826b36a9ed97a8c8ffc550a79d3e26b664729146e2b77dedb2629075d6312ff9977b'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.10
data/deplomat.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: deplomat 0.1.8 ruby lib
5
+ # stub: deplomat 0.1.10 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "deplomat"
9
- s.version = "0.1.8"
9
+ s.version = "0.1.10"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
data/lib/deplomat/node.rb CHANGED
@@ -128,13 +128,15 @@ module Deplomat
128
128
  def clean(path: @current_path, except: [], leave: [0, :last])
129
129
  # Gets us all entries sorted by date, most recent ones first
130
130
  entries_by_date = execute("ls -t", path, log_command: false)[:out].split("\n")
131
- # Don't do anything with entries listed in :except
132
- entries_by_date = entries_by_date - except
133
- if leave
134
- entries_by_date.reverse! if leave[1] == :first
135
- entries_by_date = entries_by_date[leave[0]..entries_by_date.length]
131
+ if entries_by_date
132
+ # Don't do anything with entries listed in :except
133
+ entries_by_date = entries_by_date - except
134
+ if leave
135
+ entries_by_date.reverse! if leave[1] == :first
136
+ entries_by_date = entries_by_date[leave[0]..entries_by_date.length]
137
+ end
138
+ entries_by_date.each { |entry| remove("#{path}#{entry}") } if entries_by_date
136
139
  end
137
- entries_by_date.each { |entry| remove("#{path}#{entry}") }
138
140
  end
139
141
 
140
142
  def log(line, color: 'light_black')
@@ -20,6 +20,7 @@ module Deplomat
20
20
  @pids << process.pid.to_i
21
21
  end
22
22
  end
23
+ @pids.compact!
23
24
  if @pids.empty?
24
25
  log("ERROR: no ssh pid found for\n\t#{first_ssh_command}.\nThis is weird.", color: "red")
25
26
  exit
@@ -54,7 +55,7 @@ module Deplomat
54
55
  def close
55
56
  begin
56
57
  puts "Closing connection(s) to #{@host}, ssh pid(s): #{@pids.join(", ")}."
57
- @pids.each { |pid| Process.kill 'KILL', pid }
58
+ @pids.each { |pid| Process.kill 'TERM', pid }
58
59
  rescue Errno::ESRCH
59
60
  puts "WARNING: no process with #{@pid} found, no connection to close!"
60
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sys-proctable