bootsnap 1.4.5 → 1.4.6

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
  SHA256:
3
- metadata.gz: be54a60d54f32f824d5c2fdccf189cdcb5409d1848c55f6e654fe44ace1d3f21
4
- data.tar.gz: c6239c30984a936b76e218c2b1292a7e72d817d3e4847a6c58f0121c1e3068dc
3
+ metadata.gz: 2d4f38db9a609c2adb0a0ede991bd993dff7ae59885cb1722eb699658211fd96
4
+ data.tar.gz: 9f363c21a154e123693f18e48073451c6cfe6c05ec378c980e6ef770f01e658c
5
5
  SHA512:
6
- metadata.gz: c251990457406cd51726eec8d62e0e1028bbeade6e24f266cb743d6f00f53650841beed9ee8e1795c78febd18ea234691125920c16aa5a95031718a28619bb31
7
- data.tar.gz: 554a885bf2264f088618c41864fb84069d0664b35af0ae4b619c8fbb1cf285c80fad564d36845161f8044c35c6b53a33e66f27eb75c6715f25869af2795c97f6
6
+ metadata.gz: 925f595e21911c61ff7cf3a86cb055d25e56bb65a8a6437c513f25bfea3aec6c086259808b5aed3289e5d82f66706f98314f31d2ff3886d85edeb47085d6a918
7
+ data.tar.gz: 31507ba8393d47361f8332064a9a39220392a4242e1f3f3c3a88c4de032b51eb8aab8d3769869fec7f9da55400ce773c42aecc52604d5293c9ff7ea3f9f40e54
@@ -5,7 +5,7 @@ AllCops:
5
5
  Exclude:
6
6
  - 'vendor/**/*'
7
7
  - 'tmp/**/*'
8
- TargetRubyVersion: '2.2'
8
+ TargetRubyVersion: '2.3'
9
9
 
10
10
  # This doesn't take into account retrying from an exception
11
11
  Lint/HandleExceptions:
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  # Specify your gem's dependencies in bootsnap.gemspec
@@ -152,7 +152,7 @@ close n
152
152
  Bootsnap は、64バイトのヘッダーとそれに続くキャッシュの内容を含んだキャッシュファイルを書き込みます。ヘッダーは、次のいくつかのフィールドで構成されるキャッシュキーです。
153
153
 
154
154
  - `version`、Bootsnapにハードコードされる基本的なスキーマのバージョン
155
- - `os_version`、(macOS, BSDの) 現在のカーネルバージョンか (Linuxの) glibc のバージョンのハッシュ
155
+ - `ruby_platform`、`RUBY_PLATFORM`(x86_64-linux-gnuなど)変数とglibcバージョン(Linuxの場合)またはOSバージョン(BSD、macOSの場合は` uname -v`)のハッシュ
156
156
  - `compile_option`、`RubyVM::InstructionSequence.compile_option` の返り値
157
157
  - `ruby_revision`、コンパイルされたRubyのバージョン
158
158
  - `size`、ソースファイルのサイズ
data/README.md CHANGED
@@ -214,7 +214,7 @@ Bootsnap writes a cache file containing a 64 byte header followed by the cache c
214
214
  is a cache key including several fields:
215
215
 
216
216
  * `version`, hardcoded in bootsnap. Essentially a schema version;
217
- * `os_version`, A hash of the current kernel version (on macOS, BSD) or glibc version (on Linux);
217
+ * `ruby_platform`, A hash of `RUBY_PLATFORM` (e.g. x86_64-linux-gnu) variable and glibc version (on Linux) or OS version (`uname -v` on BSD, macOS)
218
218
  * `compile_option`, which changes with `RubyVM::InstructionSequence.compile_option` does;
219
219
  * `ruby_revision`, the version of Ruby this was compiled with;
220
220
  * `size`, the size of the source file;
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require('rake/extensiontask')
2
3
  require('bundler/gem_tasks')
3
4
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require("bundler/setup")
4
5
  require("bootsnap")
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require('bootsnap/version')
@@ -26,7 +27,7 @@ Gem::Specification.new do |spec|
26
27
  end
27
28
  spec.require_paths = %w(lib)
28
29
 
29
- spec.required_ruby_version = '>= 2.0.0'
30
+ spec.required_ruby_version = '>= 2.3.0'
30
31
 
31
32
  if RUBY_PLATFORM =~ /java/
