Module: Externals

Defined in:
lib/externals/ext.rb,
lib/externals/command.rb,
lib/externals/project.rb,
lib/externals/scms/git_project.rb,
lib/externals/scms/svn_project.rb,
lib/externals/project_types/rails.rb,
lib/externals/configuration/configuration.rb

Defined Under Namespace

Modules: Configuration, RailsProjectType Classes: Command, Ext, GitProject, Project, RailsDetector, SvnProject

Constant Summary collapse

VERSION =
'1.1.3'
PROJECT_TYPES_DIRECTORY =
File.join(File.dirname(__FILE__), '..', 'externals','project_types')
FULL_COMMANDS_HASH =

Full commands operate on the main project as well as the externals short commands only operate on the externals Main commands only operate on the main project

[
  [:checkout, "ext checkout <repository>",
    %{Checks out <repository>, and checks out any subprojects
    registered in <repository>'s .externals file.}],
  [:export, "ext export <repository>",
    %{Like checkout except this command fetches as little
    history as possible.}],
  [:status, "ext status",
    %{Prints out the status of the main project, followed by
    the status of each subproject.}],
  [:update, "ext update",
    %{Brings the main project, and all subprojects, up to the
    latest version.}]
]
SHORT_COMMANDS_HASH =
[
  [:co, "Like checkout, but skips the main project and
        only checks out subprojects."],
  [:ex, "Like export, but skips the main project."],
  [:st, "Like status, but skips the main project."],
  [:up, "Like update, but skips the main project."]
]
MAIN_COMMANDS_HASH =
[
  [:freeze, "ext freeze <subproject> [REVISION]",
    %{Locks a subproject into a specific revision/branch.  If no
    revision is supplied, the current revision/branch of the
    project will be used.  You can specify the subproject by name
    or path.}],
  [:help, "You probably just ran this command just now."],
  [:init, "Creates a .externals file containing only [main]
    It will try to determine the SCM used by the main project,
    as well as the project type.  You don't have to specify
    a project type if you don't want to or if your project type
    isn't supported.  It just means that when using 'install'
    that you'll want to specify the path."],
  [:install, "ext install <repository> [-b <branch>] [path]",
    "Registers <repository> in .externals under the appropriate
    SCM.  Checks out the project, and also adds it to the ignore
    feature offered by the SCM of the main project.  If the SCM
    type is not obvious from the repository URL, use the --scm,
    --git, or --svn flags."],
  [:switch, "ext switch <branch_name>",
    "Changes to the named branch <branch_name> and updates any
    subprojects and applies any changes that have been made to the
    .externals file."],
  [:touch_emptydirs, "Recurses through all directories from the
    top and adds a .emptydir file to any empty directories it
    comes across.  Useful for dealing with SCMs that refuse to
    track empty directories (such as git, for example)"],
  [:unfreeze, "ext unfreeze <subproject>",
    %{Unfreezes a previously frozen subproject.  You can specify
    the subproject by name or path.}],
  [:uninstall, "ext uninstall [-f|--force_removal] <project>",
    "Removes a subproject from being tracked by ext.  If you
    want the files associated with this subproject deleted as well
    (if, for example, you wish to reinstall it from a different
    repository) then you can use the -f option to remove the files."],
  [:update_ignore, "Adds all paths to subprojects that are
    registered in .externals to the ignore feature of the
    main project.  This is automatically performed by install,
    and so you probably only will run this if you are manually
    maintaining .externals"],
  [:version, "Displays the version number of externals and exits."],
]
FULL_COMMANDS =
FULL_COMMANDS_HASH.map(&:first)
SHORT_COMMANDS =
SHORT_COMMANDS_HASH.map(&:first)
MAIN_COMMANDS =
MAIN_COMMANDS_HASH.map(&:first)
COMMANDS =
FULL_COMMANDS + SHORT_COMMANDS + MAIN_COMMANDS
COULD_NOT_DETERMINE_SCM =
1
NO_EXTERNALS_FILE =
2
OPTS_SUFFIXES =
["co", "up", "st", "ex"]
VALID_ATTRIB =
([
    :name, :path, :repository, :branch, :type, :scm, :revision
  ]
).map(&:to_s)