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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12375dd273e0ad8de57a3743951866692f94b85f8c9b8a3d0913d85fb19e6448
4
- data.tar.gz: b4c8ad57b55115bd275a1006649be4f685db42a3bff85a41ed8a3eabcf88db13
3
+ metadata.gz: 0f36dc7ffdf5a8199541d6d58709708f90df671da0449a06c5bfe7f43458bab9
4
+ data.tar.gz: 784fba6401a4cde561a8a8d9ae6496a8eb6939466743b184733e1b3d2f15e2c2
5
5
  SHA512:
6
- metadata.gz: '012259b3e3b242baa7e372439257c07db34abe59c4b45f1bdd927a9a6cfe91e9084d383f8f16fb356eebff90a7d193b1b2e56ff353b325f71ff87dd24c7da144'
7
- data.tar.gz: 9073faf1c136072053b80d0d531494fd95a885cb4013aff5926dad8f630bac705ce21875e270c15d6131575dbf2d1745dfc064791a7e441e31c0b80eef284d5d
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
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Opal
3
3
  module Zeitwerk
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
@@ -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
- if !@module_paths
625
- @module_paths = `Object.keys(Opal.modules)`
626
- outer_ls = true
627
- end
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
- if outer_ls
649
- @module_paths = nil
650
- end
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.2
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-04 00:00:00.000000000 Z
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