32
33
  spec.platform = 'java'
@@ -21,6 +21,9 @@
21
21
  #ifndef _WIN32
22
22
  #include <sys/utsname.h>
23
23
  #endif
24
+ #ifdef __GLIBC__
25
+ #include <gnu/libc-version.h>
26
+ #endif
24
27
 
25
28
  /* 1000 is an arbitrary limit; FNV64 plus some slashes brings the cap down to
26
29
  * 981 for the cache dir */
@@ -90,12 +93,12 @@ static VALUE bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handl
90
93
 
91
94
  /* Helpers */
92
95
  static uint64_t fnv1a_64(const char *str);
93
- static void bs_cache_path(const char * cachedir, const char * path, char ** cache_path);
96
+ static void bs_cache_path(const char * cachedir, const char * path, char (* cache_path)[MAX_CACHEPATH_SIZE]);
94
97
  static int bs_read_key(int fd, struct bs_cache_key * key);
95
98
  static int cache_key_equal(struct bs_cache_key * k1, struct bs_cache_key * k2);
96
99
  static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler);
97
- static int open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenance);
98
- static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, char ** errno_provenance);
100
+ static int open_current_file(char * path, struct bs_cache_key * key, const char ** errno_provenance);
101
+ static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, const char ** errno_provenance);
99
102
  static uint32_t get_ruby_revision(void);
100
103
  static uint32_t get_ruby_platform(void);
101
104
 
@@ -236,6 +239,9 @@ get_ruby_platform(void)
236
239
 
237
240
  #ifdef _WIN32
238
241
  return (uint32_t)(hash >> 32) ^ (uint32_t)GetVersion();
242
+ #elif defined(__GLIBC__)
243
+ hash = fnv1a_64_iter(hash, gnu_get_libc_version());
244
+ return (uint32_t)(hash >> 32);
239
245
  #else
240
246
  struct utsname utsname;
241
247
 
@@ -256,7 +262,7 @@ get_ruby_platform(void)
256
262
  * The path will look something like: <cachedir>/12/34567890abcdef
257
263
  */
258
264
  static void
259
- bs_cache_path(const char * cachedir, const char * path, char ** cache_path)
265
+ bs_cache_path(const char * cachedir, const char * path, char (* cache_path)[MAX_CACHEPATH_SIZE])
260
266
  {
261
267
  uint64_t hash = fnv1a_64(path);
262
268
 
@@ -308,10 +314,8 @@ bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler)
308
314
  char * path = RSTRING_PTR(path_v);
309
315
  char cache_path[MAX_CACHEPATH_SIZE];
310
316
 
311
- { /* generate cache path to cache_path */
312
- char * tmp = (char *)&cache_path;
313
- bs_cache_path(cachedir, path, &tmp);
314
- }
317
+ /* generate cache path to cache_path */
318
+ bs_cache_path(cachedir, path, &cache_path);
315
319
 
316
320
  return bs_fetch(path, path_v, cache_path, handler);
317
321
  }
@@ -321,14 +325,14 @@ bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler)
321
325
  * was loaded.
322
326
  */
323
327
  static int
