ramdo 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ramdo/ramdisk/linux_wrapper.rb +5 -9
- data/lib/ramdo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 289e382c9cef13403275007365845d8dc9c4ad63
|
4
|
+
data.tar.gz: 14722e25608f9f6567a6c9b28a8d2ce9d702fdcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63cfde5e15ef8a5f605bf600ba1e41ce3dccf9509769ded803f8cd94b198aae9723f4c22482692587db1f305dfe258fe18e778ea4d1dfd54b45f246e147aa051
|
7
|
+
data.tar.gz: 5598cb055290bd33d83b594f62b0b6ab7e9803b4042237f33adfdf55cb36c53b98c274f2aec57ae9672ea42127a915f9881f47795089978a3a8f5e3ba45cbeec
|
@@ -2,19 +2,15 @@ module Ramdo
|
|
2
2
|
module Ramdisk
|
3
3
|
class LinuxWrapper
|
4
4
|
def initialize
|
5
|
-
@shm_path = "/dev/shm"
|
6
|
-
end
|
7
|
-
|
8
|
-
def list
|
9
|
-
disks = []
|
10
|
-
|
11
|
-
found_shm = false
|
12
5
|
line = Cocaine::CommandLine.new("cat", "/proc/mounts")
|
13
6
|
line.run.each_line do |line|
|
14
|
-
|
7
|
+
@shm_path = Regexp.last_match[1] if line =~ /(\/shm)[\s]tmpfs[\s]rw/
|
15
8
|
end
|
16
|
-
raise GeneralRamdiskException.new("
|
9
|
+
raise GeneralRamdiskException.new("shm path not found") unless @shm_path
|
10
|
+
end
|
17
11
|
|
12
|
+
def list
|
13
|
+
disks = []
|
18
14
|
Dir.glob(@shm_path + '/*').each do |dir|
|
19
15
|
if dir =~ Instance::NAME_PATTERN
|
20
16
|
disks << Instance.new(path: dir, device: @shm_path, size: Filesize.from("1 GB"))
|
data/lib/ramdo/version.rb
CHANGED