Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 41a4061

Browse files
refactor(release): prepare next semantic version release
1 parent e7f357a commit 41a4061

File tree

9 files changed

+471
-505
lines changed

9 files changed

+471
-505
lines changed

MYMETA.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
}
5050
},
5151
"release_status" : "stable",
52-
"version" : "1.12",
52+
"version" : "v1.12.1",
5353
"x_serialization_backend" : "JSON::PP version 2.27400_02"
5454
}

MYMETA.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ requires:
2727
LWP::UserAgent: '6.35'
2828
MIME::Base64: '0'
2929
Time::Local: '0'
30-
version: '1.12'
30+
version: v1.12.1
3131
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ DIRFILESEP = /
5858
DFSEP = $(DIRFILESEP)
5959
NAME = WebService::Hexonet::Connector
6060
NAME_SYM = WebService_Hexonet_Connector
61-
VERSION = 1.12
61+
VERSION = v1.12.1
6262
VERSION_MACRO = VERSION
63-
VERSION_SYM = 1_12
63+
VERSION_SYM = v1_12_1
6464
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
65-
XS_VERSION = 1.12
65+
XS_VERSION = v1.12.1
6666
XS_VERSION_MACRO = XS_VERSION
6767
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
6868
INST_ARCHLIB = blib/arch
@@ -265,7 +265,7 @@ RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
265265
DIST_CP = best
266266
DIST_DEFAULT = tardist
267267
DISTNAME = WebService-Hexonet-Connector
268-
DISTVNAME = WebService-Hexonet-Connector-1.12
268+
DISTVNAME = WebService-Hexonet-Connector-v1.12.1
269269

270270

