Class: Rails::Worktrees::Configuration
- Inherits:
-
Object
- Object
- Rails::Worktrees::Configuration
- Defined in:
- lib/rails/worktrees/configuration.rb,
sig/rails/worktrees.rbs
Overview
Stores application-level settings for the wt command.
Constant Summary collapse
- CONFIGURABLE_ATTRIBUTES =
%i[ bootstrap_env workspace_root dev_port_range branch_prefix name_sources_path used_names_file worktree_database_suffix_max_length post_create_command run_bundle_install run_yarn_install run_db_prepare run_test_db_prepare run_test_assets_precompile link_credential_keys link_test_credential_key link_production_credential_key ].freeze
- DEFAULT_BOOTSTRAP_ENV =
true- DEFAULT_BRANCH_PREFIX =
'🚂'.freeze
- DEFAULT_DEV_PORT_RANGE =
(3000..3999)
- DEFAULT_USED_NAMES_DIRECTORY =
File.join( ENV.fetch('XDG_STATE_HOME', File.join(Dir.home, '.local/state')), 'rails-worktrees' )
- DEFAULT_USED_NAMES_FILE =
File.join(DEFAULT_USED_NAMES_DIRECTORY, 'used-names.tsv')
- DEFAULT_NAME_SOURCES_PATH =
File.('names', __dir__)
- DEFAULT_WORKTREE_DATABASE_SUFFIX_MAX_LENGTH =
18
Instance Attribute Summary collapse
-
#bootstrap_env ⇒ Boolean
Returns the value of attribute bootstrap_env.
-
#branch_prefix ⇒ String
Returns the value of attribute branch_prefix.
-
#dev_port_range ⇒ ::Range[Integer]
Returns the value of attribute dev_port_range.
-
#legacy_used_names_files ⇒ Array[String]
Returns the value of attribute legacy_used_names_files.
-
#link_credential_keys ⇒ Object
Returns the value of attribute link_credential_keys.
-
#link_production_credential_key ⇒ Object
Returns the value of attribute link_production_credential_key.
-
#link_test_credential_key ⇒ Object
Returns the value of attribute link_test_credential_key.
-
#name_sources_path ⇒ String
Returns the value of attribute name_sources_path.
-
#post_create_command ⇒ Object
Returns the value of attribute post_create_command.
-
#run_bundle_install ⇒ Object
Returns the value of attribute run_bundle_install.
-
#run_db_prepare ⇒ Object
Returns the value of attribute run_db_prepare.
-
#run_test_assets_precompile ⇒ Object
Returns the value of attribute run_test_assets_precompile.
-
#run_test_db_prepare ⇒ Object
Returns the value of attribute run_test_db_prepare.
-
#run_yarn_install ⇒ Object
Returns the value of attribute run_yarn_install.
-
#used_names_file ⇒ String
Returns the value of attribute used_names_file.
-
#workspace_root ⇒ String?
Returns the value of attribute workspace_root.
-
#worktree_database_suffix_max_length ⇒ Integer
Returns the value of attribute worktree_database_suffix_max_length.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
43 44 45 46 |
# File 'lib/rails/worktrees/configuration.rb', line 43 def initialize assign_core_defaults assign_post_create_defaults end |
Instance Attribute Details
#bootstrap_env ⇒ Boolean
Returns the value of attribute bootstrap_env.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def bootstrap_env @bootstrap_env end |
#branch_prefix ⇒ String
Returns the value of attribute branch_prefix.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def branch_prefix @branch_prefix end |
#dev_port_range ⇒ ::Range[Integer]
Returns the value of attribute dev_port_range.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def dev_port_range @dev_port_range end |
#legacy_used_names_files ⇒ Array[String]
Returns the value of attribute legacy_used_names_files.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def legacy_used_names_files @legacy_used_names_files end |
#link_credential_keys ⇒ Object
Returns the value of attribute link_credential_keys.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def link_credential_keys @link_credential_keys end |
#link_production_credential_key ⇒ Object
Returns the value of attribute link_production_credential_key.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def link_production_credential_key @link_production_credential_key end |
#link_test_credential_key ⇒ Object
Returns the value of attribute link_test_credential_key.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def link_test_credential_key @link_test_credential_key end |
#name_sources_path ⇒ String
Returns the value of attribute name_sources_path.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def name_sources_path @name_sources_path end |
#post_create_command ⇒ Object
Returns the value of attribute post_create_command.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def post_create_command @post_create_command end |
#run_bundle_install ⇒ Object
Returns the value of attribute run_bundle_install.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def run_bundle_install @run_bundle_install end |
#run_db_prepare ⇒ Object
Returns the value of attribute run_db_prepare.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def run_db_prepare @run_db_prepare end |
#run_test_assets_precompile ⇒ Object
Returns the value of attribute run_test_assets_precompile.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def run_test_assets_precompile @run_test_assets_precompile end |
#run_test_db_prepare ⇒ Object
Returns the value of attribute run_test_db_prepare.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def run_test_db_prepare @run_test_db_prepare end |
#run_yarn_install ⇒ Object
Returns the value of attribute run_yarn_install.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def run_yarn_install @run_yarn_install end |
#used_names_file ⇒ String
Returns the value of attribute used_names_file.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def used_names_file @used_names_file end |
#workspace_root ⇒ String?
Returns the value of attribute workspace_root.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def workspace_root @workspace_root end |
#worktree_database_suffix_max_length ⇒ Integer
Returns the value of attribute worktree_database_suffix_max_length.
35 36 37 |
# File 'lib/rails/worktrees/configuration.rb', line 35 def worktree_database_suffix_max_length @worktree_database_suffix_max_length end |