Class: Klenod::Build::Config
- Inherits:
-
Data
- Object
- Data
- Klenod::Build::Config
- Defined in:
- lib/klenod/build/config.rb
Instance Attribute Summary collapse
-
#assets_dir ⇒ Object
readonly
Returns the value of attribute assets_dir.
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#entrypoints ⇒ Object
readonly
Returns the value of attribute entrypoints.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
-
#source_dir ⇒ Object
readonly
Returns the value of attribute source_dir.
Instance Method Summary collapse
- #assets_path ⇒ Object
- #context(**overrides) ⇒ Object
-
#initialize(source_dir: "src", entrypoints: [], output: "dist/klenod.bundle", assets_dir: nil, plugins: Context::DEFAULT_PLUGINS, mode: :development, base_dir: Dir.pwd) ⇒ Config
constructor
A new instance of Config.
- #output_path ⇒ Object
- #source_path ⇒ Object
- #with(**attributes) ⇒ Object
Constructor Details
#initialize(source_dir: "src", entrypoints: [], output: "dist/klenod.bundle", assets_dir: nil, plugins: Context::DEFAULT_PLUGINS, mode: :development, base_dir: Dir.pwd) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/klenod/build/config.rb', line 7 def initialize(source_dir: "src", entrypoints: [], output: "dist/klenod.bundle", assets_dir: nil, plugins: Context::DEFAULT_PLUGINS, mode: :development, base_dir: Dir.pwd) super( source_dir: source_dir, entrypoints: Array(entrypoints), output: output, assets_dir: assets_dir, plugins: plugins, mode: mode, base_dir: base_dir ) end |
Instance Attribute Details
#assets_dir ⇒ Object (readonly)
Returns the value of attribute assets_dir
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def assets_dir @assets_dir end |
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def base_dir @base_dir end |
#entrypoints ⇒ Object (readonly)
Returns the value of attribute entrypoints
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def entrypoints @entrypoints end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def mode @mode end |
#output ⇒ Object (readonly)
Returns the value of attribute output
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def output @output end |
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def plugins @plugins end |
#source_dir ⇒ Object (readonly)
Returns the value of attribute source_dir
5 6 7 |
# File 'lib/klenod/build/config.rb', line 5 def source_dir @source_dir end |
Instance Method Details
#assets_path ⇒ Object
40 41 42 |
# File 'lib/klenod/build/config.rb', line 40 def assets_path assets_dir && (assets_dir) end |
#context(**overrides) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/klenod/build/config.rb', line 23 def context(**overrides) Context.new( source_dir: source_path, plugins: plugins, mode: mode, **overrides ) end |
#output_path ⇒ Object
36 37 38 |
# File 'lib/klenod/build/config.rb', line 36 def output_path (output) end |
#source_path ⇒ Object
32 33 34 |
# File 'lib/klenod/build/config.rb', line 32 def source_path (source_dir) end |
#with(**attributes) ⇒ Object
19 20 21 |
# File 'lib/klenod/build/config.rb', line 19 def with(**attributes) self.class.new(**to_h.merge(attributes)) end |