Browse Source

Minor changes
Simplified main constructor;
Changed MIN_PERL_VERSION to 5.006;

Bosko Devetak 6 years ago
parent
commit
ca442137c1
3 changed files with 18 additions and 26 deletions
  1. 1 1
      Makefile.PL
  2. 10 10
      Makefile.old
  3. 7 15
      lib/HBase/JSONRest.pm

+ 1 - 1
Makefile.PL

@ -10,7 +10,7 @@ WriteMakefile(
10 10
    ABSTRACT_FROM    => 'lib/HBase/JSONRest.pm',
11 11
    LICENSE          => 'Artistic_2_0',
12 12
    PL_FILES         => {},
13
    MIN_PERL_VERSION => 5.010,
13
    MIN_PERL_VERSION => 5.006,
14 14
    CONFIGURE_REQUIRES => {
15 15
        'ExtUtils::MakeMaker' => 0,
16 16
    },

+ 10 - 10
Makefile.old

@ -16,7 +16,7 @@
16 16
#     BUILD_REQUIRES => { Test::More=>q[0] }
17 17
#     CONFIGURE_REQUIRES => { ExtUtils::MakeMaker=>q[0] }
18 18
#     LICENSE => q[Artistic_2_0]
19
#     MIN_PERL_VERSION => q[5.01]
19
#     MIN_PERL_VERSION => q[5.006]
20 20
#     NAME => q[HBase::JSONRest]
21 21
#     PL_FILES => {  }
22 22
#     PREREQ_PM => { Test::More=>q[0], URI::Escape=>q[0], MIME::Base64=>q[0], HTTP::Tiny=>q[0], Data::Dumper=>q[0], JSON::XS=>q[0], Time::HiRes=>q[0] }
@ -61,11 +61,11 @@ DIRFILESEP = /
61 61
DFSEP = $(DIRFILESEP)
62 62
NAME = HBase::JSONRest
63 63
NAME_SYM = HBase_JSONRest
64
VERSION = 0.1
64
VERSION = 0.001
65 65
VERSION_MACRO = VERSION
66
VERSION_SYM = 0_1
66
VERSION_SYM = 0_001
67 67
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
68
XS_VERSION = 0.1
68
XS_VERSION = 0.001
69 69
XS_VERSION_MACRO = XS_VERSION
70 70
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
71 71
INST_ARCHLIB = blib/arch
@ -259,7 +259,7 @@ RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
259 259
DIST_CP = best
260 260
DIST_DEFAULT = tardist
261 261
DISTNAME = HBase-JSONRest
262
DISTVNAME = HBase-JSONRest-0.1
262
DISTVNAME = HBase-JSONRest-0.001
263 263
264 264
265 265
# --- MakeMaker macro section:
@ -505,8 +505,8 @@ metafile : create_distdir
505 505
	$(NOECHO) $(ECHO) '  MIME::Base64: 0' >> META_new.yml
506 506
	$(NOECHO) $(ECHO) '  Time::HiRes: 0' >> META_new.yml
507 507
	$(NOECHO) $(ECHO) '  URI::Escape: 0' >> META_new.yml
508
	$(NOECHO) $(ECHO) '  perl: 5.01' >> META_new.yml
509
	$(NOECHO) $(ECHO) 'version: 0.1' >> META_new.yml
508
	$(NOECHO) $(ECHO) '  perl: 5.006' >> META_new.yml
509
	$(NOECHO) $(ECHO) 'version: 0.001' >> META_new.yml
510 510
	-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
511 511
	$(NOECHO) $(ECHO) Generating META.json
512 512
	$(NOECHO) $(ECHO) '{' > META_new.json
@ -549,12 +549,12 @@ metafile : create_distdir
549 549
	$(NOECHO) $(ECHO) '            "MIME::Base64" : "0",' >> META_new.json
550 550
	$(NOECHO) $(ECHO) '            "Time::HiRes" : "0",' >> META_new.json
551 551
	$(NOECHO) $(ECHO) '            "URI::Escape" : "0",' >> META_new.json
552
	$(NOECHO) $(ECHO) '            "perl" : "5.01"' >> META_new.json
552
	$(NOECHO) $(ECHO) '            "perl" : "5.006"' >> META_new.json
553 553
	$(NOECHO) $(ECHO) '         }' >> META_new.json
554 554
	$(NOECHO) $(ECHO) '      }' >> META_new.json
555 555
	$(NOECHO) $(ECHO) '   },' >> META_new.json
556 556
	$(NOECHO) $(ECHO) '   "release_status" : "stable",' >> META_new.json
557
	$(NOECHO) $(ECHO) '   "version" : "0.1"' >> META_new.json
557
	$(NOECHO) $(ECHO) '   "version" : "0.001"' >> META_new.json
558 558
	$(NOECHO) $(ECHO) '}' >> META_new.json
559 559
	-$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json
560 560
@ -854,7 +854,7 @@ ppd :
854 854
	$(NOECHO) $(ECHO) '    <ABSTRACT>Simple REST client for HBase</ABSTRACT>' >> $(DISTNAME).ppd
855 855
	$(NOECHO) $(ECHO) '    <AUTHOR>Bosko Devetak &lt;bosko.devetak@gmail.com&gt;</AUTHOR>' >> $(DISTNAME).ppd
856 856
	$(NOECHO) $(ECHO) '    <IMPLEMENTATION>' >> $(DISTNAME).ppd
857
	$(NOECHO) $(ECHO) '        <PERLCORE VERSION="5,01,0,0" />' >> $(DISTNAME).ppd
857
	$(NOECHO) $(ECHO) '        <PERLCORE VERSION="5,006,0,0" />' >> $(DISTNAME).ppd
858 858
	$(NOECHO) $(ECHO) '        <REQUIRE NAME="Data::Dumper" />' >> $(DISTNAME).ppd
859 859
	$(NOECHO) $(ECHO) '        <REQUIRE NAME="HTTP::Tiny" />' >> $(DISTNAME).ppd
860 860
	$(NOECHO) $(ECHO) '        <REQUIRE NAME="JSON::XS" />' >> $(DISTNAME).ppd

+ 7 - 15
lib/HBase/JSONRest.pm

@ -25,25 +25,17 @@ my %INFO_ROUTES = (
25 25
# Class Methods
26 26
#
27 27
sub new {
28
29 28
    my $class = shift;
30
    $class = ref $class if ref $class;
31
32
    my $params = (ref $_[0] eq 'HASH') ? shift : {@_};
33
34
    my $service_host = delete $params->{service_host}
35
        || die "Need a service_host";
36
37
    my $port = delete $params->{port} || 8080;
29
    my %params = @_;
38 30
39
    my $self;
31
    die "Need a service host!"
32
        if ! defined $params{host};
40 33
41
    $self->{service} = "http://$service_host:$port";
42
    $self->{host} = $service_host;
43
    $self->{port} = $port;
34
    $params{port} ||= 8080;
44 35
45
    return bless ($self, $class);
36
    $params{service} = "http://" . $params{host} . ":" . $params{port};
46 37
38
    return bless {%params}, $class;
47 39
}
48 40
49 41
@ -341,7 +333,7 @@ HBase::JSONRest - Simple REST client for HBase
341 333
342 334
A simple get request:
343 335
344
    my $hbase = HBase::JSONRest->new(service_host => $hostname);
336
    my $hbase = HBase::JSONRest->new(host => $hostname);
345 337
346 338
    my ($records, $err) = $hbase->get(
347 339
        table   => 'table_name',