Class: Opal::Rails::EntrypointsResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/opal/rails/entrypoints_resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(entrypoints_path:, entrypoints:) ⇒ EntrypointsResolver

Returns a new instance of EntrypointsResolver.



8
9
10
11
# File 'lib/opal/rails/entrypoints_resolver.rb', line 8

def initialize(entrypoints_path:, entrypoints:)
  @entrypoints_path = Pathname(entrypoints_path).expand_path
  @entrypoints = entrypoints
end

Instance Method Details

#resolveObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/opal/rails/entrypoints_resolver.rb', line 13

def resolve
  case entrypoints
  when Hash
    resolve_hash
  when :all
    resolve_all
  else
    raise InvalidEntrypointsConfigError,
          "config.opal.entrypoints must be a Hash or :all, got #{entrypoints.inspect}"
  end
end