bootsnap 1.1.2 → 1.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: 0bacfedefdb44932b9e59f7fc6013a725851afcd
4
- data.tar.gz: bc54d7c07ede22792a08496483d7a3093262d0e9
3
+ metadata.gz: 571a948c1f47d0fe2479dc8f5e587a28f6f6e920
4
+ data.tar.gz: 30edefbdb98f43e62d158b01c02d3d2f7328c9a3
5
5
  SHA512:
6
- metadata.gz: 4c500e2ab898cf1869ae86fbb848834df82b95ede6f814b39048db7b678b2f413e3bcecaa9b0741601cd16b6332e4257ebfb276e001c442927068a6c2c7f4223
7
- data.tar.gz: fc1f5d5602baf8fd72f38cf56966517f3faa249acae04c2ef41b3c153ecfe99bfcb4680c4506c2d711b27d0972240723afef10cd05000de8482847984ebafc60
6
+ metadata.gz: d2e2d6870a915ad9fee43c6ff27e82037af65a81bf3cba541d4cc761dcb54686c0cef48495760f78a653cf6cdb7d4e2aea2c06db24cddfa2a88b6929ccef8512
7
+ data.tar.gz: 5879118608d76c30609f0e0c95af7619965307c9cb77ab42b9fa1d7b80f391b8c7432232ec2af46e99d6a331041506be50bd053967502e8f2039550e59e20ec0
@@ -1,3 +1,7 @@
1
+ # 1.1.3
2
+
3
+ * Properly resolve symlinked path entries
4
+
1
5
  # 1.1.2
2
6
 
3
7
  * Minor fix: deprecation warning
data/README.md CHANGED
@@ -132,7 +132,7 @@ result too, raising a `LoadError` without touching the filesystem at all.
132
132
 
133
133
  Ruby has complex grammar and parsing it is not a particularly cheap operation. Since 1.9, Ruby has
134
134
  translated ruby source to an internal bytecode format, which is then executed by the Ruby VM. Since
135
- 2.2, Ruby [exposes an API](https://ruby-doc.org/core-2.3.0/RubyVM/InstructionSequence.html) that
135
+ 2.3.0, Ruby [exposes an API](https://ruby-doc.org/core-2.3.0/RubyVM/InstructionSequence.html) that
136
136
  allows caching that bytecode. This allows us to bypass the relatively-expensive compilation step on
137
137
  subsequent loads of the same file.
138
138
 
@@ -1,8 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
3
  if [ $# -eq 0 ]; then
4
- ruby -I"test" -e 'Dir.glob("./test/**/*_test.rb").each { |f| require f }' -- "$@"
4
+ ruby -I"test" -w -e 'Dir.glob("./test/**/*_test.rb").each { |f| require f }' -- "$@"
5
5
  else
6
6
  path=$1
7
- ruby -I"test" -e "require '${path#test/}'" -- "$@"
7
+ ruby -I"test" -w -e "require '${path#test/}'" -- "$@"
8
8
  fi
@@ -11,8 +11,8 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.license = "MIT"
13
13
 
14
- spec.summary = "wip"
15
- spec.description = "wip."
14
+ spec.summary = "Boot large ruby/rails apps faster"
15
+ spec.description = spec.summary
16
16
  spec.homepage = "https://github.com/Shopify/bootsnap"
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -1,4 +1,3 @@
1
- require_relative '../load_path_cache'
2
1
  require_relative '../explicit_require'
3
2
 
4
3
  module Bootsnap
@@ -11,6 +10,7 @@ module Bootsnap
11
10
  @store = store
12
11
  @mutex = defined?(::Mutex) ? ::Mutex.new : ::Thread::Mutex.new # TODO: Remove once Ruby 2.2 support is dropped.
13
12
  @path_obj = path_obj
13
+ @has_relative_paths = nil
14
14
  reinitialize
15
15
  end
16
16
 
@@ -35,8 +35,8 @@ module Bootsnap
35
35
  acc[base] = nil # enumerator
36
36
 
37
37
  if [DOT_SO, *DL_EXTENSIONS].include?(ext)
38
- DL_EXTENSIONS.each do |ext|
39
- acc["#{base}#{ext}"] = nil # enumerator.bundle
38
+ DL_EXTENSIONS.each do |dl_ext|
39
+ acc["#{base}#{dl_ext}"] = nil # enumerator.bundle
40
40
  end
41
41
  end
42
42
 
@@ -152,7 +152,7 @@ module Bootsnap
152
152
 
153
153
  def unshift_paths_locked(*paths)
154
154
  @store.transaction do
155
- paths.map(&:to_s).reverse.each do |path|
155
+ paths.map(&:to_s).reverse_each do |path|
156
156
  p = Path.new(path)
157
157
  next if p.non_directory?
158
158
  entries, dirs = p.entries_and_dirs(@store)
@@ -1,10 +1,18 @@
1
- require_relative '../load_path_cache'
1
+ require_relative '../explicit_require'
2
2
 
3
3
  module Bootsnap
4
4
  module LoadPathCache
5
5
  module PathScanner
6
- REQUIRABLES_AND_DIRS = "/**/*{#{DOT_RB},#{DL_EXTENSIONS.join(',')},/}"
7
- IS_DIR = %r{(.*)/\z}
6
+ # Glob pattern to find requirable files and subdirectories in given path.
7
+ # It expands to:
8
+ #
9
+ # * `/*{.rb,.so,/}` - It matches requirable files, directories and
10
+ # symlinks to directories at given path.
11
+ # * `/*/**/*{.rb,.so,/}` - It matches requirable files and
12
+ # subdirectories in any (even symlinked) directory at given path at
13
+ # any directory tree depth.
14
+ #
15
+ REQUIRABLES_AND_DIRS = "/{,*/**/}*{#{DOT_RB},#{DL_EXTENSIONS.join(',')},/}"
8
16
  NORMALIZE_NATIVE_EXTENSIONS = !DL_EXTENSIONS.include?(LoadPathCache::DOT_SO)
9
17
  ALTERNATIVE_NATIVE_EXTENSIONS_PATTERN = /\.(o|bundle|dylib)\z/
10
18
  BUNDLE_PATH = (Bundler.bundle_path.cleanpath.to_s << LoadPathCache::SLASH).freeze
@@ -29,12 +37,13 @@ module Bootsnap
29
37
  next if contains_bundle_path && absolute_path.start_with?(BUNDLE_PATH)
30
38
  relative_path = absolute_path.slice!(relative_slice)
31
39
 
32
- if md = relative_path.match(IS_DIR)
33
- dirs << md[1]
40
+ if relative_path.end_with?('/')
41
+ dirs << relative_path[0..-2]
34
42
  else
35
43
  requirables << relative_path
36
44
  end
37
45
  end
46
+
38
47
  [requirables, dirs]
39
48
  end
40
49
  end
@@ -11,6 +11,8 @@ module Bootsnap
11
11
 
12
12
  def initialize(store_path)
13
13
  @store_path = store_path
14
+ @in_txn = false
15
+ @dirty = false
14
16
  load_data
15
17
  end
16
18
 
@@ -1,3 +1,3 @@
1
1
  module Bootsnap
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
- description: wip.
97
+ description: Boot large ruby/rails apps faster
98
98
  email:
99
99
  - burke.libbey@shopify.com
100
100
  executables: []
@@ -154,8 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.6.10
157
+ rubygems_version: 2.6.13
158
158
  signing_key:
159
159
  specification_version: 4
160
- summary: wip
160
+ summary: Boot large ruby/rails apps faster
161
161
  test_files: []