epi 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epi/running_process.rb +6 -1
- data/lib/epi/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b9988a9dbc6d3cbacd39fd072b343c6175eaab
|
4
|
+
data.tar.gz: a0f18a237c97efb644e0afeb7e8a61b9d5680edf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 584215c982e7ba5c564033e6ae248f123ae8935b487c90be273795e4ecf45b82a89a526e1ffcb76ff57c85bc459e978c0b87e896abc2fffc4e1a3bda2f163c90
|
7
|
+
data.tar.gz: 55665a0b346ca8188f1c9945ee21610b759ca70f0e31ef70ca4b0e1aaa7b09d2427e6a4675c313628427dc11dbce9180af7ffbd5f3ef2cdb3e6df087ce99e179
|
data/lib/epi/running_process.rb
CHANGED
@@ -11,7 +11,7 @@ module Epi
|
|
11
11
|
class << self
|
12
12
|
|
13
13
|
def user_name(uid)
|
14
|
-
@users[uid.to_i] ||=
|
14
|
+
@users[uid.to_i] ||= %x[#{username_lookup_cmd % uid}].chomp
|
15
15
|
end
|
16
16
|
|
17
17
|
def group_name(gid)
|
@@ -24,6 +24,11 @@ module Epi
|
|
24
24
|
@groups ||= read_groups
|
25
25
|
end
|
26
26
|
|
27
|
+
def username_lookup_cmd
|
28
|
+
# Use `id -un` on Mac OS, and `getent passwd` on Linux
|
29
|
+
@username_lookup_cmd ||= `uname`.chomp == 'Darwin' ? 'id -un %s' : 'getent passwd %s | cut -d: -f1'
|
30
|
+
end
|
31
|
+
|
27
32
|
def read_groups
|
28
33
|
{}.tap do |result|
|
29
34
|
File.readlines('/etc/group').each do |line|
|
data/lib/epi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil E. Pearson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -106,4 +106,3 @@ signing_key:
|
|
106
106
|
specification_version: 4
|
107
107
|
summary: Epinephrine
|
108
108
|
test_files: []
|
109
|
-
has_rdoc:
|