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



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

def commands_dir
  @commands_dir ||= get :commands_dir
end

.compact_short_flagsObject



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

def compact_short_flags
  @compact_short_flags ||= get :compact_short_flags
end

.config_pathObject



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

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

.conjoined_flag_argsObject



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

def conjoined_flag_args
  @conjoined_flag_args ||= get :conjoined_flag_args
end

.lib_dirObject



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

def lib_dir
  @lib_dir ||= get :lib_dir
end

.partials_extensionObject



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

def partials_extension
  @partials_extension ||= get :partials_extension
end

.show_examples_on_errorObject



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

def show_examples_on_error
  @show_examples_on_error ||= get :show_examples_on_error
end

.source_dirObject



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

def source_dir
  @source_dir ||= get :source_dir
end

.strictObject



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

def strict
  @strict ||= get :strict
end

.tab_indentObject



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

def tab_indent
  @tab_indent ||= get :tab_indent
end

.target_dirObject



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

def target_dir
  @target_dir ||= get :target_dir
end

.usage_colorsObject



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

def usage_colors
  @usage_colors ||= get :usage_colors
end

Class Method Details

.envObject



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

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

.env=(value) ⇒ Object



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

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

.full_lib_dirObject



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

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

.production?Boolean

Returns:

  • (Boolean)


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

def production?
  env == :production
end

.strict_stringObject



73
74
75
76
77
78
79
80
81
# File 'lib/bashly/settings.rb', line 73

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