hyperloop-config 0.9.1 → 0.9.2
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/hyperloop-config.gemspec +1 -1
- data/lib/hyperloop-config.rb +3 -3
- data/lib/hyperloop/client_stubs.rb +3 -3
- data/lib/hyperloop/{requires.rb → imports.rb} +17 -19
- data/lib/hyperloop/rail_tie.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7d761c3c7af9c35b5834489e56fa78ef7a1107b
|
4
|
+
data.tar.gz: 96ff715e58fd5f36f23e2b989de319d166022b21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afc90a2b2247d849e5ab5e9c6bac0acce151b848c6361ca0da8d336a2154b8019439c2552457c3c3a53bb538df754baedc6875fb2f385db83b08ac2ccc4d5afe
|
7
|
+
data.tar.gz: 828c40c24b43d37c924041811a055b5539acf6c1635949946b9bc13099889f6dd7a7609d3697bc780e139ed219b86e3deb541e06d39cff3923a7fb3c753f8611
|
data/hyperloop-config.gemspec
CHANGED
data/lib/hyperloop-config.rb
CHANGED
@@ -4,11 +4,11 @@ if RUBY_ENGINE == 'opal'
|
|
4
4
|
else
|
5
5
|
require 'opal'
|
6
6
|
require 'hyperloop/config_settings'
|
7
|
-
require 'hyperloop/
|
7
|
+
require 'hyperloop/imports'
|
8
8
|
require 'hyperloop/client_readers'
|
9
9
|
require 'hyperloop/on_client'
|
10
10
|
require 'hyperloop/rail_tie' if defined? Rails
|
11
|
-
Hyperloop.
|
12
|
-
Hyperloop.
|
11
|
+
Hyperloop.import 'opal', gem: true
|
12
|
+
Hyperloop.import 'hyperloop-config', gem: true
|
13
13
|
Opal.append_path(File.expand_path('../', __FILE__).untaint)
|
14
14
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Hyperloop
|
2
2
|
class << self
|
3
|
-
def
|
3
|
+
def import(*args)
|
4
4
|
end
|
5
5
|
|
6
|
-
def
|
6
|
+
def imports(*args)
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
9
|
+
def import_tree(*args)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,46 +1,44 @@
|
|
1
1
|
module Hyperloop
|
2
2
|
class << self
|
3
|
-
def
|
4
|
-
@
|
3
|
+
def import_list
|
4
|
+
@import_list ||= []
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
7
|
+
def import(value, gem: nil, instead_of: nil, client_only: nil, server_only: nil, tree: nil)
|
8
8
|
if instead_of
|
9
|
-
current_spec =
|
9
|
+
current_spec = import_list.detect { |old_value, *_rest| instead_of == old_value }
|
10
10
|
if current_spec
|
11
11
|
current_spec[0] = value
|
12
12
|
else
|
13
13
|
raise [
|
14
|
-
"Could not substitute
|
15
|
-
'The following
|
16
|
-
*
|
14
|
+
"Could not substitute import '#{instead_of}' with '#{value}'. '#{instead_of}' not found.",
|
15
|
+
'The following files are currently being imported:',
|
16
|
+
*import_list.collect { |old_value, *_rest| old_value }
|
17
17
|
].join("\n")
|
18
18
|
end
|
19
19
|
else
|
20
|
-
kind = if
|
21
|
-
:gem
|
22
|
-
elsif tree
|
20
|
+
kind = if tree
|
23
21
|
:tree
|
22
|
+
else
|
23
|
+
:gem
|
24
24
|
end
|
25
|
-
|
25
|
+
import_list << [value, !client_only, !server_only, kind]
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
require(nil, instead_of: value)
|
31
|
-
end
|
29
|
+
alias imports import
|
32
30
|
|
33
|
-
def
|
34
|
-
|
31
|
+
def import_tree(value, instead_of: nil, client_only: nil, server_only: nil)
|
32
|
+
import(value, instead_of: instead_of, client_only: client_only, server_only: server_only, tree: true)
|
35
33
|
end
|
36
34
|
|
37
|
-
def
|
38
|
-
|
35
|
+
def cancel_import(value)
|
36
|
+
import(nil, instead_of: value)
|
39
37
|
end
|
40
38
|
|
41
39
|
def generate_requires(mode, file)
|
42
40
|
puts "***** generating requires for #{mode} - #{file}"
|
43
|
-
|
41
|
+
import_list.collect do |value, render_on_server, render_on_client, kind|
|
44
42
|
next unless value
|
45
43
|
next if mode == :client && !render_on_client
|
46
44
|
next if mode == :server && !render_on_server
|
data/lib/hyperloop/rail_tie.rb
CHANGED
@@ -45,7 +45,7 @@ module Hyperloop
|
|
45
45
|
|
46
46
|
config.after_initialize do |app|
|
47
47
|
next unless config.hyperloop.auto_config
|
48
|
-
Hyperloop.
|
48
|
+
Hyperloop.import_tree('hyperloop')
|
49
49
|
next unless config.respond_to?(:react)
|
50
50
|
if (opts = config.react.server_renderer_options)
|
51
51
|
opts.merge! FILES
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperloop-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- catmando
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -185,9 +185,9 @@ files:
|
|
185
185
|
- lib/hyperloop/client_readers.rb
|
186
186
|
- lib/hyperloop/client_stubs.rb
|
187
187
|
- lib/hyperloop/config_settings.rb
|
188
|
+
- lib/hyperloop/imports.rb
|
188
189
|
- lib/hyperloop/on_client.rb
|
189
190
|
- lib/hyperloop/rail_tie.rb
|
190
|
-
- lib/hyperloop/requires.rb
|
191
191
|
homepage: http://ruby-hyperloop.io
|
192
192
|
licenses:
|
193
193
|
- MIT
|