bootsnap 1.1.7 → 1.1.8

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: 58c56b006431cac3c1cf8a8c8c542f76ec6cd7dd
4
- data.tar.gz: b71fd217b2aded27b42d582d6a123a80bd6c8747
3
+ metadata.gz: a6f66d96dbadca08e5c50985c45319350f1e85ca
4
+ data.tar.gz: c1227f8f8c6ed542abe582c221ccf45318655e87
5
5
  SHA512:
6
- metadata.gz: 43ce6810dfe1626cb8e9b6213ee197c26123fb98bfd7aaa42b5795a7133349002e86037cea64b94bdf7d1cdc45d42671285ae21693e4c0d25962d5e1dc5b133f
7
- data.tar.gz: 22545b119efedef68895f61b3f403b6eedb8e6f4a7152da99fed09d430df7bc7125f1d81d5db9ebb45919958c5a215c5968efc34202aa708d7b8349fdb232768
6
+ metadata.gz: fa366476bf324d6eda9415e7170d67e31eb4a01d08758ff51d9e83c7661db8160cfa334ef9df67777ef059887de24a3f8a7da49b1675f3a1b0bf7704ecf42620
7
+ data.tar.gz: '06758fb4f8445d041816330983799684a3b79e6ec82ac1e21cf087544d377744b0bb8bc20012146d529876fac6398e1053821eea2468be60c8194c6c07855312'
@@ -1,3 +1,8 @@
1
+ # 1.1.8
2
+
3
+ * Don't cache YAML documents with `!ruby/object`
4
+ * Fix cache write mode on Windows
5
+
1
6
  # 1.1.7
2
7
 
3
8
  * Create cache entries as 0775/0664 instead of 0755/0644
data/README.md CHANGED
@@ -18,13 +18,15 @@ Add `bootsnap` to your `Gemfile`:
18
18
  gem 'bootsnap', require: false
19
19
  ```
20
20
 
21
- If you are using rails, add this to `config/boot.rb` immediately after `require 'bundler/setup'`:
21
+ If you are using Rails, add this to `config/boot.rb` immediately after `require 'bundler/setup'`:
22
22
 
23
23
  ```ruby
24
24
  require 'bootsnap/setup'
25
25
  ```
26
26
 
27
- If you are not using rails, or if you are but want more control over things, add this to your
27
+ You can see how this require works [here](https://github.com/Shopify/bootsnap/blob/master/lib/bootsnap/setup.rb).
28
+
29
+ If you are not using Rails, or if you are but want more control over things, add this to your
28
30
  application setup immediately after `require 'bundler/setup'` (i.e. as early as possible: the sooner
29
31
  this is loaded, the sooner it can start optimizing things)
30
32
 
@@ -49,7 +51,13 @@ will help optimize boot time further if you have an extremely large `$LOAD_PATH`
49
51
  Note: Bootsnap and [Spring](https://github.com/rails/spring) are orthogonal tools. While Bootsnap
50
52
  speeds up the loading of individual source files, Spring keeps a copy of a pre-booted Rails process
51
53
  on hand to completely skip parts of the boot process the next time it's needed. The two tools work
52
- well together, and are both included in a newly-generated Rails applications by default.
54
+ well together, and are both included in a newly-generated Rails applications by default.
55
+
56
+ ### Environments
57
+
58
+ All Bootsnap features are enabled in development, test, production, and all other environments according to the configuration in the setup. At Shopify, we use this gem safely in all environments without issue.
59
+
60
+ If you would like to disable any feature for a certain environment, we suggest changing the configuration to take into account the appropriate ENV var or configuration according to your needs.
53
61
 
54
62
  ## How does this work?
55
63
 
@@ -8,6 +8,7 @@ module Bootsnap
8
8
  end
9
9
 
10
10
  def self.input_to_storage(contents, _)
11
+ raise Uncompilable if contents.index("!ruby/object")
11
12
  obj = ::YAML.load(contents)
12
13
  msgpack_factory.packer.write(obj).to_s
13
14
  rescue NoMethodError, RangeError
@@ -72,7 +72,9 @@ module Bootsnap
72
72
  tmp = "#{@store_path}.#{Process.pid}.#{(rand * 100000).to_i}.tmp"
73
73
  FileUtils.mkpath(File.dirname(tmp))
74
74
  exclusive_write = File::Constants::CREAT | File::Constants::EXCL | File::Constants::WRONLY
75
- File.binwrite(tmp, MessagePack.dump(@data), mode: exclusive_write)
75
+ # `encoding:` looks redundant wrt `binwrite`, but necessary on windows
76
+ # because binary is part of mode.
77
+ File.binwrite(tmp, MessagePack.dump(@data), mode: exclusive_write, encoding: Encoding::BINARY)
76
78
  FileUtils.mv(tmp, @store_path)
77
79
  rescue Errno::EEXIST
78
80
  retry
@@ -1,3 +1,3 @@
1
1
  module Bootsnap
2
- VERSION = "1.1.7"
2
+ VERSION = "1.1.8"
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.7
4
+ version: 1.1.8
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-12-13 00:00:00.000000000 Z
11
+ date: 2018-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler