Class: Bashly::Settings
- Inherits:
-
Object
- Object
- Bashly::Settings
- Extended by:
- AssetHelper
- Defined in:
- lib/bashly/settings.rb
Class Attribute Summary collapse
- .commands_dir ⇒ Object
- .compact_short_flags ⇒ Object
- .config_path ⇒ Object
- .conjoined_flag_args ⇒ Object
- .enable_bash3_bouncer ⇒ Object
- .enable_deps_array ⇒ Object
- .enable_env_var_names_array ⇒ Object
- .enable_header_comment ⇒ Object
- .enable_inspect_args ⇒ Object
- .enable_sourcing ⇒ Object
- .enable_view_markers ⇒ Object
- .formatter ⇒ Object
- .function_names ⇒ Object
- .lib_dir ⇒ Object
- .partials_extension ⇒ Object
- .private_reveal_key ⇒ Object
- .show_examples_on_error ⇒ Object
- .source_dir ⇒ Object
- .strict ⇒ Object
- .tab_indent ⇒ Object
- .target_dir ⇒ Object
- .usage_colors ⇒ Object
- .var_aliases ⇒ Object
Class Method Summary collapse
- .enabled?(feature) ⇒ Boolean
- .env ⇒ Object
- .env=(value) ⇒ Object
- .full_lib_dir ⇒ Object
- .function_name(key) ⇒ Object
- .production? ⇒ Boolean
- .strict_string ⇒ Object
Methods included from AssetHelper
Class Attribute Details
.commands_dir ⇒ Object
32 33 34 |
# File 'lib/bashly/settings.rb', line 32 def commands_dir @commands_dir ||= get :commands_dir end |
.compact_short_flags ⇒ Object
36 37 38 |
# File 'lib/bashly/settings.rb', line 36 def compact_short_flags @compact_short_flags ||= get :compact_short_flags end |
.config_path ⇒ Object
44 45 46 |
# File 'lib/bashly/settings.rb', line 44 def config_path @config_path ||= get(:config_path) % { source_dir: source_dir } end |
.conjoined_flag_args ⇒ Object
40 41 42 |
# File 'lib/bashly/settings.rb', line 40 def conjoined_flag_args @conjoined_flag_args ||= get :conjoined_flag_args end |
.enable_bash3_bouncer ⇒ Object
54 55 56 |
# File 'lib/bashly/settings.rb', line 54 def enable_bash3_bouncer @enable_bash3_bouncer ||= get :enable_bash3_bouncer end |
.enable_deps_array ⇒ Object
58 59 60 |
# File 'lib/bashly/settings.rb', line 58 def enable_deps_array @enable_deps_array ||= get :enable_deps_array end |
.enable_env_var_names_array ⇒ Object
62 63 64 |
# File 'lib/bashly/settings.rb', line 62 def enable_env_var_names_array @enable_env_var_names_array ||= get :enable_env_var_names_array end |
.enable_header_comment ⇒ Object
66 67 68 |
# File 'lib/bashly/settings.rb', line 66 def enable_header_comment @enable_header_comment ||= get :enable_header_comment end |
.enable_inspect_args ⇒ Object
70 71 72 |
# File 'lib/bashly/settings.rb', line 70 def enable_inspect_args @enable_inspect_args ||= get :enable_inspect_args end |
.enable_sourcing ⇒ Object
74 75 76 |
# File 'lib/bashly/settings.rb', line 74 def enable_sourcing @enable_sourcing ||= get :enable_sourcing end |
.enable_view_markers ⇒ Object
78 79 80 |
# File 'lib/bashly/settings.rb', line 78 def enable_view_markers @enable_view_markers ||= get :enable_view_markers end |
.formatter ⇒ Object
90 91 92 |
# File 'lib/bashly/settings.rb', line 90 def formatter @formatter ||= get :formatter end |
.function_names ⇒ Object
102 103 104 |
# File 'lib/bashly/settings.rb', line 102 def function_names @function_names ||= get :function_names end |
.lib_dir ⇒ Object
106 107 108 |
# File 'lib/bashly/settings.rb', line 106 def lib_dir @lib_dir ||= get :lib_dir end |
.partials_extension ⇒ Object
110 111 112 |
# File 'lib/bashly/settings.rb', line 110 def partials_extension @partials_extension ||= get :partials_extension end |
.private_reveal_key ⇒ Object
114 115 116 |
# File 'lib/bashly/settings.rb', line 114 def private_reveal_key @private_reveal_key ||= get :private_reveal_key end |
.show_examples_on_error ⇒ Object
122 123 124 |
# File 'lib/bashly/settings.rb', line 122 def show_examples_on_error @show_examples_on_error ||= get :show_examples_on_error end |
.source_dir ⇒ Object
126 127 128 |
# File 'lib/bashly/settings.rb', line 126 def source_dir @source_dir ||= get :source_dir end |
.strict ⇒ Object
130 131 132 |
# File 'lib/bashly/settings.rb', line 130 def strict @strict ||= get :strict end |
.tab_indent ⇒ Object
144 145 146 |
# File 'lib/bashly/settings.rb', line 144 def tab_indent @tab_indent ||= get :tab_indent end |
.target_dir ⇒ Object
148 149 150 |
# File 'lib/bashly/settings.rb', line 148 def target_dir @target_dir ||= get :target_dir end |
.usage_colors ⇒ Object
152 153 154 |
# File 'lib/bashly/settings.rb', line 152 def usage_colors @usage_colors ||= get :usage_colors end |
.var_aliases ⇒ Object
156 157 158 |
# File 'lib/bashly/settings.rb', line 156 def var_aliases @var_aliases ||= get :var_aliases end |
Class Method Details
.enabled?(feature) ⇒ Boolean
48 49 50 51 52 |
# File 'lib/bashly/settings.rb', line 48 def enabled?(feature) send(:"enable_#{feature}") == 'always' || (send(:"enable_#{feature}") == 'production' && production?) || (send(:"enable_#{feature}") == 'development' && !production?) end |
.env ⇒ Object
82 83 84 |
# File 'lib/bashly/settings.rb', line 82 def env @env ||= get(:env)&.to_sym end |
.env=(value) ⇒ Object
86 87 88 |
# File 'lib/bashly/settings.rb', line 86 def env=(value) @env = value&.to_sym end |
.full_lib_dir ⇒ Object
94 95 96 |
# File 'lib/bashly/settings.rb', line 94 def full_lib_dir "#{source_dir}/#{lib_dir}" end |
.function_name(key) ⇒ Object
98 99 100 |
# File 'lib/bashly/settings.rb', line 98 def function_name(key) function_names[key.to_s] || key.to_s end |
.production? ⇒ Boolean
118 119 120 |
# File 'lib/bashly/settings.rb', line 118 def production? env == :production end |
.strict_string ⇒ Object
134 135 136 137 138 139 140 141 142 |
# File 'lib/bashly/settings.rb', line 134 def strict_string if strict.is_a? String strict elsif strict 'set -euo pipefail' else 'set -e' end end |