Class: HanamiSasso::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami-sasso/configuration.rb

Overview

Plugin configuration. Set it from your Rakefile (or a ‘config/sasso.rb` you require) with `HanamiSasso.configure { |c| … }`. Defaults target a stock Hanami 2 layout and compile directly to `public/` (no Node, no esbuild).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/hanami-sasso/configuration.rb', line 10

def initialize
  # { "<input under source_dir>" => "<output under build_dir>" }
  @builds      = { "app.scss" => "app.css" }
  # nil = :compressed in production (HANAMI_ENV=production), :expanded else.
  @style       = nil
  # Extra @use/@import dirs; the entrypoint's own dir is always searched.
  @load_paths  = []
  @source_dir  = "app/assets/css"
  # Compile straight into public/ so the CSS is served with no Node/esbuild
  # step; link it with <link href="/assets/css/app.css">. Point this at
  # "app/assets/css" instead if you'd rather feed Hanami's esbuild pipeline.
  @build_dir   = "public/assets/css"
  # nil = sidecar .map outside production, off in production; true/false force.
  @source_map  = nil
  # nil = the working dir when the task runs (the Hanami app root).
  @root        = nil
end

Instance Attribute Details

#build_dirObject

Returns the value of attribute build_dir.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def build_dir
  @build_dir
end

#buildsObject

Returns the value of attribute builds.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def builds
  @builds
end

#load_pathsObject

Returns the value of attribute load_paths.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def load_paths
  @load_paths
end

#rootObject

Returns the value of attribute root.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def root
  @root
end

#source_dirObject

Returns the value of attribute source_dir.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def source_dir
  @source_dir
end

#source_mapObject

Returns the value of attribute source_map.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def source_map
  @source_map
end

#styleObject

Returns the value of attribute style.



8
9
10
# File 'lib/hanami-sasso/configuration.rb', line 8

def style
  @style
end