bootscale 0.2.0 → 0.2.1

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: 08516aaf7096d27483c2fb2585ccfcb8e391621b
4
- data.tar.gz: f60f2071672f182b20fb27b0d198d4b5ea9e0f1a
3
+ metadata.gz: 12ea5a06403c7393943ebed8fabd492141757710
4
+ data.tar.gz: 6711af8a89ae7e9483fe3f7e8c71762f7530dadb
5
5
  SHA512:
6
- metadata.gz: a6671a28791b4c9f0876c5fd944798b72d9530c8d094768ea81bf217048100826854ed61edb6a046131188a6db40f692bfbf7d28f1078b647b047a183bbe5ac2
7
- data.tar.gz: ab3afc79b67b5935522f84327565ce460912a88c9b0ad7047079072b647617a09695535687053ce28db6ef5d120a5c40004f13a0129616cc0c4b0016b334848a
6
+ metadata.gz: f17b863872f0d6e491f7cd67339d484cbb97fc07a473abb21680fd1aabf7662170ec7276d30c4d4018a32a9db38b533e355347772663d4d450d72078d563cda8
7
+ data.tar.gz: 05d00b2038da7b9436b3c729358f2c19718e94a44c282852872af91bca9c43d4a45484b811e16c8f93f2837c6f8ba8a0ea2ee13dcdbe7dc7499b0d5691b14383
@@ -13,7 +13,9 @@ module Bootscale
13
13
  end
14
14
 
15
15
  def dump(load_path, cache)
16
- File.open(cache_path(load_path), 'wb+') { |f| f.write(MessagePack.dump(cache)) }
16
+ path = cache_path(load_path)
17
+ return if File.exist?(path)
18
+ File.open(path, 'wb+') { |f| f.write(MessagePack.dump(cache)) }
17
19
  end
18
20
 
19
21
  def cache_path(load_path)
@@ -1,3 +1,3 @@
1
1
  module Bootscale
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
data/lib/bootscale.rb CHANGED
@@ -3,10 +3,12 @@ require_relative 'bootscale/version'
3
3
  module Bootscale
4
4
  DOT_SO = '.so'.freeze
5
5
  DOT_RB = '.rb'.freeze
6
+ LEADING_SLASH = '/'.freeze
6
7
 
7
8
  class << self
8
9
  def [](path)
9
10
  path = path.to_s
11
+ return if path.start_with?(LEADING_SLASH)
10
12
  if path.end_with?(DOT_RB) || path.end_with?(DOT_SO)
11
13
  cache[path]
12
14
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootscale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier