freezolite 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +14 -33
- data/lib/freezolite/auto.rb +4 -1
- data/lib/freezolite/version.rb +1 -1
- data/lib/freezolite.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bed25358ffb5313cf2816282bc8a2e38516a283d7373987808c17d476962a07
|
4
|
+
data.tar.gz: 70c3a3a89ebbb11d3d8c81f40450124c0edfc20026e3deae1456ecde3bd09812
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c41594c8e976f6df02aa30854ac9dc3dab9b601fe73e648946704d3107b046dee1c2e10a072e1bed5d35b6782e783e45e23a4b43ee0de1606a3c549b8c99605b
|
7
|
+
data.tar.gz: 8739d41c3cca71d36ff559de8e6ce5f25b51208af997ff2555ceaeb088bd47e2a2f404db7fe5f682e6c1699a7940d65a4d6faf205133072e842882a81be22ffa
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.3.0 (2023-07-19)
|
6
|
+
|
7
|
+
- Ignore `./vendor` by default when using `freezolite/auto`. ([@palkan][])
|
8
|
+
|
9
|
+
- Replace `watch_dirs` with `patterns` and `exclude_patterns`. ([@palkan][])
|
10
|
+
|
5
11
|
## 0.2.0 (2023-07-14)
|
6
12
|
|
7
13
|
- Change name from `freeze_the_lits` to `freezolite`. ([@palkan][])
|
data/README.md
CHANGED
@@ -15,10 +15,17 @@ Add the gem to your Gemfile:
|
|
15
15
|
gem "freezolite"
|
16
16
|
```
|
17
17
|
|
18
|
-
And drop the following line to your application
|
18
|
+
And drop the following line to your application entry-point **after loading dependencies** and before loading your application code. For example, in Rails, you can put it to `config/application.rb` after the `Bundler.require(...)` call:
|
19
19
|
|
20
20
|
```ruby
|
21
|
+
# config/application.rb
|
22
|
+
|
23
|
+
#...
|
24
|
+
Bundler.require(*Rails.groups)
|
25
|
+
|
21
26
|
require "freezolite/auto"
|
27
|
+
|
28
|
+
# <application configuration>
|
22
29
|
```
|
23
30
|
|
24
31
|
By default, the gem uses `Dir.pwd` to determine the project root. If you want to use a different directory or multiple directories, configure the gem like this:
|
@@ -27,43 +34,17 @@ By default, the gem uses `Dir.pwd` to determine the project root. If you want to
|
|
27
34
|
require "freezolite"
|
28
35
|
|
29
36
|
Freezolite.setup(
|
30
|
-
|
37
|
+
# You must pass a list of glob patterns
|
38
|
+
patterns: ["/path/to/dir1/*.rb", "/path/to/dir2/*.rb"],
|
39
|
+
exclude_patterns: ["/path/to/dir1/vendor/*"]
|
31
40
|
)
|
32
41
|
```
|
33
42
|
|
34
|
-
|
35
|
-
|
36
|
-
FreezeTheList is compatible with Bootsnap. Just make sure you require it **after** Bootsnap:
|
37
|
-
|
38
|
-
```ruby
|
39
|
-
# config/boot.rb
|
40
|
-
|
41
|
-
require "bootsnap/setup"
|
42
|
-
require "freezolite/auto"
|
43
|
-
require "bundler/setup"
|
44
|
-
```
|
45
|
-
|
46
|
-
### Using in tests
|
43
|
+
**NOTE**: When using auto mode, the `<project-root>/vendor/bundle` folder is excluded automatically. In manual mode, you may want to exclude it yourself.
|
47
44
|
|
48
|
-
|
49
|
-
|
50
|
-
#### RSpec
|
51
|
-
|
52
|
-
Put the following line to `spec_helper.rb`:
|
53
|
-
|
54
|
-
```ruby
|
55
|
-
require "freezolite/auto"
|
56
|
-
```
|
57
|
-
|
58
|
-
Make sure you have `spec_helper.rb` _preloaded_ by RSpec by putting the following to the `.rspec` file:
|
59
|
-
|
60
|
-
```txt
|
61
|
-
--require spec_helper
|
62
|
-
```
|
63
|
-
|
64
|
-
#### Minitest
|
45
|
+
### Using with Bootsnap
|
65
46
|
|
66
|
-
|
47
|
+
Freezolite is compatible with Bootsnap. Just make sure you require it **after** Bootsnap. No manual cache invalidation required.
|
67
48
|
|
68
49
|
### Supported Ruby versions
|
69
50
|
|
data/lib/freezolite/auto.rb
CHANGED
data/lib/freezolite/version.rb
CHANGED
data/lib/freezolite.rb
CHANGED
@@ -4,14 +4,17 @@ require "freezolite/version"
|
|
4
4
|
|
5
5
|
module Freezolite
|
6
6
|
class << self
|
7
|
-
attr_accessor :
|
7
|
+
attr_accessor :patterns, :exclude_patterns
|
8
|
+
|
9
|
+
def setup(patterns:, exclude_patterns: nil)
|
10
|
+
self.patterns = patterns
|
11
|
+
self.exclude_patterns = exclude_patterns
|
8
12
|
|
9
|
-
def setup(watch_dirs:)
|
10
|
-
self.watch_dirs = watch_dirs.freeze
|
11
13
|
require "require-hooks/setup"
|
12
14
|
|
13
15
|
::RequireHooks.around_load do |path, &block|
|
14
|
-
next block.call unless
|
16
|
+
next block.call unless patterns.any? { |pattern| File.fnmatch?(pattern, path) }
|
17
|
+
next block.call if exclude_patterns&.any? { |pattern| File.fnmatch?(pattern, path) }
|
15
18
|
|
16
19
|
begin
|
17
20
|
was_frozen_string_literal = ::RubyVM::InstructionSequence.compile_option[:frozen_string_literal]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freezolite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require-hooks
|