ramdo 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/ramdo/store.rb +2 -2
- data/lib/ramdo/version.rb +1 -1
- data/spec/store_spec.rb +8 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b76b646d9c786c845594cc5f24b93ca7961eb6d
|
4
|
+
data.tar.gz: 3b1dd8f5c7fd9a6ae187f201a793649bbeafed00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffb8c53fcd7b72c260363e9196a56bcda03d46b1e05f2764f45676c5bf03ad917e11a4003074dbd70cc4e1fa94c9a369bc4153924ff39262ba6d204d67733ec3
|
7
|
+
data.tar.gz: dd198753bde1a6ace30a8d7f1abfa588ab4d1c33a047e305c629c18da96336a32c3c3a8bccefb2a78026898c7682d75ced8a7f1023e010214a945cdfa64b01c1
|
data/lib/ramdo/store.rb
CHANGED
@@ -2,7 +2,7 @@ module Ramdo
|
|
2
2
|
class Store
|
3
3
|
attr_reader :file, :uuid
|
4
4
|
|
5
|
-
def initialize
|
5
|
+
def initialize(opts = {})
|
6
6
|
wrapper = Ramdisk::Factory.get
|
7
7
|
list = wrapper.list
|
8
8
|
if list.length <= 0
|
@@ -15,7 +15,7 @@ module Ramdo
|
|
15
15
|
end
|
16
16
|
|
17
17
|
@uuid = SecureRandom.uuid
|
18
|
-
@filename =
|
18
|
+
@filename = "ramdo_#{@uuid}#{opts[:extension]}"
|
19
19
|
@file = [@disk.path, @filename].join('/') # No Windows support!
|
20
20
|
end
|
21
21
|
|
data/lib/ramdo/version.rb
CHANGED
data/spec/store_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
include Ramdo
|
4
|
-
describe Store do
|
4
|
+
describe Store, focus: true do
|
5
5
|
after(:all) do
|
6
6
|
wrapper = Ramdisk::Factory.get
|
7
7
|
wrapper.list.each do |disk|
|
@@ -19,6 +19,13 @@ describe Store do
|
|
19
19
|
expect(store.data).to eq(test_data)
|
20
20
|
end
|
21
21
|
|
22
|
+
it 'should create a new store with a specific file extension' do
|
23
|
+
extension = '.bin'
|
24
|
+
|
25
|
+
store = Store.new(extension: extension)
|
26
|
+
expect(File.extname(store.file)).to eq(extension)
|
27
|
+
end
|
28
|
+
|
22
29
|
it 'should create a new store and write data to it' do
|
23
30
|
test_data = 'make me sexy'
|
24
31
|
|
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Franken
|
@@ -162,3 +162,4 @@ test_files:
|
|
162
162
|
- spec/ramdisk_factory_spec.rb
|
163
163
|
- spec/spec_helper.rb
|
164
164
|
- spec/store_spec.rb
|
165
|
+
has_rdoc:
|