Sorauta-SVN-AutoCommit

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

  $ssa->execute();

DEPENDENCIES

This module requires these other modules and libraries:

CGI::Carp
Data::Dumper
SVN::Agent
SVN::Agent::Dummy
Image::Magick
Sorauta::Utility

COPYRIGHT AND LICENCE

Put the correct copyright and licence information here.

Copyright (C) 2012 by Yuki ANAI

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.12.3 or,

lib/Sorauta/SVN/AutoCommit.pm  view on Meta::CPAN

use base qw/Class::Accessor::Fast/;

use 5.012003;
use strict;
use warnings;
use utf8;
use CGI::Carp qw/fatalsToBrowser/;
use Data::Dumper;
use SVN::Agent;
use SVN::Agent::Dummy;
use Image::Magick;
use Sorauta::Utility;

our $VERSION = '0.02';

# サムネイルの縦横
our($THUMBNAIL_WIDTH, $THUMBNAIL_HEIGHT) = (160, 90);

# コミット時のコメント
our $COMMIT_COMMENT = "auto commit from Sorauta::SVN::AutoCommit";

lib/Sorauta/SVN/AutoCommit.pm  view on Meta::CPAN

# サムネイルを生成する
# req:
#   sa: SVN::Agentのインスタンス
#   original_file_path: 元ファイルのパス
#   thumbnail_file_path: サムネイルファイルのパス
# res:
#   result: null
#==========================================
sub _create_thumbnail_image {
  my($self, $sa, $original_file_path, $thumbnail_file_path) = @_;
  my $image = Image::Magick->new;

  # 元画像を読み込む
  print $image->Read(
    $original_file_path
  );

  # タテヨコ比率指定
  print $image->Resize(
    geometry => $self->thumbnail_width.'x'.$self->thumbnail_height
  );

t/Sorauta-SVN-AutoCommit.t  view on Meta::CPAN

use lib qw/lib/;
use Test::More tests => 4;
BEGIN { use_ok('Sorauta::SVN::AutoCommit') };

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

use_ok('SVN::Agent');
use_ok('Image::Magick');

my $ssa = Sorauta::SVN::AutoCommit->new;
ok($ssa, "create new instance");

# commit test
=pod
{
  my $SVN_MODE = "auto_commit";
  my $SVN_WORK_DIR = "/Users/user/Desktop/svn_dir";
  my $DEBUG = 0;



( run in 0.365 second using v1.01-cache-2.11-cpan-beeb90c9504 )