ramdo 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 6b76b646d9c786c845594cc5f24b93ca7961eb6d
4
- data.tar.gz: 3b1dd8f5c7fd9a6ae187f201a793649bbeafed00
3
+ metadata.gz: 289e382c9cef13403275007365845d8dc9c4ad63
4
+ data.tar.gz: 14722e25608f9f6567a6c9b28a8d2ce9d702fdcf
5
5
  SHA512:
6
- metadata.gz: ffb8c53fcd7b72c260363e9196a56bcda03d46b1e05f2764f45676c5bf03ad917e11a4003074dbd70cc4e1fa94c9a369bc4153924ff39262ba6d204d67733ec3
7
- data.tar.gz: dd198753bde1a6ace30a8d7f1abfa588ab4d1c33a047e305c629c18da96336a32c3c3a8bccefb2a78026898c7682d75ced8a7f1023e010214a945cdfa64b01c1
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
- found_shm ||= line =~ /^tmpfs \/dev\/shm tmpfs/
7
+ @shm_path = Regexp.last_match[1] if line =~ /(\/shm)[\s]tmpfs[\s]rw/
15
8
  end
16
- raise GeneralRamdiskException.new("#{@shm_path} not found") unless found_shm
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
@@ -1,3 +1,3 @@
1
1
  module Ramdo
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramdo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Franken