persistent-cache 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ module Persistent
14
14
  end
15
15
 
16
16
  def connect_to_database
17
- FileUtils.makedirs([@storage_root]) if not File.exists?(@storage_root) or not File.directory?(@storage_root)
17
+ FileUtils.makedirs([@storage_root]) if not File.directory?(@storage_root)
18
18
  end
19
19
 
20
20
  def save_key_value_pair(key, value, timestamp = nil)
@@ -120,7 +120,7 @@ module Persistent
120
120
  root_path = Pathname.new(File.absolute_path(@storage_root))
121
121
  key_path = Pathname.new(File.absolute_path(compile_key_path(key)))
122
122
  relative = key_path.relative_path_from(root_path).to_s
123
- raise ArgumentError.new("key is outside of storage_root scope") if relative.start_with?("../")
123
+ raise ArgumentError.new("key is outside of storage_root scope") if relative.start_with?("..")
124
124
  raise ArgumentError.new("key is the same as storage_root") if relative == "."
125
125
  end
126
126
 
@@ -1,5 +1,5 @@
1
1
  module Persistent
2
2
  class Cache
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: persistent-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-05-05 00:00:00.000000000 Z
13
+ date: 2015-05-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec