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
- .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
31 32 33 |
# File 'lib/bashly/settings.rb', line 31 def commands_dir @commands_dir ||= get :commands_dir end |
.compact_short_flags ⇒ Object
35 36 37 |
# File 'lib/bashly/settings.rb', line 35 def compact_short_flags @compact_short_flags ||= get :compact_short_flags end |
.config_path ⇒ Object
43 44 45 |
# File 'lib/bashly/settings.rb', line 43 def config_path @config_path ||= get(:config_path) % { source_dir: source_dir } end |
.conjoined_flag_args ⇒ Object
39 40 41 |
# File 'lib/bashly/settings.rb', line 39 def conjoined_flag_args @conjoined_flag_args ||= get :conjoined_flag_args end |
.enable_bash3_bouncer ⇒ Object
53 54 55 |
# File 'lib/bashly/settings.rb', line 53 def enable_bash3_bouncer @enable_bash3_bouncer ||= get :enable_bash3_bouncer end |
.enable_deps_array ⇒ Object
57 58 59 |
# File 'lib/bashly/settings.rb', line 57 def enable_deps_array @enable_deps_array ||= get :enable_deps_array end |
.enable_env_var_names_array ⇒ Object
61 62 63 |
# File 'lib/bashly/settings.rb', line 61 def enable_env_var_names_array @enable_env_var_names_array ||= get :enable_env_var_names_array end |
.enable_header_comment ⇒ Object
65 66 67 |
# File 'lib/bashly/settings.rb', line 65 def enable_header_comment @enable_header_comment ||= get :enable_header_comment end |
.enable_inspect_args ⇒ Object
69 70 71 |
# File 'lib/bashly/settings.rb', line 69 def enable_inspect_args @enable_inspect_args ||= get :enable_inspect_args end |
.enable_sourcing ⇒ Object
73 74 75 |
# File 'lib/bashly/settings.rb', line 73 def enable_sourcing @enable_sourcing ||= get :enable_sourcing end |
.enable_view_markers ⇒ Object
77 78 79 |
# File 'lib/bashly/settings.rb', line 77 def enable_view_markers @enable_view_markers ||= get :enable_view_markers end |
.function_names ⇒ Object
97 98 99 |
# File 'lib/bashly/settings.rb', line 97 def function_names @function_names ||= get :function_names end |
.lib_dir ⇒ Object
101 102 103 |
# File 'lib/bashly/settings.rb', line 101 def lib_dir @lib_dir ||= get :lib_dir end |
.partials_extension ⇒ Object
105 106 107 |
# File 'lib/bashly/settings.rb', line 105 def partials_extension @partials_extension ||= get :partials_extension end |
.private_reveal_key ⇒ Object
109 110 111 |
# File 'lib/bashly/settings.rb', line 109 def private_reveal_key @private_reveal_key ||= get :private_reveal_key end |
.show_examples_on_error ⇒ Object
117 118 119 |
# File 'lib/bashly/settings.rb', line 117 def show_examples_on_error @show_examples_on_error ||= get :show_examples_on_error end |
.source_dir ⇒ Object
121 122 123 |
# File 'lib/bashly/settings.rb', line 121 def source_dir @source_dir ||= get :source_dir end |
.strict ⇒ Object
125 126 127 |
# File 'lib/bashly/settings.rb', line 125 def strict @strict ||= get :strict end |
.tab_indent ⇒ Object
139 140 141 |
# File 'lib/bashly/settings.rb', line 139 def tab_indent @tab_indent ||= get :tab_indent end |
.target_dir ⇒ Object
143 144 145 |
# File 'lib/bashly/settings.rb', line 143 def target_dir @target_dir ||= get :target_dir end |
.usage_colors ⇒ Object
147 148 149 |
# File 'lib/bashly/settings.rb', line 147 def usage_colors @usage_colors ||= get :usage_colors end |
.var_aliases ⇒ Object
151 152 153 |
# File 'lib/bashly/settings.rb', line 151 def var_aliases @var_aliases ||= get :var_aliases end |
Class Method Details
.enabled?(feature) ⇒ Boolean
47 48 49 50 51 |
# File 'lib/bashly/settings.rb', line 47 def enabled?(feature) send(:"enable_#{feature}") == 'always' || (send(:"enable_#{feature}") == 'production' && production?) || (send(:"enable_#{feature}") == 'development' && !production?) end |
.env ⇒ Object
81 82 83 |
# File 'lib/bashly/settings.rb', line 81 def env @env ||= get(:env)&.to_sym end |
.env=(value) ⇒ Object
85 86 87 |
# File 'lib/bashly/settings.rb', line 85 def env=(value) @env = value&.to_sym end |
.full_lib_dir ⇒ Object
89 90 91 |
# File 'lib/bashly/settings.rb', line 89 def full_lib_dir "#{source_dir}/#{lib_dir}" end |
.function_name(key) ⇒ Object
93 94 95 |
# File 'lib/bashly/settings.rb', line 93 def function_name(key) function_names[key.to_s] || key.to_s end |
.production? ⇒ Boolean
113 114 115 |
# File 'lib/bashly/settings.rb', line 113 def production? env == :production end |
.strict_string ⇒ Object
129 130 131 132 133 134 135 136 137 |
# File 'lib/bashly/settings.rb', line 129 def strict_string if strict.is_a? String strict elsif strict 'set -euo pipefail' else 'set -e' end end |