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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c98b4fcf4eba635afabbc56fc07d2c30d103ce7c77abb1ae3ab2f549d042dc5
4
- data.tar.gz: fa8f149e6049b213cbf785f7019f5ad45f50475c3d33a900b462cf015975152f
3
+ metadata.gz: d238257853ee1ddb008729c9af714e484ca6d1cc3510c33f305ea521a87433df
4
+ data.tar.gz: 21c3f9e00a3946ce2b8526f4b820bfb0d0c9ecc7a764e02140faf5e8e0a6fee6
5
5
  SHA512:
6
- metadata.gz: af57dd83e8d9fb93a46c0a162c0962bab2082bdf1408f4c655e15a4576a67b5b9441f4c17a4e492f5ff646a195b9a4b48950e8eed32ad0100d83aca38724beae
7
- data.tar.gz: 23ca2edce9de9e2998350997b91f8bb84a41584dc2a00cf9de8979b566ec7dfe12917d53cd55cec4fa765d676b3d30291b3c237d1d22f3802f4df4ba45a7a244
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
@@ -1,3 +1,3 @@
1
1
  module FileIsopen
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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: []