Module: MasterDelivery

Defined in:
lib/master_delivery.rb,
lib/cli_master_delivery.rb,
lib/master_delivery/version.rb

Overview

converter module from path to url

Defined Under Namespace

Classes: CliMasterDelivery, MasterDelivery

Constant Summary collapse

MSG_CONFIRMATION_INTRO =
<<~CONFIRM_INTRO

  ** Important **
  You can't undo this operation!

CONFIRM_INTRO
MSG_CONFIRMATION =
<<~CONFIRMATION

  Did you check that all parameters are correct? [yN]:
CONFIRMATION
DESC_MASTER_DIR =
<<~MASTER
  Master snapshot directory. All master files in this
  directory will be placed in the "delivery root",
  maintaining the directory structure.
  Only regular files will be delivered. That is,
  all symbolic link files and empty directories in
  MASTER_DIR are ignored.
MASTER
DESC_DELIVERY_ROOT =
<<~DELIVERY
  Delivery root, or destination directory. All master
  files will be placed in this while maintaining the master
  directory structure.
DELIVERY
DESC_BACKUP_ROOT =
<<~BACKUP
  Backup root, or Evacuation destination directory.
  All current active files will be moved into this
  directory maintaining the directory structure.
  Backup root will be created automatically. (mkdir -p)
   (defualt: MASTER_DIR/../backup)
BACKUP
VALUE_DELIVERY_TYPE =
%w[symbolic_link regular_file].freeze
DESC_DELIVERY_TYPE =
<<~TYPE
  Delivery type. "#{VALUE_DELIVERY_TYPE.join('" or "')}" is accepted.
  Master files will be delivered as symbolic links (ln -s)
  or regular files (cp).
   (default: #{VALUE_DELIVERY_TYPE[0]})
TYPE
DESC_DRYRUN =
<<~DRYRUN
  Instead of actually moving or copying files, display
  the commands on stderr.
  We strongly recommend "--dryrun" before running.
   (default: --no-dryrun)
DRYRUN
DESC_QUIET =
<<~QUIET
  Suppress non-error messages
   (default: --no-quiet)
QUIET
DESC_VERBOSE =
<<~VERBOSE
  Process actual commands for file operations, such as
  moving files and creating folders, one by one.
   (default: --no-verbose)
VERBOSE
DESC_SKIP_CONF =
<<~SKIP_CONF
  Skip confirmation. It is recommended to execute
  the command carefully without skipping confirmation.
  With the "--yes" option, if you want to change the
  command line argument even a little, remove the
  "--yes" option once, execute it several times,
  and experience confirmation several times.
  Also, it's a good idea to add the "--yes" option
  only after you start to feel confirmation annoying.
   (default: --no-yes)
SKIP_CONF
DESC_EXAMPLE =
<<~EXAMPLE
  Example:
      If you specify MASTER_DIR and DELIVERY_ROOT as follows:
         MASTER_DIR:    -m ~/masters/my_home_setting
         DELIVERY_ROOT: -d /Users/foo

      and suppose master files in MASTER_DIR are as follows:
         ~/master/my_home_setting/.zshrc
         ~/master/my_home_setting/work/.rubocop.yml

      then these files will be delivered as the following files:
         /Users/foo/.zshrc
         /Users/foo/work/.rubocop.yml
EXAMPLE
VERSION =
'1.0.7'
DESCRIPTION =
<<~DESC
  Deliver all master files managed in a single master snapshot directory
  into the specified directory while maintaining the hierarchy of the
  master snapshot directory. If the destination file already exists,
  back it up first and then deliver the master file.

  The difference with rsync is that master_delivery creates a symlinks
  instead of copying the master files. They are symlinks, so you have to
  keep in mind that you have to keep the master files in the same location,
  but it also has the advantage that the master file is updated at the same
  time when you directly make changes to the delivered file.

  Do you have any experience that the master file is getting old gradually?
  master_delivery can prevent this.

  If the master directory is git or svn managed, you can manage revisions
  of files that are delivered here and there at once with commands
  like git diff and git commit.
DESC
REPOSITORY_URL =
'https://github.com/shinyaohtani/master_delivery'