Skip to content
Snippets Groups Projects
Commit c4a693b0 authored by Anton Soldatov's avatar Anton Soldatov
Browse files

Redminer renamed to WebService::Redmine (Credits to an anonymous user at...

Redminer renamed to WebService::Redmine (Credits to an anonymous user at http://prepan.org/module/nXWJ8Y9sBDB#comments)
parent 9908c135
No related branches found
No related tags found
No related merge requests found
Revision history for Perl extension Redminer (initially RedMiner::API). Revision history for Perl extension WebService::Redmine (initially RedMiner::API).
Please see full revision history at https://github.com/igelhaus/redminer/releases Please see full revision history at https://github.com/igelhaus/redminer/releases
......
...@@ -8,4 +8,4 @@ t/02-realworld.t ...@@ -8,4 +8,4 @@ t/02-realworld.t
t/03-realworld-no-wrapping.t t/03-realworld-no-wrapping.t
t/04-pod.t t/04-pod.t
t/05-pod-coverage.t t/05-pod-coverage.t
lib/Redminer.pm lib/WebService/Redmine.pm
...@@ -2,8 +2,8 @@ use 5.010; ...@@ -2,8 +2,8 @@ use 5.010;
use ExtUtils::MakeMaker; use ExtUtils::MakeMaker;
WriteMakefile( WriteMakefile(
NAME => 'Redminer', NAME => 'WebService::Redmine',
VERSION_FROM => 'lib/Redminer.pm', VERSION_FROM => 'lib/WebService/Redmine.pm',
BUILD_REQUIRES => { BUILD_REQUIRES => {
'ExtUtils::MakeMaker' => 0, 'ExtUtils::MakeMaker' => 0,
'Test::More' => 0, 'Test::More' => 0,
...@@ -17,7 +17,7 @@ WriteMakefile( ...@@ -17,7 +17,7 @@ WriteMakefile(
'JSON::XS' => 0, 'JSON::XS' => 0,
}, },
($] >= 5.005 ? ( ## Add these new keywords supported since 5.005 ($] >= 5.005 ? ( ## Add these new keywords supported since 5.005
ABSTRACT_FROM => 'lib/Redminer.pm', ABSTRACT_FROM => 'lib/WebService/Redmine.pm',
AUTHOR => 'Anton Soldatov <igelhaus@gmail.com>') AUTHOR => 'Anton Soldatov <igelhaus@gmail.com>')
: ()), : ()),
); );
...@@ -6,8 +6,8 @@ Currently the project consists of two parts: ...@@ -6,8 +6,8 @@ Currently the project consists of two parts:
1. `redminer` script itself. For now it supports only creating projects with subprojects 1. `redminer` script itself. For now it supports only creating projects with subprojects
from a given layout, but in the future it's aimed for various RedMine automation tasks from a given layout, but in the future it's aimed for various RedMine automation tasks
2. `Redminer` module, a Perl binding to [RedMine REST API](http://www.redmine.org/projects/redmine/wiki/Rest_api). 2. `WebService::Redmine` module, a Perl binding to [RedMine REST API](http://www.redmine.org/projects/redmine/wiki/Rest_api).
Please refer to [built-in POD documentation](../master/lib/Redminer.pm) for more details Please refer to [built-in POD documentation](../master/lib/WebService/Redmine.pm) for more details
## Installation ## Installation
......
package Redminer; package WebService::Redmine;
use 5.010; use 5.010;
use strict; use strict;
...@@ -18,17 +18,17 @@ use Encode qw/decode/; ...@@ -18,17 +18,17 @@ use Encode qw/decode/;
=head1 NAME =head1 NAME
Redminer - Wrapper for RedMine REST API (http://www.redmine.org/projects/redmine/wiki/Rest_api). WebService::Redmine - Wrapper for RedMine REST API (http://www.redmine.org/projects/redmine/wiki/Rest_api).
=head1 SYNOPSIS =head1 SYNOPSIS
use Redminer; use WebService::Redmine;
my $redminer = Redminer->new( my $redminer = WebService::Redmine->new(
host => 'example.com/redmine', host => 'example.com/redmine',
key => 'xxx', key => 'xxx',
); );
# password-based auth is also supported: # password-based auth is also supported:
#my $redminer = Redminer->new( #my $redminer = WebService::Redmine->new(
# host => 'example.com/redmine', # host => 'example.com/redmine',
# user => 'redminer', # user => 'redminer',
# pass => 'p@s$w0rD', # pass => 'p@s$w0rD',
...@@ -37,7 +37,7 @@ Redminer - Wrapper for RedMine REST API (http://www.redmine.org/projects/redmine ...@@ -37,7 +37,7 @@ Redminer - Wrapper for RedMine REST API (http://www.redmine.org/projects/redmine
my $project = $redminer->createProject({ project => { my $project = $redminer->createProject({ project => {
identifier => 'my-project', identifier => 'my-project',
name => 'My Project', name => 'My Project',
description => 'My project, created with *Redminer*', description => 'My project, created with *WebService::Redmine*',
}}); }});
if (!$project) { if (!$project) {
say STDERR 'Error(s) creating project: ', join("\n", map { $_ } @{ $redminer->errorDetails->{errors} }); say STDERR 'Error(s) creating project: ', join("\n", map { $_ } @{ $redminer->errorDetails->{errors} });
...@@ -52,7 +52,7 @@ Redminer - Wrapper for RedMine REST API (http://www.redmine.org/projects/redmine ...@@ -52,7 +52,7 @@ Redminer - Wrapper for RedMine REST API (http://www.redmine.org/projects/redmine
my $issue = $redminer->createIssue({ issue => { my $issue = $redminer->createIssue({ issue => {
project_id => $project_id, project_id => $project_id,
subject => 'Test issue for Redminer', subject => 'Test issue for WebService::Redmine',
description => 'Issue description', description => 'Issue description',
}}); }});
...@@ -145,7 +145,7 @@ be retrieved using C<errorDetails> method: ...@@ -145,7 +145,7 @@ be retrieved using C<errorDetails> method:
=head2 new =head2 new
my $redminer = Redminer->new(%options); my $redminer = WebService::Redmine->new(%options);
Following options are recognized: Following options are recognized:
...@@ -189,7 +189,7 @@ By default RedMine API requires you to wrap you object data: ...@@ -189,7 +189,7 @@ By default RedMine API requires you to wrap you object data:
By default this module follows this convention. However, if you turn on By default this module follows this convention. However, if you turn on
the C<no_wrapper_object> flag the C<no_wrapper_object> flag
my $redminer = Redminer->new( my $redminer = WebService::Redmine->new(
host => 'example.com/redmine', host => 'example.com/redmine',
key => 'xxx', key => 'xxx',
no_wrapper_object => 1, no_wrapper_object => 1,
...@@ -516,13 +516,13 @@ between this module and Redmine::API are: ...@@ -516,13 +516,13 @@ between this module and Redmine::API are:
=item * =item *
B<Dependencies>. Redmine::API depends on Moo and REST::Client which in turn depends on B<Dependencies>. Redmine::API depends on Moo and REST::Client which in turn depends on
LWP::UserAgent, URI and possibly others. Redminer uses pure Perl OOP and LWP::UserAgent, URI and possibly others. WebService::Redmine uses pure Perl OOP and
depends directly on LWP::UserAgent and URI. depends directly on LWP::UserAgent and URI.
=item * =item *
B<Call conventions>. Although both modules use dynamic dispatching for building actual HTTP B<Call conventions>. Although both modules use dynamic dispatching for building actual HTTP
requests, they do it in a different manner. In particular, Redminer tries to requests, they do it in a different manner. In particular, WebService::Redmine tries to
dispatch a single method name without using chains of interrim objects as Redmine::API does. dispatch a single method name without using chains of interrim objects as Redmine::API does.
=back =back
......
...@@ -11,7 +11,7 @@ use Encode qw/encode/; ...@@ -11,7 +11,7 @@ use Encode qw/encode/;
use Getopt::Long; use Getopt::Long;
use Config::IniFiles; use Config::IniFiles;
use Redminer; use WebService::Redmine;
my $conf_fname = $ENV{HOME} . '/.redminer/redminer.conf'; my $conf_fname = $ENV{HOME} . '/.redminer/redminer.conf';
my $layout_fname = $ENV{HOME} . '/.redminer/default-layout.conf'; my $layout_fname = $ENV{HOME} . '/.redminer/default-layout.conf';
...@@ -44,7 +44,7 @@ if (!$layout) { ...@@ -44,7 +44,7 @@ if (!$layout) {
warn 'Unable to access layout config'; warn 'Unable to access layout config';
} }
my $redminer = Redminer->new( my $redminer = WebService::Redmine->new(
host => $conf->val('redmine', 'host') // '', host => $conf->val('redmine', 'host') // '',
user => $conf->val('redmine', 'user') // '', user => $conf->val('redmine', 'user') // '',
pass => $conf->val('redmine', 'pass') // '', pass => $conf->val('redmine', 'pass') // '',
......
...@@ -3,6 +3,6 @@ use warnings; ...@@ -3,6 +3,6 @@ use warnings;
use Test::More tests => 1; use Test::More tests => 1;
BEGIN { use_ok('Redminer') }; BEGIN { use_ok('WebService::Redmine') };
exit; exit;
...@@ -3,12 +3,12 @@ use warnings; ...@@ -3,12 +3,12 @@ use warnings;
use Test::More tests => 29; use Test::More tests => 29;
eval 'use Redminer'; eval 'use WebService::Redmine';
# #
# Testing internal name dispatching with a dummy object # Testing internal name dispatching with a dummy object
# #
my $redminer = Redminer->new( my $redminer = WebService::Redmine->new(
host => '', host => '',
key => '', key => '',
); );
......
...@@ -10,7 +10,7 @@ if ($ENV{REDMINER_DEVEL}) { ...@@ -10,7 +10,7 @@ if ($ENV{REDMINER_DEVEL}) {
plan skip_all => 'Development tests (REDMINER_DEVEL not set)'; plan skip_all => 'Development tests (REDMINER_DEVEL not set)';
} }
eval 'use Redminer'; eval 'use WebService::Redmine';
# #
# Read API key from a simple config file in the format 'host;key' # Read API key from a simple config file in the format 'host;key'
...@@ -29,7 +29,7 @@ my $key_data = <$FH_key>; ...@@ -29,7 +29,7 @@ my $key_data = <$FH_key>;
chomp $key_data; chomp $key_data;
close $FH_key; close $FH_key;
my $redminer = Redminer->new( my $redminer = WebService::Redmine->new(
host => $host, host => $host,
key => $key, key => $key,
); );
...@@ -50,7 +50,7 @@ ok($redminer->updateProject($project_id, { project => { inherit_members => 1 } } ...@@ -50,7 +50,7 @@ ok($redminer->updateProject($project_id, { project => { inherit_members => 1 } }
my $issue = $redminer->createIssue({ issue => { my $issue = $redminer->createIssue({ issue => {
project_id => $project_id, project_id => $project_id,
subject => 'Test issue for Redminer', subject => 'Test issue for WebService::Redmine',
description => 'Test description', description => 'Test description',
}}); }});
ok(defined $issue->{issue}{id}, 'Issue created with ID #' . $issue->{issue}{id}); ok(defined $issue->{issue}{id}, 'Issue created with ID #' . $issue->{issue}{id});
......
...@@ -10,7 +10,7 @@ if ($ENV{REDMINER_DEVEL}) { ...@@ -10,7 +10,7 @@ if ($ENV{REDMINER_DEVEL}) {
plan skip_all => 'Development tests (REDMINER_DEVEL not set)'; plan skip_all => 'Development tests (REDMINER_DEVEL not set)';
} }
eval 'use Redminer'; eval 'use WebService::Redmine';
# #
# Read API key from a simple config file in the format 'host;key' # Read API key from a simple config file in the format 'host;key'
...@@ -29,7 +29,7 @@ my $key_data = <$FH_key>; ...@@ -29,7 +29,7 @@ my $key_data = <$FH_key>;
chomp $key_data; chomp $key_data;
close $FH_key; close $FH_key;
my $redminer = Redminer->new( my $redminer = WebService::Redmine->new(
host => $host, host => $host,
key => $key, key => $key,
no_wrapper_object => 1, no_wrapper_object => 1,
...@@ -51,7 +51,7 @@ ok($redminer->updateProject($project_id, { inherit_members => 1 }), 'Project upd ...@@ -51,7 +51,7 @@ ok($redminer->updateProject($project_id, { inherit_members => 1 }), 'Project upd
my $issue = $redminer->createIssue({ my $issue = $redminer->createIssue({
project_id => $project_id, project_id => $project_id,
subject => 'Test issue for Redminer', subject => 'Test issue for WebService::Redmine',
description => 'Test description', description => 'Test description',
}); });
ok(defined $issue->{id}, 'Issue created with ID #' . $issue->{id}); ok(defined $issue->{id}, 'Issue created with ID #' . $issue->{id});
......
...@@ -8,4 +8,4 @@ plan skip_all => 'Test::Pod::Coverage required for testing pod coverage' if $@; ...@@ -8,4 +8,4 @@ plan skip_all => 'Test::Pod::Coverage required for testing pod coverage' if $@;
plan tests => 1; plan tests => 1;
pod_coverage_ok('Redminer', 'Redminer POD ok'); pod_coverage_ok('WebService::Redmine', 'WebService::Redmine POD ok');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment