opal-zeitwerk 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/opal/zeitwerk/version.rb +1 -1
- data/opal/zeitwerk/loader.rb +10 -8
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f36dc7ffdf5a8199541d6d58709708f90df671da0449a06c5bfe7f43458bab9
|
4
|
+
data.tar.gz: 784fba6401a4cde561a8a8d9ae6496a8eb6939466743b184733e1b3d2f15e2c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae630487a822d6ff132420d7909e696dccf7973638979085ad72de3a8ef8f77b0979c7880b1316809258be029922d3152b688cc2efa1d8c5e1ba913aaa95a2ef
|
7
|
+
data.tar.gz: c4e45ae2cea7800faa76bf52d1bb56737792113b8211b41518ecfe53713b445badc264495b7d52dab11b6a89ee33497fddd2a666e449a10b9f1f19ba9bd05420
|
data/README.md
CHANGED
@@ -169,6 +169,7 @@ should define `Geolocatable`, not `Concerns::Geolocatable`.
|
|
169
169
|
|
170
170
|
Add to the Gemfile:
|
171
171
|
```
|
172
|
+
gem 'opal', github: 'janbiedermann/opal', branch: 'es6_modules_1_1' # required
|
172
173
|
gem 'opal-zeitwerk', '~> 0.0.1'
|
173
174
|
```
|
174
175
|
|
@@ -179,6 +180,16 @@ require 'zeitwerk'
|
|
179
180
|
|
180
181
|
<a id="markdown-setup" name="setup"></a>
|
181
182
|
### Setup
|
183
|
+
Files must be included in the compiled asset by:
|
184
|
+
```
|
185
|
+
require_tree 'some_dir', :autoload
|
186
|
+
```
|
187
|
+
And added to the loader by:
|
188
|
+
```
|
189
|
+
loader.push_dir('some_dir')
|
190
|
+
```
|
191
|
+
The loader here requires the part of the path as it would appear in Opal.modules.
|
192
|
+
If `require_tree` is called from a sub directory, the path from the root as it would appear in Opal.modules has to be prepended for push_dir.
|
182
193
|
|
183
194
|
Loaders are ready to load code right after calling `setup` on them:
|
184
195
|
|
data/opal/zeitwerk/loader.rb
CHANGED
@@ -131,7 +131,7 @@ module Zeitwerk
|
|
131
131
|
@to_unload = {}
|
132
132
|
@lazy_subdirs = {}
|
133
133
|
@eager_load_exclusions = Set.new
|
134
|
-
|
134
|
+
|
135
135
|
@setup = false
|
136
136
|
@eager_loaded = false
|
137
137
|
|
@@ -621,10 +621,12 @@ module Zeitwerk
|
|
621
621
|
# `console.log("dir:", dir)`
|
622
622
|
outer_ls = false
|
623
623
|
# cache the Opal.modules keys array for subsequent ls calls during setup
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
624
|
+
%x{
|
625
|
+
if (#@module_paths === nil) {
|
626
|
+
#@module_paths = Object.keys(Opal.modules);
|
627
|
+
outer_ls = true;
|
628
|
+
}
|
629
|
+
}
|
628
630
|
visited_abspaths = `{}`
|
629
631
|
dir_first_char = dir[0]
|
630
632
|
path_start = dir.size + 1
|
@@ -645,9 +647,9 @@ module Zeitwerk
|
|
645
647
|
}
|
646
648
|
end
|
647
649
|
# remove cache, because Opal.modules may change after setup
|
648
|
-
|
649
|
-
|
650
|
-
|
650
|
+
%x{
|
651
|
+
if (outer_ls) { #@module_paths = nil }
|
652
|
+
}
|
651
653
|
end
|
652
654
|
|
653
655
|
# @param path [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-zeitwerk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -51,7 +51,9 @@ homepage: https://github.com/isomorfeus/opal-zeitwerk
|
|
51
51
|
licenses:
|
52
52
|
- MIT
|
53
53
|
metadata: {}
|
54
|
-
post_install_message:
|
54
|
+
post_install_message: "\nopal-zeitwerk 0.0.3:\n \n opal-zeitwerk currently requires
|
55
|
+
the es6_modules_1_1 branch of opal, for the Gemfile:\n\n gem 'opal', github: 'janbiedermann/opal',
|
56
|
+
branch: 'es6_modules_1_1'\n\n"
|
55
57
|
rdoc_options: []
|
56
58
|
require_paths:
|
57
59
|
- lib
|