271271
# --- MakeMaker macro section:
@@ -528,7 +528,7 @@ metafile : create_distdir
528528
$(NOECHO) $(ECHO) ' LWP::UserAgent: '\''6.35'\''' >> META_new.yml
529529
$(NOECHO) $(ECHO) ' MIME::Base64: '\''0'\''' >> META_new.yml
530530
$(NOECHO) $(ECHO) ' Time::Local: '\''0'\''' >> META_new.yml
531-
$(NOECHO) $(ECHO) 'version: '\''1.12'\''' >> META_new.yml
531+
$(NOECHO) $(ECHO) 'version: v1.12.1' >> META_new.yml
532532
$(NOECHO) $(ECHO) 'x_serialization_backend: '\''CPAN::Meta::YAML version 0.018'\''' >> META_new.yml
533533
-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
534534
$(NOECHO) $(ECHO) Generating META.json
@@ -583,7 +583,7 @@ metafile : create_distdir
583583
$(NOECHO) $(ECHO) ' }' >> META_new.json
584584
$(NOECHO) $(ECHO) ' },' >> META_new.json
585585
$(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json
586-
$(NOECHO) $(ECHO) ' "version" : "1.12",' >> META_new.json
586+
$(NOECHO) $(ECHO) ' "version" : "v1.12.1",' >> META_new.json
587587
$(NOECHO) $(ECHO) ' "x_serialization_backend" : "JSON::PP version 2.27400_02"' >> META_new.json
588588
$(NOECHO) $(ECHO) '}' >> META_new.json
589589
-$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json
@@ -869,7 +869,7 @@ testdb_static :: static pure_all
869869
# --- MakeMaker ppd section:
870870
# Creates a PPD (Perl Package Description) for a binary distribution.
871871
ppd :
872-
$(NOECHO) $(ECHO) '<SOFTPKG NAME="WebService-Hexonet-Connector" VERSION="1.12">' > WebService-Hexonet-Connector.ppd
872+
$(NOECHO) $(ECHO) '<SOFTPKG NAME="WebService-Hexonet-Connector" VERSION="v1.12.1">' > WebService-Hexonet-Connector.ppd
873873
$(NOECHO) $(ECHO) ' <ABSTRACT>Connector library for the insanely fast L&lt;HEXONET Backend API|https://www.hexonet.net/&gt;.</ABSTRACT>' >> WebService-Hexonet-Connector.ppd
874874
$(NOECHO) $(ECHO) ' <AUTHOR>hexonet &lt;[email protected]&gt;</AUTHOR>' >> WebService-Hexonet-Connector.ppd
875875
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> WebService-Hexonet-Connector.ppd

lib/WebService/Hexonet.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use strict;
55
use warnings;
66
use WebService::Hexonet::Connector;
77

8-
our $VERSION = '1.12';
8+
our $VERSION = 'v1.12.1';
99

1010
1;
1111

lib/WebService/Hexonet/Connector.pm

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ use strict;
55
use warnings;
66
use WebService::Hexonet::Connector::Connection;
77

8-
our $VERSION = '1.12';
8+
our $VERSION = 'v1.12.1';
9+
910

1011
sub connect {
11-
return WebService::Hexonet::Connector::Connection->new(@_);
12+
return WebService::Hexonet::Connector::Connection->new(@_);
1213
}
1314

1415
1;

lib/WebService/Hexonet/Connector/Connection.pm

+77-82
Original file line numberDiff line numberDiff line change
@@ -7,111 +7,106 @@ use WebService::Hexonet::Connector::Util;
77
use LWP::UserAgent;
88
use Data::Dumper;
99

10-
our $VERSION = '1.12';
10+
our $VERSION = 'v1.12.1';
11+
1112

1213
sub new {
13-
my $class = shift;
14-
my $self = shift;
15-
foreach my $key (%$self) {
16-
my $value = $self->{$key};
17-
delete $self->{$key};
18-
$self->{ lc $key } = $value;
19-
}
20-
$self->{"debugMode"} = 0;
21-
return bless $self, $class;
14+
my $class = shift;
15+
my $self = shift;
16+
foreach my $key (%$self) {
17+
my $value = $self->{$key};
18+
delete $self->{$key};
19+
$self->{ lc $key } = $value;
20+
}
21+
$self->{"debugMode"} = 0;
22+
return bless $self, $class;
2223
}
2324

25+
2426
sub enableDebugMode {
25-
my $self = shift;
26-
$self->{"debugMode"} = 1;
27+
my $self = shift;
28+
$self->{"debugMode"} = 1;
2729
}
2830

31+
2932
sub disableDebugMode {
30-
my $self = shift;
31-
$self->{"debugMode"} = 0;
33+
my $self = shift;
34+
$self->{"debugMode"} = 0;
3235
}
3336

37+
3438
sub call {
35-
my $self = shift;
36-
my $command = shift;
37-
my $config = shift;
38-
return WebService::Hexonet::Connector::Response->new(
39-
$self->call_raw( $command, $config ) );
39+
my $self = shift;
40+
my $command = shift;
41+
my $config = shift;
42+
return WebService::Hexonet::Connector::Response->new($self->call_raw( $command, $config ) );
4043
}
4144

45+
4246
sub call_raw {
43-
my $self = shift;
44-
my $command = shift;
45-
my $config = shift;
47+
my $self = shift;
48+
my $command = shift;
49+
my $config = shift;
4650

47-
$config = {} if !defined $config;
48-
$config = { User => $config } if ( defined $config ) && ( !ref $config );
51+
$config = {} if !defined $config;
52+
$config = { User => $config } if ( defined $config ) && ( !ref $config );
4953

50-
#TODO check above line if we still need it; $config should always be defined
51-
#because of the line before, so that at least the if branch can be reviewed
54+
#TODO check above line if we still need it; $config should always be defined
55+
#because of the line before, so that at least the if branch can be reviewed
5256

53-
return $self->call_raw_http( $command, $config );
57+
return $self->call_raw_http( $command, $config );
5458
}
5559

60+
5661
sub call_raw_http {
57-
my $self = shift;
58-
my $command = shift;
59-
my $config = shift;
60-
61-
my $ua = $self->_get_useragent();
62-
63-
my $url = $self->{url};
64-
my $post = {
65-
s_command => (
66-
scalar WebService::Hexonet::Connector::Util::command_encode(
67-
$command)
68-
)
69-
};
70-
$post->{s_entity} = $self->{entity} if exists $self->{entity};
71-
$post->{s_login} = $self->{login} if exists $self->{login};
72-
$post->{s_pw} = $self->{password} if exists $self->{password};
73-
$post->{s_user} = $self->{user} if exists $self->{user};
74-
$post->{s_login} = $self->{login} . "!" . $self->{role}
75-
if ( exists $self->{login} ) && ( exists $self->{role} );
76-
77-
if ( exists $config->{user} ) {
78-
if ( exists $post->{s_user} ) {
79-
$post->{s_user} .= " " . $config->{user};
80-
}
81-
else {
82-
$post->{s_user} = $config->{user};
83-
}
84-
}
85-
my $r = $self->{_useragent}->post( $url, $post );
86-
if ( $r->is_success ) {
87-
$r = $r->decoded_content;
88-
}
89-
else {
90-
my $err = $r->status_line;
91-
$r =
92-
"[RESPONSE]\r\n"
93-
. "CODE=421\r\n"
94-
. "DESCRIPTION=HTTP communication failed;$err\r\n"
95-
. "EOF\r\n";
96-
97-
}
98-
if ( $self->{"debugMode"} ) {
99-
print STDERR Dumper($command);
100-
print STDERR Dumper($post);
101-
print STDERR Dumper($r);
102-
}
103-
return $r;
62+
my $self = shift;
63+
my $command = shift;
64+
my $config = shift;
65+
66+
my $ua = $self->_get_useragent();
67+
68+
my $url = $self->{url};
69+
my $post = {s_command => (scalar WebService::Hexonet::Connector::Util::command_encode($command))};
70+
$post->{s_entity} = $self->{entity} if exists $self->{entity};
71+
$post->{s_login} = $self->{login} if exists $self->{login};
72+
$post->{s_pw} = $self->{password} if exists $self->{password};
73+
$post->{s_user} = $self->{user} if exists $self->{user};
74+
$post->{s_login} = $self->{login} . "!" . $self->{role}
75+
if ( exists $self->{login} ) && ( exists $self->{role} );
76+
77+
if ( exists $config->{user} ) {
78+
if ( exists $post->{s_user} ) {
79+
$post->{s_user} .= " " . $config->{user};
80+
}else {
81+
$post->{s_user} = $config->{user};
82+
}
83+
}
84+
my $r = $self->{_useragent}->post( $url, $post );
85+
if ( $r->is_success ) {
86+
$r = $r->decoded_content;
87+
}else {
88+
my $err = $r->status_line;
89+
$r ="[RESPONSE]\r\n". "CODE=421\r\n". "DESCRIPTION=HTTP communication failed;$err\r\n". "EOF\r\n";
90+
91+
}
92+
if ( $self->{"debugMode"} ) {
93+
print STDERR Dumper($command);
94+
print STDERR Dumper($post);
95+
print STDERR Dumper($r);
96+
}
97+
return $r;
10498
}
10599

100+
106101
sub _get_useragent {
107-
my $self = shift;
108-
return $self->{_useragent} if exists $self->{_useragent};
109-
$self->{_useragent} = LWP::UserAgent->new(
110-
agent => "Hexonet-perl/$WebService::Hexonet::Connector::VERSION",
111-
keep_alive => 4,
112-
);
113-
$self->{_useragent}->default_header( 'Expect', '' );
114-
return $self->{_useragent};
102+
my $self = shift;
103+
return $self->{_useragent} if exists $self->{_useragent};
104+
$self->{_useragent} = LWP::UserAgent->new(
105+
agent => "Hexonet-perl/$WebService::Hexonet::Connector::VERSION",
106+
keep_alive => 4,
107+
);
108+
$self->{_useragent}->default_header( 'Expect', '' );
109+
return $self->{_useragent};
115110
}
116111

117112
1;

0 commit comments

Comments
 (0)