| 1 | package WWW::GoDaddy::REST::Util; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use JSON qw(); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | 5 | use Sub::Exporter -setup => { | |||||||||||||||||||||||||||||||
| 8 | exports => [ | ||||||||||||||||||||||||||||||||
| 9 | qw( abs_url | ||||||||||||||||||||||||||||||||
| 10 | add_filters_to_url | ||||||||||||||||||||||||||||||||
| 11 | build_complex_query_url | ||||||||||||||||||||||||||||||||
| 12 | is_json | ||||||||||||||||||||||||||||||||
| 13 | json_decode | ||||||||||||||||||||||||||||||||
| 14 | json_encode | ||||||||||||||||||||||||||||||||
| 15 | json_instance | ||||||||||||||||||||||||||||||||
| 16 | ) | ||||||||||||||||||||||||||||||||
| 17 | ] | ||||||||||||||||||||||||||||||||
| 18 | 5 | ▶ | }; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 19 | 5 | ▶ | use URI; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 20 | 5 | ▶ | use URI::QueryParam; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | sub is_json { | ||||||||||||||||||||||||||||||||
| 23 | 28 | ▶ | my $json = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
is_json: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 24 | 28 | my $handler = json_instance(@_); | |||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | 28 | eval { my $perl = json_decode($json); }; | |||||||||||||||||||||||||||||||
| 27 | 28 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 28 | 14 | return 0; | |||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||
| 30 | else { | ||||||||||||||||||||||||||||||||
| 31 | 14 | return 1; | |||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||
| 35 | sub json_encode { | ||||||||||||||||||||||||||||||||
| 36 | 54 | ▶ | my $perl = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
json_encode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 37 | 54 | my $handler = json_instance(@_); | |||||||||||||||||||||||||||||||
| 38 | 54 | return $handler->encode($perl); | |||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | sub json_decode { | ||||||||||||||||||||||||||||||||
| 42 | 67 | ▶ | my $json = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
json_decode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 43 | 67 | my $handler = json_instance(@_); | |||||||||||||||||||||||||||||||
| 44 | 67 | return $handler->decode($json); | |||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||
| 47 | sub json_instance { | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | 175 | ▶ | my $inst = JSON->new; | ||||||||||||||||||||||||||||||
|
Subroutine
json_instance: called CC=5 SCAR=18.7
Pod
documented
| |||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||
| 51 | 175 | ▶ | if ( @_ == 1 && UNIVERSAL::isa( $_[0], "JSON" ) ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
@_ == 1 and UNIVERSAL::isa($_[0], "JSON")
MC/DC50%1/2
@_ == 1 and UNIVERSAL::isa($_[0], "JSON")
@_ == 1
UNIVERSAL::isa($_[0], "JSON")
Truth table66%2/3
A and B
A= @_ == 1B= UNIVERSAL::isa($_[0], "JSON")
| |||||||||||||||||||||||||||||||||
| 52 | 26 | return $_[0]; | |||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||
| 54 | elsif (@_) { | ||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | while ( my ( $key, $value ) = each %{@_} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 56 | 0 | $inst->property( $key => $value ); | |||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||
| 59 | else { | ||||||||||||||||||||||||||||||||
| 60 | 149 | $inst->convert_blessed(1); | |||||||||||||||||||||||||||||||
| 61 | 149 | $inst->allow_nonref(1); | |||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||
| 63 | 149 | return $inst; | |||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||
| 66 | sub abs_url { | ||||||||||||||||||||||||||||||||
| 67 | 130 | ▶ | my $api_base = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
abs_url: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 68 | 130 | my $url = shift; | |||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||
| 70 | 130 | $url =~ s|^/||; | |||||||||||||||||||||||||||||||
| 71 | 130 | $api_base =~ s|/*$|/|; | |||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||
| 73 | 130 | return URI->new_abs( $url, $api_base ); | |||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||
| 76 | sub add_filters_to_url { | ||||||||||||||||||||||||||||||||
| 77 | 26 | ▶ | my ( $url, $filters ) = @_; | ||||||||||||||||||||||||||||||
|
Subroutine
add_filters_to_url: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||
| 79 | 26 | my $uri = URI->new($url); | |||||||||||||||||||||||||||||||
| 80 | 26 | foreach my $field ( sort keys %{$filters} ) { | |||||||||||||||||||||||||||||||
| 81 | 15 | my $field_filters = $filters->{$field}; | |||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||
| 83 | 15 | ▶ | next unless $field_filters; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||
| 85 | 14 | ▶ | if ( ref($field_filters) eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||
| 87 | # a query could look like so: | ||||||||||||||||||||||||||||||||
| 88 | # { | ||||||||||||||||||||||||||||||||
| 89 | # 'myField' => [ | ||||||||||||||||||||||||||||||||
| 90 | # { modifier => 'ne', value => 'apple' }, | ||||||||||||||||||||||||||||||||
| 91 | # { value => 'orange' } # implicit 'eq' | ||||||||||||||||||||||||||||||||
| 92 | # ] | ||||||||||||||||||||||||||||||||
| 93 | # } | ||||||||||||||||||||||||||||||||
| 94 | 5 | foreach my $filter ( @{$field_filters} ) { | |||||||||||||||||||||||||||||||
| 95 | 6 | ▶ | my $modifier = $filter->{modifier} || 'eq'; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$filter->{'modifier'} || 'eq'
MC/DC100%1/1
$filter->{'modifier'} || 'eq'
$filter->{'modifier'}
Truth table100%2/2
A
A= $filter->{'modifier'}
| |||||||||||||||||||||||||||||||||
| 96 | 6 | my $value = $filter->{value}; | |||||||||||||||||||||||||||||||
| 97 | 6 | ▶ | if ( $modifier eq 'eq' ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 98 | 3 | $uri->query_param_append( $field => $value ); | |||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||
| 100 | else { | ||||||||||||||||||||||||||||||||
| 101 | 3 | $uri->query_param_append( sprintf( '%s_%s', $field, $modifier ) => $value ); | |||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||
| 105 | else { | ||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||
| 107 | # a query could look like so: | ||||||||||||||||||||||||||||||||
| 108 | # { | ||||||||||||||||||||||||||||||||
| 109 | # 'myField' => 'apple' | ||||||||||||||||||||||||||||||||
| 110 | # } | ||||||||||||||||||||||||||||||||
| 111 | 9 | $uri->query_param_append( $field => $field_filters ); | |||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||
| 114 | 26 | return $uri->as_string; | |||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||
| 117 | sub build_complex_query_url { | ||||||||||||||||||||||||||||||||
| 118 | 18 | ▶ | my ( $url, $filter, $params ) = @_; | ||||||||||||||||||||||||||||||
|
Subroutine
build_complex_query_url: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||
| 120 | 18 | ▶ | $filter ||= {}; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$filter ||= {}
MC/DC100%1/1
$filter ||= {}
$filter
Truth table100%2/2
A
A= $filter
| |||||||||||||||||||||||||||||||||
| 121 | 18 | ▶ | $params ||= {}; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params ||= {}
MC/DC100%1/1
$params ||= {}
$params
Truth table100%2/2
A
A= $params
| |||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||
| 123 | 18 | $url = add_filters_to_url( $url, $filter ); | |||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||
| 125 | 18 | ▶ | if ( exists $params->{'sort'} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 126 | 4 | ▶ | $params->{'order'} ||= 'asc'; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params->{"order"} ||= "asc"
MC/DC100%1/1
$params->{"order"} ||= "asc"
$params->{"order"}
Truth table100%2/2
A
A= $params->{"order"}
| |||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||
| 129 | 18 | my $uri = URI->new($url); | |||||||||||||||||||||||||||||||
| 130 | 18 | ▶ | while ( my ( $key, $value ) = each %{$params} ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 131 | 8 | $uri->query_param( $key => $value ); | |||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||
| 134 | 18 | return $uri->as_string; | |||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||
| 138 | 5 | 1; | |||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||
| 140 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||
| 142 | WWW::GoDaddy::REST::Util - Mostly URL tweaking utilities for this package | ||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||
| 144 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||
| 146 | use WWW::GoDaddy::REST::Util qw/ abs_url add_filters_to_url /; | ||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||
| 148 | # http://example.com/v1/asdf | ||||||||||||||||||||||||||||||||
| 149 | abs_url('http://example.com/v1','/asdf'); | ||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||
| 151 | # http://example.com?sort=asc&fname=Fred | ||||||||||||||||||||||||||||||||
| 152 | add_filters_to_url('http://example.com?sort=asc',{ 'fname' => [ { 'value': 'Fred' } ] }); | ||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||
| 154 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||
| 156 | Utilities used commonly in this package. Most have to do with URL manipulation. | ||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||
| 158 | =head1 FUNCTIONS | ||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||
| 160 | =over 4 | ||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||
| 162 | =item is_json | ||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||
| 164 | Given a json string, return true if it is parsable, false otherwise. | ||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||
| 166 | If you need to control the parameters to the L<JSON> module, simply | ||||||||||||||||||||||||||||||||
| 167 | pass additional parameters. These will be passed unchanged to C<json_instance>. | ||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||
| 169 | Example: | ||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||
| 171 | my $yes = is_json('"asdf"'); | ||||||||||||||||||||||||||||||||
| 172 | my $yes = is_json('{"key":"value"}'); | ||||||||||||||||||||||||||||||||
| 173 | my $no = is_json('dafsafsadfsdaf'); | ||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||
| 175 | =item json_decode | ||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||
| 177 | Given a json string, return the perl data structure. This will C<die()> if it | ||||||||||||||||||||||||||||||||
| 178 | can not be parsed. | ||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||
| 180 | If you need to control the parameters to the L<JSON> module, simply | ||||||||||||||||||||||||||||||||
| 181 | pass additional parameters. These will be passed unchanged to C<json_instance>. | ||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||
| 183 | Example: | ||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||
| 185 | my $hashref = json_decode('{"key":"value"}'); | ||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||
| 187 | =item json_encode | ||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||
| 189 | Given a perl data structure, return the json string. This will C<die()> if it | ||||||||||||||||||||||||||||||||
| 190 | can not be serialized. | ||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||
| 192 | If you need to control the parameters to the L<JSON> module, simply | ||||||||||||||||||||||||||||||||
| 193 | pass additional parameters. These will be passed unchanged to C<json_instance>. | ||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||
| 195 | Example: | ||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||
| 197 | my $json = json_encode({ 'key' => 'value' }); | ||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||
| 199 | =item json_instance | ||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||
| 201 | Returns C<JSON> instance. If no parameters are given the following | ||||||||||||||||||||||||||||||||
| 202 | defaults are set: C<convert_blessed>, C<allow_nonref>. | ||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||
| 204 | If called with one parameter, it is assumed to be a C<JSON> instance | ||||||||||||||||||||||||||||||||
| 205 | and this is returned instead of building a new one. | ||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||
| 207 | If called with more than one parameter, it is assumed to be key/value | ||||||||||||||||||||||||||||||||
| 208 | pairs and will be passed to the JSON C<property> method two by two. | ||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||
| 210 | Example: | ||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||
| 212 | $j = json_instance(); #defaults | ||||||||||||||||||||||||||||||||
| 213 | $j = json_instance( JSON->new ); #pass through | ||||||||||||||||||||||||||||||||
| 214 | $j = json_instance( 'convert_blessed' => 1, 'allow_nonref' => 1 ); # set properies | ||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||
| 216 | =item abs_url | ||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||
| 218 | Given a base and path fragment, generate an absolute url with the two | ||||||||||||||||||||||||||||||||
| 219 | joined. | ||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||
| 221 | Example: | ||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||
| 223 | # http://example.com/v1/asdf | ||||||||||||||||||||||||||||||||
| 224 | abs_url('http://example.com/v1','/asdf'); | ||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||
| 226 | =item add_filters_to_url | ||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||
| 228 | Given a url and a query filter, generate a url with the filter | ||||||||||||||||||||||||||||||||
| 229 | query parameters added. | ||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||
| 231 | Filter syntax can be seen in the docs for L<WWW::GoDaddy::REST>. | ||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||
| 233 | Example: | ||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||
| 235 | add_filters_to_url('http://example.com?sort=asc',{ 'fname' => [ { 'value': 'Fred' } ] }); | ||||||||||||||||||||||||||||||||
| 236 | # http://example.com?sort=asc&fname=Fred | ||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||
| 238 | =item build_complex_query_url | ||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||
| 240 | Return a modified URL string given a URL, an optional filter spec, and optional | ||||||||||||||||||||||||||||||||
| 241 | query parameter hash. | ||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||
| 243 | If you specify a sort, then an order parameter will be filled in if not present, and | ||||||||||||||||||||||||||||||||
| 244 | and sort or order query parameters in the input string will be replaced. | ||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||
| 246 | All other query parameters (filters etc) will be appended to the query parameters | ||||||||||||||||||||||||||||||||
| 247 | of the input URL instead of replacing. | ||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||
| 249 | Example: | ||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||
| 251 | build_complex_query_url( | ||||||||||||||||||||||||||||||||
| 252 | 'http://example.com', | ||||||||||||||||||||||||||||||||
| 253 | { | ||||||||||||||||||||||||||||||||
| 254 | 'foo' => 'bar' | ||||||||||||||||||||||||||||||||
| 255 | }, | ||||||||||||||||||||||||||||||||
| 256 | { | ||||||||||||||||||||||||||||||||
| 257 | 'sort' => 'surname' | ||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||
| 259 | ); | ||||||||||||||||||||||||||||||||
| 260 | # http://example.com?foo=bar&sort=surname&order=asc | ||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||
| 262 | =back | ||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||
| 264 | =head1 EXPORTS | ||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||
| 266 | None by default. | ||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||
| 268 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||
| 270 | David Bartle, C<< <davidb@mediatemple.net> >> | ||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||
| 272 | =head1 COPYRIGHT & LICENSE | ||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||
| 274 | Copyright (c) 2014 Go Daddy Operating Company, LLC | ||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||
| 276 | Permission is hereby granted, free of charge, to any person obtaining a | ||||||||||||||||||||||||||||||||
| 277 | copy of this software and associated documentation files (the "Software"), | ||||||||||||||||||||||||||||||||
| 278 | to deal in the Software without restriction, including without limitation | ||||||||||||||||||||||||||||||||
| 279 | the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||||||||||||||||||||||||||||||
| 280 | and/or sell copies of the Software, and to permit persons to whom the | ||||||||||||||||||||||||||||||||
| 281 | Software is furnished to do so, subject to the following conditions: | ||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||
| 283 | The above copyright notice and this permission notice shall be included in | ||||||||||||||||||||||||||||||||
| 284 | all copies or substantial portions of the Software. | ||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||
| 286 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||||||||||||||||||||||||||||||
| 287 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||||||||||||||||||||||||||||||
| 288 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||||||||||||||||||||||||||||||||
| 289 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||||||||||||||||||||||||||||||
| 290 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||||||||||||||||||||||||||||||||
| 291 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||||||||||||||||||||||||||||||
| 292 | DEALINGS IN THE SOFTWARE. | ||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||
| 294 | =cut | ||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||