324
- open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenance)
328
+ open_current_file(char * path, struct bs_cache_key * key, const char ** errno_provenance)
325
329
  {
326
330
  struct stat statbuf;
327
331
  int fd;
328
332
 
329
333
  fd = open(path, O_RDONLY);
330
334
  if (fd < 0) {
331
- *errno_provenance = (char *)"bs_fetch:open_current_file:open";
335
+ *errno_provenance = "bs_fetch:open_current_file:open";
332
336
  return fd;
333
337
  }
334
338
  #ifdef _WIN32
@@ -336,7 +340,7 @@ open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenan
336
340
  #endif
337
341
 
338
342
  if (fstat(fd, &statbuf) < 0) {
339
- *errno_provenance = (char *)"bs_fetch:open_current_file:fstat";
343
+ *errno_provenance = "bs_fetch:open_current_file:fstat";
340
344
  close(fd);
341
345
  return -1;
342
346
  }
@@ -382,13 +386,13 @@ bs_read_key(int fd, struct bs_cache_key * key)
382
386
  * - ERROR_WITH_ERRNO (-1, errno is set)
383
387
  */
384
388
  static int
385
- open_cache_file(const char * path, struct bs_cache_key * key, char ** errno_provenance)
389
+ open_cache_file(const char * path, struct bs_cache_key * key, const char ** errno_provenance)
386
390
  {
387
391
  int fd, res;
388
392
 
389
393
  fd = open(path, O_RDONLY);
390
394
  if (fd < 0) {
391
- *errno_provenance = (char *)"bs_fetch:open_cache_file:open";
395
+ *errno_provenance = "bs_fetch:open_cache_file:open";
392
396
  if (errno == ENOENT) return CACHE_MISSING_OR_INVALID;
393
397
  return ERROR_WITH_ERRNO;
394
398
  }
@@ -398,7 +402,7 @@ open_cache_file(const char * path, struct bs_cache_key * key, char ** errno_prov
398
402
 
399
403
  res = bs_read_key(fd, key);
400
404
  if (res < 0) {
401
- *errno_provenance = (char *)"bs_fetch:open_cache_file:read";
405
+ *errno_provenance = "bs_fetch:open_cache_file:read";
402
406
  close(fd);
403
407
  return res;
404
408
  }
@@ -422,7 +426,7 @@ open_cache_file(const char * path, struct bs_cache_key * key, char ** errno_prov
422
426
  * or exception, will be the final data returnable to the user.
423
427
  */
424
428
  static int
425
- fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, char ** errno_provenance)
429
+ fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, const char ** errno_provenance)
426
430
  {
427
431
  char * data = NULL;
428
432
  ssize_t nread;
@@ -431,7 +435,7 @@ fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data,
431
435
  VALUE storage_data;
432
436
 
433
437
  if (data_size > 100000000000) {
434
- *errno_provenance = (char *)"bs_fetch:fetch_cached_data:datasize";
438
+ *errno_provenance = "bs_fetch:fetch_cached_data:datasize";
435
439
  errno = EINVAL; /* because wtf? */
436
440
  ret = -1;
437
441
  goto done;
@@ -439,7 +443,7 @@ fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data,
439
443
  data = ALLOC_N(char, data_size);
440
444
  nread = read(fd, data, data_size);
441
445
  if (nread < 0) {
442
- *errno_provenance = (char *)"bs_fetch:fetch_cached_data:read";
446
+ *errno_provenance = "bs_fetch:fetch_cached_data:read";
443
447
  ret = -1;
444
448
  goto done;
445
449
  }
@@ -491,7 +495,7 @@ mkpath(char * file_path, mode_t mode)
491
495
  * path.
492
496
  */
493
497
  static int
494
- atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char ** errno_provenance)
498
+ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, const char ** errno_provenance)
495
499
  {
496
500
  char template[MAX_CACHEPATH_SIZE + 20];
497
501
  char * tmp_path;
@@ -505,12 +509,12 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
505
509
  fd = mkstemp(tmp_path);
506
510
  if (fd < 0) {
507
511
  if (mkpath(tmp_path, 0775) < 0) {
508
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:mkpath";
512
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:mkpath";
509
513
  return -1;
510
514
  }
511
515
  fd = open(tmp_path, O_WRONLY | O_CREAT, 0664);
512
516
  if (fd < 0) {
513
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:open";
517
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:open";
514
518
  return -1;
515
519
  }
516
520
  }
@@ -521,11 +525,11 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
521
525
  key->data_size = RSTRING_LEN(data);
522
526
  nwrite = write(fd, key, KEY_SIZE);
523
527
  if (nwrite < 0) {
524
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:write";
528
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:write";
525
529
  return -1;
526
530
  }
527
531
  if (nwrite != KEY_SIZE) {
528
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:keysize";
532
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:keysize";
529
533
  errno = EIO; /* Lies but whatever */
530
534
  return -1;
531
535
  }
@@ -533,7 +537,7 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
533
537
  nwrite = write(fd, RSTRING_PTR(data), RSTRING_LEN(data));
534
538
  if (nwrite < 0) return -1;
535
539
  if (nwrite != RSTRING_LEN(data)) {
536
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:writelength";
540
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:writelength";
537
541
  errno = EIO; /* Lies but whatever */
538
542
  return -1;
539
543
  }
@@ -541,12 +545,12 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
541
545
  close(fd);
542
546
  ret = rename(tmp_path, path);
543
547
  if (ret < 0) {
544
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:rename";
548
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:rename";
545
549
  return -1;
546
550
  }
547
551
  ret = chmod(path, 0664 & ~current_umask);
548
552
  if (ret < 0) {
549
- *errno_provenance = (char *)"bs_fetch:atomic_write_cache_file:chmod";
553
+ *errno_provenance = "bs_fetch:atomic_write_cache_file:chmod";
550
554
  }
551
555
  return ret;
552
556
  }
@@ -555,13 +559,13 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
555
559
  /* Read contents from an fd, whose contents are asserted to be +size+ bytes
556
560
  * long, into a buffer */
557
561
  static ssize_t
558
- bs_read_contents(int fd, size_t size, char ** contents, char ** errno_provenance)
562
+ bs_read_contents(int fd, size_t size, char ** contents, const char ** errno_provenance)
559
563
  {
560
564
  ssize_t nread;
561
565
  *contents = ALLOC_N(char, size);
562
566
  nread = read(fd, *contents, size);
563
567
  if (nread < 0) {
564
- *errno_provenance = (char *)"bs_fetch:bs_read_contents:read";
568
+ *errno_provenance = "bs_fetch:bs_read_contents:read";
565
569
  }
566
570
  return nread;
567
571
  }
@@ -617,7 +621,7 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler)
617
621
  char * contents = NULL;
618
622
  int cache_fd = -1, current_fd = -1;
619
623
  int res, valid_cache = 0, exception_tag = 0;
620
- char * errno_provenance = NULL;
624
+ const char * errno_provenance = NULL;
621
625
 
622
626
  VALUE input_data; /* data read from source file, e.g. YAML or ruby source */
623
627
  VALUE storage_data; /* compiled data, e.g. msgpack / binary iseq */
@@ -685,7 +689,7 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler)
685
689
  * using input_to_output */
