App-gqmt

 view release on metacpan or  search on metacpan

etc/gqmt.d/github-query-all-versions.tt  view on Meta::CPAN

      nodes {
        id
        name
        versions(last: [% vers_num %][% cursor %]) {
          nodes {
            id
            version
            files(first:1, orderBy: {direction: DESC, field: CREATED_AT}) {
              totalCount
              nodes {
                updatedAt
              }
            }
          }
          pageInfo {
            endCursor
            hasNextPage
            hasPreviousPage
            startCursor
          }
        }

gqmt  view on Meta::CPAN

          nodes {
            id
            name
            versions(last: [% vers_num %][% cursor %]) {
              nodes {
                id
                version
                files(first:1, orderBy: {direction: DESC, field: CREATED_AT}) {
                  totalCount
                  nodes {
                    updatedAt
                  }
                }
              }
              pageInfo {
                endCursor
                hasNextPage
                hasPreviousPage
                startCursor
              }
            }

lib/App/gqmt.pm  view on Meta::CPAN

    } elsif ( exists $self->option('re')->{$self->option('package')} ) {
      $re = $self->option('re')->{$self->option('package')}
    } else {
      $re = $self->option('re')->{default};
    }
    
    foreach ( @{$versions} ) {
      next if $_->{version} =~ /$re/;
      p ($_, caller_message => "VERSION DOES NOT MATCH REGEX ($re) AND IS BEEN PROCESSED: __FILENAME__:__LINE__ ") if $self->option('d') > 2;

      if ( defined $_->{files}->{nodes}->[0]->{updatedAt} ) {
	$t_ver = Time::Piece->strptime( $_->{files}->{nodes}->[0]->{updatedAt},
					"%Y-%m-%dT%H:%M:%SZ" );

	next if ($t_ver->epoch + $self->option('age') ) >= $t_now->epoch;
      }

      # $to_delete->{ defined $_->{files}->{nodes}->[0]->{updatedAt} ?
      # 		$_->{files}->{nodes}->[0]->{updatedAt} : sprintf('NODATE_%04d', $i++) } = $_->{version};

      $to_delete->{ $_->{id} } = { version => $_->{version},
				   ts      => $_->{files}->{nodes}->[0]->{updatedAt} };
    }
  } else {
    $to_delete->{ $self->option('v') } = { version => 'STUB VERSION',
					   ts      => 'STUB TS' };
  }

  p ($to_delete, caller_message => "VERSIONS TO DELETE: __FILENAME__:__LINE__ ") if $self->option('d') > 2;

  if ( $self->option('delete') && defined $to_delete &&
       scalar(keys(%{$to_delete})) gt $self->option('versions_to_hold') ) {

lib/App/gqmt.pm  view on Meta::CPAN

			  # dry => $self->option('dry_run')
			 });

  } elsif ( $self->option('delete') && !defined $to_delete ) {
    print "nothing to delete\n";
  } else {
    # p ( $versions, colored => $self->option('colored') ) if $self->option('d') > 2 || $self->option('dry_run');
    my @vers_arr = map {
      sprintf("%30s\t%20s\t%s\n",
	      $_->{version},
	      scalar @{$_->{files}->{nodes}} > 0 && exists $_->{files}->{nodes}->[0]->{updatedAt}
	      ? $_->{files}->{nodes}->[0]->{updatedAt} : '',
	      $_->{id}
	     )
    } @{$versions};
    print "Versions of package \"", $self->option('package'), "\":\n\n", join('', @vers_arr);
  }
}


sub del_versions {
  my ($self, $args) = @_;

lib/App/gqmt.pm  view on Meta::CPAN

                                   nodes {
                                     id
                                     name
                                     versions(last: %d%s) {
                                       nodes {
                                         id
                                         version
                                         files(first:1, orderBy: {direction: DESC, field: CREATED_AT}) {
                                           totalCount
                                           nodes {
                                             updatedAt
                                             packageVersion {
                                               version
                                               id
                                             }
                                           }
                                         }
                                       }
                                       pageInfo {
                                         endCursor
                                         hasNextPage



( run in 0.350 second using v1.01-cache-2.11-cpan-05444aca049 )