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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f92ac84a314fad2f1cf45da69f8c27418ee02a8c
4
- data.tar.gz: 5ce4534961997c995b66794f7cdf5ada80bb5b5b
3
+ metadata.gz: 6b76b646d9c786c845594cc5f24b93ca7961eb6d
4
+ data.tar.gz: 3b1dd8f5c7fd9a6ae187f201a793649bbeafed00
5
5
  SHA512:
6
- metadata.gz: 49203b023b7950ac56e0f33e4aa669456c9b8041f2570bf43afaa6d9f0d74a9f8324c294db1901e0f92278890355bd762b50e2b38390ab5320539d0992c330a3
7
- data.tar.gz: f42d7d6f90642876e961ab0ffa2279e1b7f68c874d761b05dfb58d4b17b79ea17c227ff4a4ae68aa7f000d62993917e4aaa726fcc5150dccef151701d739aaa2
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 = 'ramdo_' + @uuid
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
@@ -1,3 +1,3 @@
1
1
  module Ramdo
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
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.2
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: