Module: Metior::VCS

Included in:
Git
Defined in:
lib/metior/vcs.rb

Overview

This module provides functionality to automatically register new VCS implementations Modules

Author:

Defined Under Namespace

Modules: ClassMethods, Git

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(mod)

Including VCS will prepare a Module for use as a supported VCS type in Metior

Parameters:

  • mod (Module)

    The Module that provides a Metior implementation for a specific VCS

Raises:

  • (RuntimeError)

    if the VCS Module does not have the NAME constant defined prior to including Metior::VCS

See Also:

  • Metior.vcs_types


70
71
72
73
74
# File 'lib/metior/vcs.rb', line 70

def self.included(mod)
  mod.extend ClassMethods
  mod.extend Metior::Registerable
  mod.send :class_variable_set, :@@adapters, {}
end

Instance Method Details

- (Metior::VCS) vcs

Returns the VCS module that is included by this object

Returns:

  • (Metior::VCS)

    The VCS implementation module of this object

See Also:

  • Metior.vcs_types


80
81
82
# File 'lib/metior/vcs.rb', line 80

def vcs
  singleton_class.included_modules.find { |mod| mod.include? VCS }
end