17 May 2020 16:20:46 UTC
- Distribution: App-Sqitch
- Module version: v1.1.0
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (59)
- KwaliteeBus factor: 2
- 78.90% Coverage
- License: mit
- Perl: v5.10.0
- Activity24 month
- Download (586.44KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:18 non-PAUSE usersDWHEELER David E. Wheelerand 1 contributors
- "iovation Inc."
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- See Also
App::Sqitch::Plan::ChangeList - Sqitch deployment plan change list
my $list = App::Sqitch::Plan::ChangeList->new( $add_roles, $add_users, $insert_user, $insert_user2, ); my @changes = $list->changes; my $add_users = $list->change_at(1); my $add_users = $list->get('add_users'); my $insert_user1 = $list->get('insert_user@alpha'); my $insert_user2 = $list->get('insert_user');
my $plan = App::Sqitch::Plan::ChangeList->new( @changes );
Instantiates and returns a App::Sqitch::Plan::ChangeList object with the list of changes. Each change should be a App::Sqitch::Plan::Change object. Order will be preserved but the location of each change will be indexed by its name and ID, as well as the names and IDs of any associated tags.
my $count = $changelist->count;
Returns the number of changes in the list.
my @changes = $changelist->changes;
Returns all of the changes in the list.
my @tags = $changelist->tags;
Returns all of the tags associated with changes in the list.
my @changes = $changelist->items;
An alias for
my $change = $change_list->change_at(10);
Returns the change at the specified index.
my $index = $changelist->index_of($change_id); my $index = $changelist->index_of($change_name);
Returns the index of the change with the specified ID or name. The value passed may be one of these forms:
my $index = $changelist->index_of('6c2f28d125aff1deea615f8de774599acf39a7a1');
This is the SHA1 ID of a change or tag. Currently, the full 40-character hexed hash string must be specified.
A change name
my $index = $changelist->index_of('users_table');
The name of a change. Will throw an exception if the more than one change in the list goes by that name.
A tag name
my $index = $changelist->index_of('@beta1');
The name of a tag, including the leading
A tag-qualified change name
my $index = $changelist->index_of('users_table@beta1');
The named change as it was last seen in the list before the specified tag.
my $index = $changelist->first_index_of($change_name); my $index = $changelist->first_index_of($change_name, $name);
Returns the index of the first instance of the named change in the list. If a second argument is passed, the index of the first instance of the change after the index of the second argument will be returned. This is useful for getting the index of a change as it was deployed after a particular tag, for example:
my $index = $changelist->first_index_of('foo', '@beta'); my $index = $changelist->first_index_of('foo', 'users_table@beta1');
The second argument must unambiguously refer to a single change in the list. As such, it should usually be a tag name or tag-qualified change name. Returns
undefif the change does not appear in the list, or if it does not appear after the specified second argument change name.
my $change = $changelist->last_change;
Returns the last change to be appear in the list. Returns
undefif the list contains no changes.
my $change = $changelist->last_tagged_change;
Returns the last tagged change in the list. Returns
undefif the list contains no tagged changes.
my $index = $changelist->index_of_last_tagged;
Returns the index of the last tagged change in the list. Returns
undefif the list contains no tags.
my $change = $changelist->get($id); my $change = $changelist->get($change_name); my $change = $changelist->get($tag_name);
Returns the change for the specified ID or name. The name may be specified as described for
index_of(). An exception will be thrown if more than one change goes by a specified name. As such, it is best to specify it as unambiguously as possible: as a tag name, a tag-qualified change name, or an ID.
say 'Yes!' if $plan->contains('6c2f28d125aff1deea615f8de774599acf39a7a1');
index_of(), but never throws an exception, and returns true if the plan contains the specified change, and false if it does not.
my $change = $changelist->find($id); my $change = $changelist->find($change_name); my $change = $changelist->find($tag_name); my $change = $changelist->find("$change_name\@$tag_name");
Tries to find and return a change based on the argument. If no tag is specified, finds and returns the first instance of the named change. Otherwise, it returns the change as of the specified tag. Unlike
get(), it will not throw an error if more than one change exists with the specified name, but will return the first instance.
Append one or more changes to the list. Does not check for duplicates, so use with care.
Index the tag at the specified index. That is, the tag is assumed to be associated with the change at the specified index, and so the internal look up table is updated so that the change at that index can be found via the tag's name and ID.
The Sqitch plan.
David E. Wheeler <firstname.lastname@example.org>
Copyright (c) 2012-2020 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.