686
690
  if (NIL_P(output_data)) {
687
691
  if (unlink(cache_path) < 0) {
688
- errno_provenance = (char *)"bs_fetch:unlink";
692
+ errno_provenance = "bs_fetch:unlink";
689
693
  goto fail_errno;
690
694
  }
691
695
  bs_input_to_output(handler, input_data, &output_data, &exception_tag);
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require("mkmf")
2
3
  $CFLAGS << ' -O3 '
3
4
  $CFLAGS << ' -std=c99'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative('bootsnap/version')
2
3
  require_relative('bootsnap/bundler')
3
4
  require_relative('bootsnap/load_path_cache')
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
3
  extend(self)
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
3
  module CompileCache
3
4
  Error = Class.new(StandardError)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require('bootsnap/bootsnap')
2
3
  require('zlib')
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require('bootsnap/bootsnap')
2
3
 
3
4
  module Bootsnap
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
3
  module ExplicitRequire
3
4
  ARCHDIR = RbConfig::CONFIG['archdir']
@@ -67,7 +67,7 @@ module Bootsnap
67
67
  # native dynamic extension, e.g. .bundle or .so), we know it was a
68
68
  # failure and there's nothing more we can do to find the file.
69
69
  # no extension, .rb, (.bundle or .so)
70
- when '', *CACHED_EXTENSIONS # rubocop:disable Performance/CaseWhenSplat
70
+ when '', *CACHED_EXTENSIONS
71
71
  nil
72
72
  # Ruby allows specifying native extensions as '.so' even when DLEXT
73
73
  # is '.bundle'. This is where we handle that case.
@@ -144,7 +144,7 @@ module Bootsnap
144
144
  expanded_path = p.expanded_path
145
145
  entries, dirs = p.entries_and_dirs(@store)
146
146
  # push -> low precedence -> set only if unset
147
- dirs.each { |dir| @dirs[dir] ||= path }
147
+ dirs.each { |dir| @dirs[dir] ||= path }
148
148
  entries.each { |rel| @index[rel] ||= expanded_path }
149
149
  end
150
150
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
3
  module LoadPathCache
3
4
  module ChangeObserver
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
3
  module LoadPathCache
3
4
  module CoreExt
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
3
  module LoadPathCache
3
4
  module CoreExt
4
5
  def self.make_load_error(path)
5
- err = LoadError.new("cannot load such file -- #{path}")
6
+ err = LoadError.new(+"cannot load such file -- #{path}")
6
7
  err.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
7
8
  err.define_singleton_method(:path) { path }
8
9
  err
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  class << $LOADED_FEATURES
2
3
  alias_method(:delete_without_bootsnap, :delete)
3
4
  def delete(key)
@@ -40,7 +40,7 @@ module Bootsnap
40
40
  # /a/b/lib/my/foo.rb
41
41
  # ^^^^^^^^^
42
42
  short = feat[(lpe.length + 1)..-1]
43
- stripped = strip_extension(short)
43
+ stripped = strip_extension_if_elidable(short)
44
44
  @lfi[short] = hash
45
45
  @lfi[stripped] = hash
46
46
  end
@@ -94,13 +94,14 @@ module Bootsnap
94
94
 
95
95
  hash = long.hash
96
96
 
97
- # do we have 'bundler' or 'bundler.rb'?
98
- altname = if File.extname(short) != ''
99
- # strip the path from 'bundler.rb' -> 'bundler'
100
- strip_extension(short)
97
+ # Do we have a filename with an elidable extension, e.g.,
98
+ # 'bundler.rb', or 'libgit2.so'?
99
+ altname = if extension_elidable?(short)
100
+ # Strip the extension off, e.g. 'bundler.rb' -> 'bundler'.
101
+ strip_extension_if_elidable(short)
101
102
  elsif long && (ext = File.extname(long))
102
- # get the extension from the expanded path if given
103
- # 'bundler' + '.rb'
103
+ # We already know the extension of the actual file this
104
+ # resolves to, so put that back on.
104
105
  short + ext
105
106
  end
106
107
 
@@ -117,8 +118,30 @@ module Bootsnap
117
118
  STRIP_EXTENSION = /\.[^.]*?$/
118
119
  private_constant(:STRIP_EXTENSION)
119
120
 
120
- def strip_extension(f)
121
- f.sub(STRIP_EXTENSION, '')
121
+ # Might Ruby automatically search for this extension if
122
+ # someone tries to 'require' the file without it? E.g. Ruby
123
+ # will implicitly try 'x.rb' if you ask for 'x'.
124
+ #
125
+ # This is complex and platform-dependent, and the Ruby docs are a little
126
+ # handwavy about what will be tried when and in what order.
127
+ # So optimistically pretend that all known elidable extensions
128
+ # will be tried on all platforms, and that people are unlikely
129
+ # to name files in a way that assumes otherwise.
130
+ # (E.g. It's unlikely that someone will know that their code
131
+ # will _never_ run on MacOS, and therefore think they can get away
132
+ # with callling a Ruby file 'x.dylib.rb' and then requiring it as 'x.dylib'.)
133
+ #
134
+ # See <https://ruby-doc.org/core-2.6.4/Kernel.html#method-i-require>.
135
+ def extension_elidable?(f)
136
+ f.to_s.end_with?('.rb', '.so', '.o', '.dll', '.dylib')
137
+ end
138
+
139
+ def strip_extension_if_elidable(f)
140
+ if extension_elidable?(f)
141
+ f.sub(STRIP_EXTENSION, '')
142
+ else
143
+ f
144
+ end
122
145
  end
123
146
  end
124
147
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative('path_scanner')
2
3
 
3
4
  module Bootsnap
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative('../explicit_require')
2
3
 
3
4
  Bootsnap::ExplicitRequire.with_gems('msgpack') { require('msgpack') }
@@ -63,11 +64,11 @@ module Bootsnap
63
64
  def load_data
64
65
  @data = begin
65
66
  MessagePack.load(File.binread(@store_path))
66
- # handle malformed data due to upgrade incompatability
67
- rescue Errno::ENOENT, MessagePack::MalformedFormatError, MessagePack::UnknownExtTypeError, EOFError
68
- {}
69
- rescue ArgumentError => e
70
- e.message =~ /negative array size/ ? {} : raise
67
+ # handle malformed data due to upgrade incompatability
68
+ rescue Errno::ENOENT, MessagePack::MalformedFormatError, MessagePack::UnknownExtTypeError, EOFError
69
+ {}
70
+ rescue ArgumentError => e
71
+ e.message =~ /negative array size/ ? {} : raise
71
72
  end
72
73
  end
73
74
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require_relative('../bootsnap')
2
3
 
3
4
  env = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['ENV']
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Bootsnap
2
- VERSION = "1.4.5"
3
+ VERSION = "1.4.6"
3
4
  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.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-28 00:00:00.000000000 Z
11
+ date: 2020-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,14 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
- version: 2.0.0
163
+ version: 2.3.0
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.0.2
170
+ rubygems_version: 3.0.6
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Boot large ruby/rails apps faster