Class: Bashly::Settings

Inherits:
Object
  • Object
show all
Extended by:
AssetHelper
Defined in:
lib/bashly/settings.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from AssetHelper

asset, asset_content

Class Attribute Details

.commands_dirObject



20
21
22
# File 'lib/bashly/settings.rb', line 20

def commands_dir
  @commands_dir ||= get :commands_dir
end

.compact_short_flagsObject



24
25
26
# File 'lib/bashly/settings.rb', line 24

def compact_short_flags
  @compact_short_flags ||= get :compact_short_flags
end

.config_pathObject



32
33
34
# File 'lib/bashly/settings.rb', line 32

def config_path
  @config_path ||= get(:config_path) % { source_dir: source_dir }
end

.conjoined_flag_argsObject



28
29
30
# File 'lib/bashly/settings.rb', line 28

def conjoined_flag_args
  @conjoined_flag_args ||= get :conjoined_flag_args
end

.lib_dirObject



48
49
50
# File 'lib/bashly/settings.rb', line 48

def lib_dir
  @lib_dir ||= get :lib_dir
end

.partials_extensionObject



52
53
54
# File 'lib/bashly/settings.rb', line 52

def partials_extension
  @partials_extension ||= get :partials_extension
end

.source_dirObject



60
61
62
# File 'lib/bashly/settings.rb', line 60

def source_dir
  @source_dir ||= get :source_dir
end

.strictObject



64
65
66
# File 'lib/bashly/settings.rb', line 64

def strict
  @strict ||= get :strict
end

.tab_indentObject



78
79
80
# File 'lib/bashly/settings.rb', line 78

def tab_indent
  @tab_indent ||= get :tab_indent
end

.target_dirObject



82
83
84
# File 'lib/bashly/settings.rb', line 82

def target_dir
  @target_dir ||= get :target_dir
end

.usage_colorsObject



86
87
88
# File 'lib/bashly/settings.rb', line 86

def usage_colors
  @usage_colors ||= get :usage_colors
end

Class Method Details

.envObject



36
37
38
# File 'lib/bashly/settings.rb', line 36

def env
  @env ||= get(:env)&.to_sym
end

.env=(value) ⇒ Object



40
41
42
# File 'lib/bashly/settings.rb', line 40

def env=(value)
  @env = value&.to_sym
end

.full_lib_dirObject



44
45
46
# File 'lib/bashly/settings.rb', line 44

def full_lib_dir
  "#{source_dir}/#{lib_dir}"
end

.production?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/bashly/settings.rb', line 56

def production?
  env == :production
end

.strict_stringObject



68
69
70
71
72
73
74
75
76
# File 'lib/bashly/settings.rb', line 68

def strict_string
  if strict.is_a? String
    strict
  elsif strict
    'set -euo pipefail'
  else
    'set -e'
  end
end