quick_store 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 288ad220c7a70b7417fc5e90b24d797ae159144f
4
- data.tar.gz: 4b9873b3ca493c87f3cbf1ee6179273622e08150
3
+ metadata.gz: ce685b7a4f43be47881c868dfbdc1c5ba78369af
4
+ data.tar.gz: d40c5ea3bd418caec5d7ff4538cfca30a2b25421
5
5
  SHA512:
6
- metadata.gz: 77326c038ccdac3e1f66ba85ecb55d480a9f26a0bbe6d67bc38ada47b0c532707e8a40b95873eff858095fd586d48e83d8b29a9c576e73d89a25a3b134837bf0
7
- data.tar.gz: 410501cb9cfbf8ad412c31c03f895879ce33198ecca62443adf1a2080b058d49f212e8e4c48f9b365d3fe31dd59da2b1c2a5492e4e537ce5c00f264cec373a2e
6
+ metadata.gz: 3820442b0e7aabfbf9ff41bfe7e831ee157941accb944f324c64520a1e271a6c2a8ff8ce0c21292ab25c789daf751be4b94af4707d36c9551df91c6197d1dd02
7
+ data.tar.gz: 443d9e13a96c503de77cd034f0367d68aec5cee9948749c2a5c7e5b8244c3bed2573fa3ca42fba585ccb28c99da293ec671521d0b673c8cd7a9cd57d6403b34d
@@ -1,8 +1,12 @@
1
1
  language: ruby
2
+ cache: bundler
3
+
2
4
  rvm:
3
5
  - 1.9.3
4
6
  - 2.0.0
5
7
  - 2.2.0
8
+ - 2.3.0
6
9
  - ruby-head
7
10
  - jruby-19mode
8
- - rbx-2
11
+ - jruby-9.0.0.0
12
+ - jruby-9.1.5.0
data/README.md CHANGED
@@ -37,6 +37,7 @@ end
37
37
  ```
38
38
 
39
39
  ### Storing, fetching, and deleting data
40
+
40
41
  You can store, receive, and remove data from the store by using different methods:
41
42
 
42
43
  ```ruby
@@ -59,11 +60,11 @@ QuickStore.store.get('a') # => {"b"=>{"c"=>"value"}}
59
60
 
60
61
  # Removing data for a certain nested key
61
62
  QuickStore.store.delete('a/b/c') # => {"b"=>{"c"=>nil}}
62
- QuickStore.get('a') # => {"b"=>{"c"=>nil}}
63
+ QuickStore.store.get('a') # => {"b"=>{"c"=>nil}}
63
64
 
64
65
  # Removing data for all nested keys under a certain key
65
66
  QuickStore.store.delete('a') # => {"b"=>{"c"=>nil}}
