The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

App::Sqitch::Plan::Change - Sqitch deployment plan tag

Synopsis

  my $plan = App::Sqitch::Plan->new( sqitch => $sqitch );
  for my $line ($plan->lines) {
      say $line->as_string;
  }

Description

A App::Sqitch::Plan::Change represents deployment change as parsed from a plan file. In addition to the interface inherited from App::Sqitch::Plan::Line, it offers interfaces for parsing dependencies from the deploy script, as well as for opening the deploy, revert, and test scripts.

Interface

See App::Sqitch::Plan::Line for the basics.

Accessors

since_tag

An App::Sqitch::Plan::Tag object representing the last tag to appear in the plan before the change. May be undef.

Instance Methods

deploy_file

  my $file = $change->deploy_file;

Returns the path to the deploy script file for the change.

revert_file

  my $file = $change->revert_file;

Returns the path to the revert script file for the change.

test_file

  my $file = $change->test_file;

Returns the path to the test script file for the change.

requires

  my @requires = $change->requires;

Returns a list of the names of changes required by this change.

requires_changes

  my @requires_changes = $change->requires_changes;

Returns a list of the changes required by this change.

conflicts

  my @conflicts = $change->conflicts;

Returns a list of the names of changes with which this change conflicts.

conflicts_changes

  my @conflicts_changes = $change->conflicts_changes;

Returns a list of the changes with which this change conflicts.

is_deploy

Returns true if the change is intended to be deployed, and false if it should be reverted.

is_revert

Returns true if the change is intended to be reverted, and false if it should be deployed.

action

Returns "deploy" if the change should be deployed, or "revert" if it should be reverted.

format_name_with_tags

  my $name_with_tags = $change->format_name_with_tags;

Returns a string formatted with the change name followed by the list of tags, if any, associated with the change. Used to display a change as it is deployed.

deploy_handle

  my $fh = $change->deploy_handle;

Returns an IO::File file handle, opened for reading, for the deploy script for the change.

revert_handle

  my $fh = $change->revert_handle;

Returns an IO::File file handle, opened for reading, for the revert script for the change.

test_handle

  my $fh = $change->test_handle;

Returns an IO::File file handle, opened for reading, for the test script for the change.

See Also

App::Sqitch::Plan

Class representing a plan.

App::Sqitch::Plan::Line

Base class from which App::Sqitch::Plan::Change inherits.

sqitch

The Sqitch command-line client.

Author

David E. Wheeler <david@justatheory.com>

License

Copyright (c) 2012 iovation Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.