file_isopen 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/file_isopen/file_extensions.rb +11 -0
- data/lib/file_isopen/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d238257853ee1ddb008729c9af714e484ca6d1cc3510c33f305ea521a87433df
|
4
|
+
data.tar.gz: 21c3f9e00a3946ce2b8526f4b820bfb0d0c9ecc7a764e02140faf5e8e0a6fee6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10e812ce3089f31551a7b4fd13db995aa190e157783576fe31c82697d00dfb4f69eba8130cb9346c109b68acdbc20d201e18f3ecc1ec17cdf5ee6e8bea76419
|
7
|
+
data.tar.gz: 9ce2afc31345ff0f707fbfec7666c9fe0ea26d1d17dd8b986aa85a090780480f1568de5b0669fd39730b95d5bd184a1dee2d10c4ce244eb5af8249a399c1984b
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module File::IsOpen
|
2
|
+
def self.included(base)
|
3
|
+
base.extend(ClassMethods)
|
4
|
+
end
|
5
|
+
|
6
|
+
module ClassMethods
|
7
|
+
def is_open?(aPath=nil)
|
8
|
+
Dir.glob('/proc/*/fd/*').collect { |fn|File.symlink?(fn) ? File.readlink(fn):nil}.reject{|each|each.nil? or each =~ /^socket:|^\/dev\/|^pipe:|^anon_inode:/}.to_set.include?(aPath)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/file_isopen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_isopen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Parker
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- bin/setup
|
40
40
|
- file_isopen.gemspec
|
41
41
|
- lib/file_isopen.rb
|
42
|
+
- lib/file_isopen/file_extensions.rb
|
42
43
|
- lib/file_isopen/version.rb
|
43
44
|
homepage: https://gitlab.com/svdasein/file_isopen
|
44
45
|
licenses: []
|