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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f732c8828c572f731b2515c7e4feef8cf1a63ce
4
- data.tar.gz: 40b1671bcfa35dea5db6d2c9185901b831961509
3
+ metadata.gz: c7d761c3c7af9c35b5834489e56fa78ef7a1107b
4
+ data.tar.gz: 96ff715e58fd5f36f23e2b989de319d166022b21
5
5
  SHA512:
6
- metadata.gz: e9ba99620f956083f59a4bd0b1829c341366b5c0f3c7a3e6b69c790ec7f0743e3ccb3348fff5f7b372700f7857068d9ea069802f1ff5cf207ed4c03b0ddaaf54
7
- data.tar.gz: a015d311cd0127c840684fbcb4d9a1b7907becc073ca580a3747162b3e9374ac6837e95f9e1f6a0f67fe1250008f73fb8338156364f9edd3634204a8ffd5d39f
6
+ metadata.gz: afc90a2b2247d849e5ab5e9c6bac0acce151b848c6361ca0da8d336a2154b8019439c2552457c3c3a53bb538df754baedc6875fb2f385db83b08ac2ccc4d5afe
7
+ data.tar.gz: 828c40c24b43d37c924041811a055b5539acf6c1635949946b9bc13099889f6dd7a7609d3697bc780e139ed219b86e3deb541e06d39cff3923a7fb3c753f8611
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "hyperloop-config"
7
- spec.version = "0.9.1"
7
+ spec.version = "0.9.2"
8
8
  spec.authors = ["catmando"]
9
9
  spec.email = ["mitch@catprint.com"]
10
10
 
@@ -4,11 +4,11 @@ if RUBY_ENGINE == 'opal'
4
4
  else
5
5
  require 'opal'
6
6
  require 'hyperloop/config_settings'
7
- require 'hyperloop/requires'
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.require 'opal', gem: true
12
- Hyperloop.require 'hyperloop-config', gem: true
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 require(value, gem: nil, override_with: nil, client_only: nil, tree: nil)
3
+ def import(*args)
4
4
  end
5
5
 
6
- def require_tree(value, override_with: nil, client_only: nil)
6
+ def imports(*args)
7
7
  end
8
8
 
9
- def require_gem(value, override_with: nil, client_only: nil)
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 requires
4
- @requires ||= []
3
+ def import_list
4
+ @import_list ||= []
5
5
  end
6
6
 
7
- def require(value, gem: nil, instead_of: nil, client_only: nil, server_only: nil, tree: nil)
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 = requires.detect { |old_value, *_rest| instead_of == old_value }
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 require '#{instead_of}' with '#{value}'. '#{instead_of}' not found.",
15
- 'The following requires are listed:',
16
- *requires.collect { |old_value, *_rest| old_value }
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 gem
21
- :gem
22
- elsif tree
20
+ kind = if tree
23
21
  :tree
22
+ else
23
+ :gem
24
24
  end
25
- requires << [value, !client_only, !server_only, kind]
25
+ import_list << [value, !client_only, !server_only, kind]
26
26
  end
27
27
  end
28
28
 
29
- def unrequire(value)
30
- require(nil, instead_of: value)
31
- end
29
+ alias imports import
32
30
 
33
- def require_tree(value, instead_of: nil, client_only: nil, server_only: nil)
34
- require(value, instead_of: instead_of, client_only: client_only, server_only: server_only, tree: true)
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 require_gem(value, instead_of: nil, client_only: nil, server_only: nil)
38
- require(value, instead_of: instead_of, client_only: client_only, server_only: server_only, gem: true)
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
- requires.collect do |value, render_on_server, render_on_client, kind|
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
@@ -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.require_tree('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.1
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-13 00:00:00.000000000 Z
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