Class: Manifester::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/manifester/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_path:, public_root_dir:, public_output_dir:, cache_manifest:, fallback_to_webpacker:) ⇒ Configuration

Returns a new instance of Configuration.



8
9
10
11
12
13
14
# File 'lib/manifester/configuration.rb', line 8

def initialize(root_path:, public_root_dir:, public_output_dir:, cache_manifest:, fallback_to_webpacker:)
  @root_path = root_path
  @public_root_dir = public_root_dir
  @public_output_dir = public_output_dir
  @cache_manifest = cache_manifest
  @fallback_to_webpacker = fallback_to_webpacker
end

Instance Attribute Details

#cache_manifestObject (readonly)

Returns the value of attribute cache_manifest.



5
6
7
# File 'lib/manifester/configuration.rb', line 5

def cache_manifest
  @cache_manifest
end

#fallback_to_webpackerObject (readonly)

Returns the value of attribute fallback_to_webpacker.



6
7
8
# File 'lib/manifester/configuration.rb', line 6

def fallback_to_webpacker
  @fallback_to_webpacker
end

#public_output_dirObject (readonly)

Returns the value of attribute public_output_dir.



4
5
6
# File 'lib/manifester/configuration.rb', line 4

def public_output_dir
  @public_output_dir
end

#public_root_dirObject (readonly)

Returns the value of attribute public_root_dir.



3
4
5
# File 'lib/manifester/configuration.rb', line 3

def public_root_dir
  @public_root_dir
end

#root_pathObject (readonly)

Returns the value of attribute root_path.



2
3
4
# File 'lib/manifester/configuration.rb', line 2

def root_path
  @root_path
end

Instance Method Details

#cache_manifest?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/manifester/configuration.rb', line 28

def cache_manifest?
  @cache_manifest
end

#fallback_to_webpacker?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/manifester/configuration.rb', line 32

def fallback_to_webpacker?
  fallback_to_webpacker.call
end

#public_manifest_pathObject



24
25
26
# File 'lib/manifester/configuration.rb', line 24

def public_manifest_path
  public_output_path.join("manifest.json")
end

#public_output_pathObject



20
21
22
# File 'lib/manifester/configuration.rb', line 20

def public_output_path
  public_path.join(@public_output_dir)
end

#public_pathObject



16
17
18
# File 'lib/manifester/configuration.rb', line 16

def public_path
  root_path.join(@public_root_dir)
end