Class: Capistrano::Configuration::SCMResolver
- Inherits:
-
Object
- Object
- Capistrano::Configuration::SCMResolver
- Includes:
- DSL
- Defined in:
- lib/capistrano/configuration/scm_resolver.rb
Overview
In earlier versions of Capistrano, users would specify the desired SCM implementation using ‘set :scm, :git`, for example. Capistrano would then load the matching .rb file based on this variable.
Now we expect users to explicitly ‘require` and call `new` on the desired SCM implementation in their Capfile. The `set` technique is deprecated.
This SCMResolver class takes care of managing the transition from the old to new system. It maintains the legacy behavior, but prints deprecation warnings when it is used.
To maintain backwards compatibility, the resolver will load the Git SCM by if default it determines that no SCM has been explicitly specified or loaded. To force no SCM to be used at all, use ‘set :scm, nil`. This hack won’t be necessary once backwards compatibility is removed in a future version.
TODO: Remove this class entirely in Capistrano 4.0.
Constant Summary collapse
- DEFAULT_GIT =
:"default-git"
Instance Method Summary collapse
Methods included from DSL
#execute, #invoke, #invoke!, #local_user, #lock, #on, #revision_log_message, #rollback_log_message, #run_locally, #scm, #sudo, #t
Methods included from DSL::Stages
#stage_definitions, #stage_set?, #stages
Methods included from DSL::Paths
#asset_timestamp, #current_path, #deploy_config_path, #deploy_path, #deploy_to, #join_paths, #linked_dir_parents, #linked_dirs, #linked_file_dirs, #linked_files, #map_dirnames, #now, #release_path, #releases_path, #repo_path, #repo_url, #revision_log, #set_release_path, #shared_path, #stage_config_path
Methods included from DSL::Env
#asset_timestamp, #env, #release_roles, #release_timestamp, #role_properties, #roles
Methods included from TaskEnhancements
#after, #before, #default_tasks, #define_remote_file_task, #deploying?, #ensure_stage, #exit_deploy_because_of_exception, #tasks_without_stage_dependency
Instance Method Details
#resolve ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/capistrano/configuration/scm_resolver.rb', line 27 def resolve return if scm_name.nil? set(:scm, :git) if using_default_scm? print_deprecation_warnings_if_applicable # Note that `scm_plugin_installed?` comes from Capistrano::DSL if scm_plugin_installed? delete(:scm) return end if built_in_scm_name? load_built_in_scm else # Compatibility with existing 3.x third-party SCMs register_legacy_scm_hooks load_legacy_scm_by_name end end |