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_view_markers ⇒ 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
- .production? ⇒ Boolean
- .strict_string ⇒ Object
Methods included from AssetHelper
Class Attribute Details
.commands_dir ⇒ Object
29 30 31 |
# File 'lib/bashly/settings.rb', line 29 def commands_dir @commands_dir ||= get :commands_dir end |
.compact_short_flags ⇒ Object
33 34 35 |
# File 'lib/bashly/settings.rb', line 33 def compact_short_flags @compact_short_flags ||= get :compact_short_flags end |
.config_path ⇒ Object
41 42 43 |
# File 'lib/bashly/settings.rb', line 41 def config_path @config_path ||= get(:config_path) % { source_dir: source_dir } end |
.conjoined_flag_args ⇒ Object
37 38 39 |
# File 'lib/bashly/settings.rb', line 37 def conjoined_flag_args @conjoined_flag_args ||= get :conjoined_flag_args end |
.enable_bash3_bouncer ⇒ Object
55 56 57 |
# File 'lib/bashly/settings.rb', line 55 def enable_bash3_bouncer @enable_bash3_bouncer ||= get :enable_bash3_bouncer end |
.enable_deps_array ⇒ Object
67 68 69 |
# File 'lib/bashly/settings.rb', line 67 def enable_deps_array @enable_deps_array ||= get :enable_deps_array end |
.enable_env_var_names_array ⇒ Object
71 72 73 |
# File 'lib/bashly/settings.rb', line 71 def enable_env_var_names_array @enable_env_var_names_array ||= get :enable_env_var_names_array end |
.enable_header_comment ⇒ Object
51 52 53 |
# File 'lib/bashly/settings.rb', line 51 def enable_header_comment @enable_header_comment ||= get :enable_header_comment end |
.enable_inspect_args ⇒ Object
63 64 65 |
# File 'lib/bashly/settings.rb', line 63 def enable_inspect_args @enable_inspect_args ||= get :enable_inspect_args end |
.enable_view_markers ⇒ Object
59 60 61 |
# File 'lib/bashly/settings.rb', line 59 def enable_view_markers @enable_view_markers ||= get :enable_view_markers end |
.lib_dir ⇒ Object
87 88 89 |
# File 'lib/bashly/settings.rb', line 87 def lib_dir @lib_dir ||= get :lib_dir end |
.partials_extension ⇒ Object
91 92 93 |
# File 'lib/bashly/settings.rb', line 91 def partials_extension @partials_extension ||= get :partials_extension end |
.private_reveal_key ⇒ Object
95 96 97 |
# File 'lib/bashly/settings.rb', line 95 def private_reveal_key @private_reveal_key ||= get :private_reveal_key end |
.show_examples_on_error ⇒ Object
103 104 105 |
# File 'lib/bashly/settings.rb', line 103 def show_examples_on_error @show_examples_on_error ||= get :show_examples_on_error end |
.source_dir ⇒ Object
107 108 109 |
# File 'lib/bashly/settings.rb', line 107 def source_dir @source_dir ||= get :source_dir end |
.strict ⇒ Object
111 112 113 |
# File 'lib/bashly/settings.rb', line 111 def strict @strict ||= get :strict end |
.tab_indent ⇒ Object
125 126 127 |
# File 'lib/bashly/settings.rb', line 125 def tab_indent @tab_indent ||= get :tab_indent end |
.target_dir ⇒ Object
129 130 131 |
# File 'lib/bashly/settings.rb', line 129 def target_dir @target_dir ||= get :target_dir end |
.usage_colors ⇒ Object
133 134 135 |
# File 'lib/bashly/settings.rb', line 133 def usage_colors @usage_colors ||= get :usage_colors end |
.var_aliases ⇒ Object
137 138 139 |
# File 'lib/bashly/settings.rb', line 137 def var_aliases @var_aliases ||= get :var_aliases end |
Class Method Details
.enabled?(feature) ⇒ Boolean
45 46 47 48 49 |
# File 'lib/bashly/settings.rb', line 45 def enabled?(feature) send(:"enable_#{feature}") == 'always' || (send(:"enable_#{feature}") == 'production' && production?) || (send(:"enable_#{feature}") == 'development' && !production?) end |
.env ⇒ Object
75 76 77 |
# File 'lib/bashly/settings.rb', line 75 def env @env ||= get(:env)&.to_sym end |
.env=(value) ⇒ Object
79 80 81 |
# File 'lib/bashly/settings.rb', line 79 def env=(value) @env = value&.to_sym end |
.full_lib_dir ⇒ Object
83 84 85 |
# File 'lib/bashly/settings.rb', line 83 def full_lib_dir "#{source_dir}/#{lib_dir}" end |
.production? ⇒ Boolean
99 100 101 |
# File 'lib/bashly/settings.rb', line 99 def production? env == :production end |
.strict_string ⇒ Object
115 116 117 118 119 120 121 122 123 |
# File 'lib/bashly/settings.rb', line 115 def strict_string if strict.is_a? String strict elsif strict 'set -euo pipefail' else 'set -e' end end |