66
- QuickStore.get('a') # => nil
67
+ QuickStore.store.get('a') # => nil
67
68
  ```
68
69
 
69
70
  ## Contributing
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
@@ -1,9 +1,11 @@
1
- require "quick_store/version"
2
- require "quick_store/store"
1
+ require 'quick_store/version'
2
+ require 'quick_store/configuration'
3
+ require 'quick_store/store'
3
4
 
5
+ # Allows configuring a YAML store and accessing the configured YAML store
6
+ # through the .store method.
4
7
  module QuickStore
5
-
6
- NO_FILE_PATH_CONFIGURED = "Please configure a file_path for your QuickStore!"
8
+ NO_FILE_PATH_CONFIGURED = 'Please configure a file_path for your QuickStore!'.freeze
7
9
 
8
10
  class << self
9
11
  attr_accessor :configuration
@@ -16,9 +18,9 @@ module QuickStore
16
18
  # config.key_separator = '|' # default is '/'
17
19
  # end
18
20
  def self.configure
19
- yield(self.config)
20
- raise(NO_FILE_PATH_CONFIGURED) unless self.config.file_path
21
- self.config
21
+ yield(config) if block_given?
22
+ raise(NO_FILE_PATH_CONFIGURED) unless config.file_path
23
+ config
22
24
  end
23
25
 
24
26
  # Returns the QuickStore::Configuration.
@@ -45,13 +47,4 @@ module QuickStore
45
47
  def self.store
46
48
  QuickStore::Store
47
49
  end
48
-
49
- class Configuration
50
- attr_accessor :key_separator, :file_path
51
-
52
- def initialize
53
- @key_separator = '/'
54
- end
55
- end
56
-
57
50
  end
@@ -0,0 +1,14 @@
1
+ module QuickStore
2
+ # The Configuration class is used internally by QuickStore to create a
3
+ # singleton configuration.
4
+ # The *key_separator* defines the character which can be used to access nested
5
+ # store items (default is "/").
6
+ # The *file_path* determines where the YAML file is stored.
7
+ class Configuration
8
+ attr_accessor :key_separator, :file_path
9
+
10
+ def initialize
11
+ @key_separator = '/'
12
+ end
13
+ end
14
+ end
@@ -1,15 +1,64 @@
1
- require 'active_support'
2
1
  require 'yaml/store'
3
2
  require 'fileutils'
4
3
  require 'singleton'
5
4
 
6
5
  module QuickStore
7
-
6
+ # Provides setter and getter methods for inserting values into the YAML store,
7
+ # fetching (nested) values, and removing (nested) items from the YAML store.
8
8
  class Store
9
9
  include Singleton
10
10
 
11
11
  attr_reader :file
12
12
 
13
+ class << self
14
+ def get(key)
15
+ instance.get(key)
16
+ end
17
+
18
+ def set(key, value)
19
+ instance.set(key, value)
20
+ end
21
+
22
+ def file
23
+ instance.file
24
+ end
25
+
26
+ def delete(key)
27
+ instance.delete(key)
28
+ end
29
+
30
+ # Defines getter and setter methods for arbitrarily named methods.
31
+ #
32
+ # QuickStore::Store.answer = 42 # saves 'answer: 42' to the store
33
+ # # => 42
34
+ #
35
+ # QuickStore::Store.answer
36
+ # # => 42
37
+ def method_missing(method, *args, &block)
38
+ if method =~ /.*=$/
39
+ ensure_not_singleton_method!(method)
40
+ instance.set(method.to_s.gsub(/=$/, ''), args[0])
41
+ elsif method =~ /\Adelete\_.*$/
42
+ instance.delete(method.to_s.gsub(/\Adelete\_/, ''))
43
+ elsif args.count == 0
44
+ instance.get(method)
45
+ else
46
+ super
47
+ end
48
+ end
49
+
50
+ private
51
+
52
+ def ensure_not_singleton_method!(key)
53
+ return unless singleton_methods.include?(key.to_s.chop.to_sym)
54
+
55
+ raise "There is a \"#{key.to_s.chop}\" instance method already " \
56
+ 'defined. This will lead to problems while getting values ' \
57
+ 'from the store. Please use another key than ' \
58
+ "#{singleton_methods.map(&:to_s)}."
59
+ end
60
+ end
61
+
13
62
  def initialize
14
63
  @file = QuickStore.config.file_path
15
64
 
@@ -34,22 +83,12 @@ module QuickStore
34
83
  # QuickStore::Store.instance.set('a/b/c', 'value')
35
84
  # # => { "b": { "c": "value" } }
36
85
  def set(key, value)
37
- keys = key.to_s.split(QuickStore.config.key_separator)
86
+ keys = key.to_s.split(QuickStore.config.key_separator)
38
87
  base_key = keys.shift
39
88
 
40
- if keys.empty?
41
- final_value = value
42
- else
43
- final_value = keys.reverse.inject(value) { |v, k| { k => v } }
44
- end
45
-
46
- old_value = get(base_key)
47
-
48
- if old_value.is_a?(Hash) && final_value.is_a?(Hash)
49
- updated_values = old_value ? old_value.deep_merge(final_value) : final_value
50
- else
51
- updated_values = final_value
52
- end
89
+ final_value = final_value(keys, value)
90
+ old_value = get(base_key)
91
+ updated_values = updated_values(old_value, final_value)
53
92
 
54
93
  @db.transaction { @db[base_key.to_s] = updated_values }
55
94
  end
@@ -57,8 +96,8 @@ module QuickStore
57
96
  # Gets the value for the given key.
58
97
  # If the value was saved for a key of structure "a/b/c" then the value is
59
98
  # searched in a nested Hash, like: {"a"=>{"b"=>{"c"=>"value"}}}.
60
- # If there is a value stored within a nested hash, it returns the appropriate
61
- # Hash if a partial key is used.
99
+ # If there is a value stored within a nested hash, it returns the
100
+ # appropriate Hash if a partial key is used.
62
101
  #
63
102
  # QuickStore::Store.instance.get('a')
64
103
  # # => {"b"=>{"c"=>"value"}}
@@ -76,7 +115,9 @@ module QuickStore
76
115
  data = @db[base_key.to_s]
77
116
 
78
117
  if data
79
- keys.reduce(data) { |value, key| value ? value = value[key] : nil }
118
+ keys.reduce(data) do |value, store_key|
119
+ value ? value[store_key] : nil
120
+ end
80
121
  end
81
122
  end
82
123
  end
@@ -89,49 +130,38 @@ module QuickStore
89
130
  end
90
131
  end
91
132
 
92
- class << self
93
- def get(key)
94
- instance.get(key)
95
- end
133
+ private
96
134
 
97
- def set(key, value)
98
- instance.set(key, value)
135
+ def final_value(keys, value)
136
+ if keys.empty?
137
+ value
138
+ else
139
+ keys.reverse.inject(value) { |final_value, key| { key => final_value } }
99
140
  end
141
+ end
100
142
 
101
- def file
102
- instance.file
143
+ def updated_values(old_value, final_value)
144
+ if old_value.is_a?(Hash) && final_value.is_a?(Hash)
145
+ deep_merge(old_value, final_value)
146
+ else
147
+ final_value
103
148
  end
149
+ end
104
150
 
105
- def delete(key)
106
- instance.delete(key)
107
- end
151
+ def deep_merge(old_hash, new_hash)
152
+ final_hash = old_hash.dup
108
153
 
109
- # Defines getter and setter methods for arbitrarily named methods.
110
- #
111
- # QuickStore::Store.answer = 42 # saves 'answer: 42' to the store
112
- # # => 42
113
- #
114
- # QuickStore::Store.answer
115
- # # => 42
116
- def method_missing(method, *args, &block)
117
- if method =~ /.*=$/
118
- if singleton_methods.include?(method.to_s.chop.to_sym)
119
- raise "There is a \"#{method.to_s.chop}\" instance method already " +
120
- "defined. This will lead to problems while getting values " +
121
- "from the store. Please use another key than " +
122
- "#{singleton_methods.map(&:to_s)}."
123
- end
154
+ new_hash.each_pair do |key, other_value|
155
+ old_value = final_hash[key]
124
156
 
125
- instance.set(method.to_s.gsub(/=$/, ''), args[0])
126
- elsif method =~/\Adelete\_.*$/
127
- instance.delete(method.to_s.gsub(/\Adelete\_/, ''))
128
- elsif args.count == 0
129
- instance.get(method)
157
+ if old_value.is_a?(Hash) && other_value.is_a?(Hash)
158
+ final_hash[key] = deep_merge(old_value, other_value)
130
159
  else
131
- super
160
+ final_hash[key] = other_value
132
161
  end
133
162
  end
163
+
164
+ final_hash
134
165
  end
135
166
  end
136
-
137
167
  end
@@ -1,3 +1,3 @@
1
1
  module QuickStore
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -4,24 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'quick_store/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "quick_store"
7
+ spec.name = 'quick_store'
8
8
  spec.version = QuickStore::VERSION
9
9
  spec.required_ruby_version = '>= 1.9.3'
10
- spec.authors = ["Paul Götze"]
11
- spec.email = ["paul.christoph.goetze@gmail.com"]
12
- spec.summary = %q{Simple local key-value store based on YAML::Store.}
13
- spec.description = %q{Simple local key-value store based on YAML::Store.}
14
- spec.homepage = "https://github.com/daigaku-ruby/quick_store"
15
- spec.license = "MIT"
10
+ spec.authors = ['Paul Götze']
11
+ spec.email = ['paul.christoph.goetze@gmail.com']
12
+ spec.summary = 'Simple local key-value store based on YAML::Store.'
13
+ spec.description = 'Simple local key-value store based on YAML::Store.'
14
+ spec.homepage = 'https://github.com/daigaku-ruby/quick_store'
15
+ spec.license = 'MIT'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency "activesupport", "~> 4.0"
23
-
24
- spec.add_development_dependency "bundler", "~> 1.7"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "rspec", "~> 3.0"
22
+ spec.add_development_dependency 'bundler', '~> 1.7'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.0'
27
25
  end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe QuickStore::Configuration do
4
+ it { is_expected.to respond_to :key_separator }
5
+ it { is_expected.to respond_to :key_separator= }
6
+ it { is_expected.to respond_to :file_path }
7
+ it { is_expected.to respond_to :file_path= }
8
+
9
+ it 'has the default key separator "/"' do
10
+ expect(QuickStore::Configuration.new.key_separator).to eq '/'
11
+ end
12
+ end
@@ -1,98 +1,100 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe QuickStore::Store do
4
-
5
4
  subject { QuickStore::Store.send(:new) }
6
5
 
7
6
  it { is_expected.to respond_to :get }
8
7
  it { is_expected.to respond_to :set }
9
8
  it { is_expected.to respond_to :file }
10
9
 
11
- it "raises an error if used without a configured file_path" do
12
- allow_any_instance_of(QuickStore::Configuration).to receive(:file_path) { nil }
10
+ it 'raises an error if used without a configured file_path' do
11
+ allow_any_instance_of(QuickStore::Configuration)
12
+ .to receive(:file_path)
13
+ .and_return(nil)
14
+
13
15
  expect { QuickStore::Store.send(:new) }.to raise_error
14
16
  end
15
17
 
16
- it "creates the store file in the given directory on access" do
18
+ it 'creates the store file in the given directory on access' do
17
19
  QuickStore::Store.call_an_arbitrary_method
18
20
  expect(File.exist?(file_path)).to be_truthy
19
21
  end
20
22
 
21
- it "allows setting arbitrary keys by setter methods" do
22
- expect { QuickStore::Store.brownie = "brownie" }.not_to raise_error
23
+ it 'allows setting arbitrary keys by setter methods' do
24
+ expect { QuickStore::Store.brownie = 'brownie' }.not_to raise_error
23
25
  end
24
26
 
25
- it "allows getting subsequently set keys" do
26
- QuickStore::Store.carrots = "carrots"
27
- expect(QuickStore::Store.carrots).to eq "carrots"
27
+ it 'allows getting subsequently set keys' do
28
+ QuickStore::Store.carrots = 'carrots'
29
+ expect(QuickStore::Store.carrots).to eq 'carrots'
28
30
  end
29
31
 
30
- it "allows deleting arbitrary keys by dynamic delete" do
32
+ it 'allows deleting arbitrary keys by dynamic delete' do
31
33
  value = 'chips'
32
34
  QuickStore::Store.potatoes_variation = value
33
35
  expect(QuickStore::Store.potatoes_variation).to eq value
34
36
 
35
- QuickStore::Store::delete_potatoes_variation
37
+ QuickStore::Store.delete_potatoes_variation
36
38
  expect(QuickStore::Store.potatoes_variation).to be_nil
37
39
  end
38
40
 
39
- it "returns nil for not set simple keys" do
41
+ it 'returns nil for not set simple keys' do
40
42
  expect(QuickStore::Store.hamburger).to be_nil
41
43
  end
42
44
 
43
- it "returns nil for not set nested keys" do
44
- key = "pastries/muffins/savory"
45
- expect(QuickStore::Store.get(key)).to be_nil
46
- end
45
+ it 'returns nil for not set nested keys' do
46
+ key = 'pastries/muffins/savory'
47
+ expect(QuickStore::Store.get(key)).to be_nil
48
+ end
47
49
 
48
- it "raises an method missing errror for non getter/setter methods" do
50
+ it 'raises an method missing errror for non getter/setter methods' do
49
51
  expect { QuickStore::Store.arbitrary_method(1, 2) }
50
52
  .to raise_error NoMethodError
51
53
  end
52
54
 
53
55
  [:get, :set, :file, :delete].each do |method|
54
- it "responds to ::#{method}" do
56
+ it "responds to .#{method}" do
55
57
  expect(QuickStore::Store).to respond_to method
56
58
  end
57
59
  end
58
60
 
59
- describe "::get" do
60
- it "returns the value of the given key" do
61
+ describe '.get' do
62
+ it 'returns the value of the given key' do
61
63
  toast = 'toast'
62
64
  QuickStore::Store.toast = toast
63
65
  expect(QuickStore::Store.get(:toast)).to eq toast
64
66
  end
65
67
 
66
- it "gets the value hash for a given partly key" do
67
- base_key = 'pastries'
68
+ it 'gets the value hash for a given partly key' do
69
+ base_key = 'pastries'
68
70
  second_key = 'muffins'
69
- third_key = 'sweet'
70
- key = "#{base_key}/#{second_key}/#{third_key}"
71
- muffin = 'raspberry cream muffin'
72
- hash = { second_key => { third_key => muffin } }
71
+ third_key = 'sweet'
72
+ key = "#{base_key}/#{second_key}/#{third_key}"
73
+ muffin = 'raspberry cream muffin'
74
+ hash = { second_key => { third_key => muffin } }
73
75
 
74
76
  QuickStore::Store.set(key, muffin)
75
77
  expect(QuickStore::Store.get(base_key)).to eq hash
76
78
  end
77
79
  end
78
80
 
79
- describe "::set" do
80
- it "sets the value for the given key" do
81
+ describe '.set' do
82
+ it 'sets the value for the given key' do
81
83
  juice = 'orange juice'
82
84
  QuickStore::Store.set(:juice, juice)
83
85
  expect(QuickStore::Store.juice).to eq juice
84
86
  end
85
87
 
86
- it "sets the value for the given nested key" do
87
- key = "pastries/muffins/sweet"
88
+ it 'sets the value for the given nested key' do
89
+ key = 'pastries/muffins/sweet'
88
90
  muffin = 'blueberry muffin'
89
91
 
90
92
  QuickStore::Store.set(key, muffin)
91
93
  expect(QuickStore::Store.get(key)).to eq muffin
92
94
  end
93
95
 
94
- it "sets the value for the given nested key" do
95
- key = "pastries/muffins/sweet"
96
+ it 'sets the value for the given nested key' do
97
+ key = 'pastries/muffins/sweet'
96
98
  muffin = 'apple walnut muffin'
97
99
 
98
100
  QuickStore::Store.set(key, muffin)
@@ -100,29 +102,29 @@ describe QuickStore::Store do
100
102
  end
101
103
  end
102
104
 
103
- describe "::file" do
104
- it "returns the storage file path" do
105
+ describe '.file' do
106
+ it 'returns the storage file path' do
105
107
  expect(QuickStore::Store.file).to eq QuickStore.config.file_path
106
108
  end
107
109
  end
108
110
 
109
- describe "::delete" do
111
+ describe '.delete' do
110
112
  [:to_delete, 'to_delete'].each do |key|
111
- it "removes the key from the store" do
113
+ it 'removes the key from the store' do
112
114
  statement = 'I really love deleting things!'
113
115
 
114
116
  QuickStore.store.to_delete = statement
115
117
  expect(QuickStore.store.to_delete).to eq statement
116
118
 
117
- QuickStore.store.delete(:to_delete)
119
+ QuickStore.store.delete(key)
118
120
  expect(QuickStore.store.to_delete).to be_nil
119
121
  end
120
122
  end
121
123
 
122
- it "removes nested keys, but keeps other keys on same level" do
123
- key = 'a/deeply/nested/key'
124
- other_key = 'a/deeply/nested/other_key'
125
- value = 'Such worth being deleted.'
124
+ it 'removes nested keys, but keeps other keys on same level' do
125
+ key = 'a/deeply/nested/key'
126
+ other_key = 'a/deeply/nested/other_key'
127
+ value = 'Such worth being deleted.'
126
128
  other_value = 'Such worth being kept.'
127
129
 
128
130
  QuickStore.store.set(key, value)
@@ -141,7 +143,7 @@ describe QuickStore::Store do
141
143
  end
142
144
  end
143
145
 
144
- it "raises an error if the related getter for a setter is already defined" do
146
+ it 'raises an error if the related getter for a setter is already defined' do
145
147
  expect { QuickStore::Store.clone = 'defined' }.to raise_error
146
148
  end
147
149
  end
@@ -1,29 +1,28 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe QuickStore do
4
-
5
- describe '::config' do
6
- it "returns a QuickStore::Configuration instance" do
4
+ describe '.config' do
5
+ it 'returns a QuickStore::Configuration instance' do
7
6
  expect(QuickStore.config).to be_a QuickStore::Configuration
8
7
  end
9
8
  end
10
9
 
11
- describe '::store' do
12
- it "retuns the QuickStore::Store class" do
10
+ describe '.store' do
11
+ it 'retuns the QuickStore::Store class' do
13
12
  expect(QuickStore.store).to be QuickStore::Store
14
13
  end
15
14
 
16
- it "can be used to set values" do
15
+ it 'can be used to set values' do
17
16
  expect { QuickStore.store.muffin = 'blueberry muffin' }.not_to raise_error
18
17
  end
19
18
  end
20
19
 
21
- describe '::configure' do
22
- it "allows passing in a block" do
23
- expect { QuickStore.configure { |config| } }.not_to raise_error
20
+ describe '.configure' do
21
+ it 'allows passing in a block' do
22
+ expect { QuickStore.configure }.not_to raise_error
24
23
  end
25
24
 
26
- it "allows setting the file_path" do
25
+ it 'allows setting the file_path' do
27
26
  QuickStore.configure do |config|
28
27
  config.file_path = file_path
29
28
  end
@@ -31,7 +30,7 @@ describe QuickStore do
31
30
  expect(QuickStore.config.file_path).to eq file_path
32
31
  end
33
32
 
34
- it "allows setting the key_separator" do
33
+ it 'allows setting the key_separator' do
35
34
  QuickStore.configure do |config|
36
35
  config.key_separator = '.'
37
36
  end
@@ -39,10 +38,8 @@ describe QuickStore do
39
38
  expect(QuickStore.config.key_separator).to eq '.'
40
39
  end
41
40
 
42
- it "returns the QuickStore::Configuration" do
43
- config = QuickStore.configure do |config|
44
- end
45
-
41
+ it 'returns the QuickStore::Configuration' do
42
+ config = QuickStore.configure
46
43
  expect(config).to be_a QuickStore::Configuration
47
44
  end
48
45
  end
@@ -2,9 +2,8 @@ require 'rspec'
2
2
 
3
3
  def require_files_from(paths = [])
4
4
  paths.each do |path|
5
- Dir[File.join(File.expand_path("#{path}*.rb", __FILE__))].sort.each do |file|
6
- require file
7
- end
5
+ files = Dir[File.join(File.expand_path("#{path}*.rb", __FILE__))].sort
6
+ files.each { |file| require file }
8
7
  end
9
8
  end
10
9
 
@@ -12,7 +11,7 @@ RSpec.configure do |config|
12
11
  config.color = true
13
12
 
14
13
  require File.expand_path('../../lib/quick_store', __FILE__)
15
- require_files_from ["../support/**/"]
14
+ require_files_from ['../support/**/']
16
15
 
17
16
  config.include TestHelpers
18
17
 
@@ -1,5 +1,5 @@
1
+ # Provides convenience helpers for the specs.
1
2
  module TestHelpers
2
-
3
3
  def file_path
4
4
  File.expand_path('../../test_files/store.yml', __FILE__)
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quick_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Götze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2016-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '4.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -79,9 +65,11 @@ files:
79
65
  - README.md
80
66
  - Rakefile
81
67
  - lib/quick_store.rb
68
+ - lib/quick_store/configuration.rb
82
69
  - lib/quick_store/store.rb
83
70
  - lib/quick_store/version.rb
84
71
  - quick_store.gemspec
72
+ - spec/quick_store/configuration_spec.rb
85
73
  - spec/quick_store/store_spec.rb
86
74
  - spec/quick_store_spec.rb
87
75
  - spec/spec_helper.rb
@@ -106,11 +94,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
94
  version: '0'
107
95
  requirements: []
108
96
  rubyforge_project:
109
- rubygems_version: 2.4.6
97
+ rubygems_version: 2.5.1
110
98
  signing_key:
111
99
  specification_version: 4
112
100
  summary: Simple local key-value store based on YAML::Store.
113
101
  test_files:
102
+ - spec/quick_store/configuration_spec.rb
114
103
  - spec/quick_store/store_spec.rb
115
104
  - spec/quick_store_spec.rb
116
105
  - spec/spec_helper.rb