Skip to content

Commit

Permalink
Merge pull request #29 from ipinfo/usama/inline-json-data
Browse files Browse the repository at this point in the history
Inline Data Files
  • Loading branch information
UmanShahzad authored Nov 23, 2023
2 parents aa65228 + 5055766 commit 11857b8
Show file tree
Hide file tree
Showing 13 changed files with 1,177 additions and 914 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd_cpan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Test and build
run: |
cd Geo-IPinfo
cpanm ExtUtils::MakeMaker LWP::UserAgent JSON File::ShareDir::Install Cache::LRU File::Share Net::CIDR::Lite
cpanm ExtUtils::MakeMaker LWP::UserAgent JSON File::ShareDir::Install Cache::LRU File::Share Net::CIDR Net::CIDR::Set
perl Makefile.PL && RELEASE_TESTING=TRUE make test && make distcheck && make dist
- name: Upload to CPAN
Expand Down
3 changes: 3 additions & 0 deletions Geo-IPinfo/Changes
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Revision history for Geo-IPinfo

2.1.3 Aug 09, 2023
Enabled JSON encoding and updated docs

3.0.0 Nov 22, 2023
Inlined data files
5 changes: 0 additions & 5 deletions Geo-IPinfo/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ t/manifest.t
t/pod-coverage.t
t/pod.t
xt/boilerplate.t
share/countries.json
share/continent.json
share/currency.json
share/eu.json
share/flags.json
3 changes: 2 additions & 1 deletion Geo-IPinfo/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ WriteMakefile(
'File::ShareDir::Install' => '0',
'Cache::LRU' => '0',
'File::Share' => '0',
'Net::CIDR::Lite' => '0',
'Net::CIDR' => '0',
'Net::CIDR::Set' => '0',
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Geo-IPinfo-*' },
Expand Down
8 changes: 6 additions & 2 deletions Geo-IPinfo/lib/Geo/Details.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ sub new {
return $data;
}

# If $data is a plain string, create a new hash reference and set the specified key to the string value.
# Use the provided key or default to ''.
# If $data is a plain string, create a new hash reference and set the specified key to the string value.
# Use the provided key or default to ''.
my $self = { $key => $data };
bless $self, $class;
return $self;
Expand Down Expand Up @@ -173,6 +173,10 @@ Creates a new Geo::Details object. If C<$data> is a hash reference, it directly
C<$key> is an optional parameter used when C<$data> is a plain string. It defaults to an empty string if not provided.
=head2 TO_JSON
This method is used to convert the object to a JSON representation.
=head2 abuse
my $abuse_email = $geo_details->abuse();
Expand Down
Loading

0 comments on commit 11857b8

Please sign in to comment.