Skip to content

Commit

Permalink
support alternative domain through env for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Apr 23, 2016
1 parent d54e315 commit bf66f4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist.ini
Expand Up @@ -21,7 +21,7 @@ version = 1.013000
exclude_filename = cpanfile

[Prereqs]
Search::Elasticsearch = 1.10
Search::Elasticsearch = 2.02

[AutoPrereqs]
skip = ^t::lib::Functions$
Expand Down
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Client/Request.pm
Expand Up @@ -7,13 +7,14 @@ use Moo;
use Carp;
use JSON::MaybeXS qw<decode_json encode_json>;
use Search::Elasticsearch;
use Search::Elasticsearch::Scroll;
use Try::Tiny;
use HTTP::Tiny;

has domain => (
is => 'ro',
default => sub {'api.metacpan.org'},
default => sub {
return ( $ENV{METACPAN_DOMAIN} ? $ENV{METACPAN_DOMAIN} : 'api.metacpan.org' );
},
);

has version => (
Expand Down Expand Up @@ -304,4 +305,3 @@ Fetches a path from MetaCPAN (post or get), and returns the decoded result.
Calls an Elastic Search query (using L<Search::Elasticsearch> and returns an
L<Search::Elasticsearch::Scroll> scroller object.

0 comments on commit bf66f4c

Please sign in to comment.