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



22
23
24
# File 'lib/bashly/settings.rb', line 22

def commands_dir
  @commands_dir ||= get :commands_dir
end

.compact_short_flagsObject



26
27
28
# File 'lib/bashly/settings.rb', line 26

def compact_short_flags
  @compact_short_flags ||= get :compact_short_flags
end

.config_pathObject



34
35
36
# File 'lib/bashly/settings.rb', line 34

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

.conjoined_flag_argsObject



30
31
32
# File 'lib/bashly/settings.rb', line 30

def conjoined_flag_args
  @conjoined_flag_args ||= get :conjoined_flag_args
end

.lib_dirObject



50
51
52
# File 'lib/bashly/settings.rb', line 50

def lib_dir
  @lib_dir ||= get :lib_dir
end

.partials_extensionObject



54
55
56
# File 'lib/bashly/settings.rb', line 54

def partials_extension
  @partials_extension ||= get :partials_extension
end

.private_reveal_keyObject



58
59
60
# File 'lib/bashly/settings.rb', line 58

def private_reveal_key
  @private_reveal_key ||= get :private_reveal_key
end

.show_examples_on_errorObject



66
67
68
# File 'lib/bashly/settings.rb', line 66

def show_examples_on_error
  @show_examples_on_error ||= get :show_examples_on_error
end

.source_dirObject



70
71
72
# File 'lib/bashly/settings.rb', line 70

def source_dir
  @source_dir ||= get :source_dir
end

.strictObject



74
75
76
# File 'lib/bashly/settings.rb', line 74

def strict
  @strict ||= get :strict
end

.tab_indentObject



88
89
90
# File 'lib/bashly/settings.rb', line 88

def tab_indent
  @tab_indent ||= get :tab_indent
end

.target_dirObject



92
93
94
# File 'lib/bashly/settings.rb', line 92

def target_dir
  @target_dir ||= get :target_dir
end

.usage_colorsObject



96
97
98
# File 'lib/bashly/settings.rb', line 96

def usage_colors
  @usage_colors ||= get :usage_colors
end

Class Method Details

.envObject



38
39
40
# File 'lib/bashly/settings.rb', line 38

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

.env=(value) ⇒ Object



42
43
44
# File 'lib/bashly/settings.rb', line 42

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

.full_lib_dirObject



46
47
48
# File 'lib/bashly/settings.rb', line 46

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

.production?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/bashly/settings.rb', line 62

def production?
  env == :production
end

.strict_stringObject



78
79
80
81
82
83
84
85
86
# File 'lib/bashly/settings.rb', line 78

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