Name

Synopsis

Description

A App::Sqitch::Plan::Change represents a 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 verify scripts.

Interface

Accessors

since_tag

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

pspace

Blank space separating the change name from the dependencies, timestamp, and planner in the file.

is_reworked

Boolean indicting whether or not the change has been reworked.

info

Information about the change, returned as a string. Includes the change ID, the name and email address of the user who added the change to the plan, and the timestamp for when the change was added to the plan.

id

A SHA1 hash of the data returned by info(), which can be used as a globally-unique identifier for the change.

timestamp

Returns the an App::Sqitch::DateTime object representing the time at which the change was added to the plan.

planner_name

Returns the name of the user who added the change to the plan.

planner_email

Returns the email address of the user who added the change to the plan.

parent

Parent change object.

tags

A list of tag objects associated with the change.

Instance Methods

path_segments

my @segments = $change->path_segments;

Returns the path segment for the change. For example, if the change is named "foo", ('foo.sql') is returned. If the change is named "functions/bar> ('functions', 'bar.sql') is returned. Internally, this data is used to create the deploy, revert, and verify file names.

deploy_dir

my $file = $change->deploy_dir;

Returns the path to the deploy directory for the change.

deploy_file

my $file = $change->deploy_file;

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

revert_dir

my $file = $change->revert_dir;

Returns the path to the revert directory for the change.

revert_file

my $file = $change->revert_file;

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

verify_dir

my $file = $change->verify_dir;

Returns the path to the verify directory for the change.

verify_file

my $file = $change->verify_file;

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

script_file

my $file = $sqitch->script_file($script_name);

Returns the path to a script, for the change.

script_hash

my $hash = $change->script_hash;

Returns the hex digest of the SHA-1 hash for the deploy script.

rework_tags

my @tags = $change->rework_tags;

Returns a list of tags that occur between a change and its next reworking. Returns an empty list if the change is not reworked.

note_prompt

Overrides the implementation from App::Sqitch::Plan::Line to add the files parameter. This is a list of the files to be created for the command. These will usually be the deploy, revert, and verify files, but the caller might not be creating all of them, so it needs to pass the list.

See Also

Author

David E. Wheeler <david@justatheory.com>

License

Copyright (c) 2012-2015 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.

Module Install Instructions

To install App::Sqitch::Plan::Change, simply copy and paste either of the commands in to your terminal