swapus 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +1 -1
  4. data/VERSION +1 -1
  5. data/lib/swapus.rb +8 -4
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f4a80ef351b819295e802c80a25a8818bc9e72e
4
- data.tar.gz: b20d67ee52c29c334f606d9c08505b5aaa045c24
3
+ metadata.gz: cd627060d211deac61186300e2e4c7f4aaf31438
4
+ data.tar.gz: da688dab64de2919e83c83a2adae75bd3b41a00e
5
5
  SHA512:
6
- metadata.gz: aeaace77d0367dedef5a585b1ed053fb12eec8e1417cff09e27bb6eb9409084ebbbd1de74e7d0b5c158dc9da4eb98e950632fc9612d554a509815852c1906b9f
7
- data.tar.gz: 35a859957104916f80f5b5655cf6a97bd6a5d9943e3fefc120875dd838ef402aefcb526442ae5b30c2d41dc9c8fedf657314442b0712a6da8405623ebf10be44
6
+ metadata.gz: b7d6c15dd7ae7f385ac1eb53cd633b3755fed21827b14ca11335f39692c43b85697790120b9ea99c371fbe3026bcb49be17cacb18cfbe9e07cede5e6d1a06779
7
+ data.tar.gz: 68e9dffe909cc20d9f055e1e6dc07b9ceba26bb704e24ac214a6c0c63c9e5895d5832a1b579f8dfcee1c564d5fc7c9554fb54d63a01ac20f9c4ff9512afd9b2c
@@ -1,4 +1,8 @@
1
1
  # CHANGELOG
2
+ ## v1.1.1 (2018-02-07)
3
+
4
+ * fix: no raise error if a process is terminated during the swapus execution
5
+
2
6
  ## v1.1.0 (2018-02-02)
3
7
 
4
8
  * feat: add option to reverse the output result
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Swapus
2
- [![Version](https://img.shields.io/badge/latest_version-1.1.0-green.svg)](https://github.com/nishiki/swapus/releases)
2
+ [![Version](https://img.shields.io/badge/latest_version-1.1.1-green.svg)](https://github.com/nishiki/swapus/releases)
3
3
  [![Build Status](https://travis-ci.org/nishiki/swapus.svg?branch=master)](https://travis-ci.org/nishiki/swapus)
4
4
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/nishiki/swapus/blob/master/LICENSE)
5
5
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -25,11 +25,15 @@ class SwapUsage
25
25
 
26
26
  def get_processes
27
27
  Dir['/proc/[0-9]*'].map do |pid_dir|
28
- pid = File.basename(pid_dir).to_i
29
- cmd = File.read("#{pid_dir}/cmdline").tr("\x00", ' ').strip
30
- swap = File.read("#{pid_dir}/status")[/^VmSwap:\s+([0-9]+)\s+kB$/, 1].to_i
28
+ begin
29
+ pid = File.basename(pid_dir).to_i
30
+ cmd = File.read("#{pid_dir}/cmdline").tr("\x00", ' ').strip
31
+ swap = File.read("#{pid_dir}/status")[/^VmSwap:\s+([0-9]+)\s+kB$/, 1].to_i
31
32
 
32
- @processes[pid] = { cmd: cmd, swap: swap } if swap.positive?
33
+ @processes[pid] = { cmd: cmd, swap: swap } if swap.positive?
34
+ rescue Errno::ENOENT
35
+ next
36
+ end
33
37
  end
34
38
  end
35
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swapus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Waksberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-02-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: