[Bps-public-commit] net-lighthouse branch, master, updated. a2aac351ebbdcf771ff12cca23050cc801a30ed5
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Sep 8 22:36:51 EDT 2009
The branch, master has been updated
via a2aac351ebbdcf771ff12cca23050cc801a30ed5 (commit)
from c4ce0ac3b1e0622684cf05460fde051fbd406a5a (commit)
Summary of changes:
Makefile.PL | 11 ++++++++---
README | 2 +-
lib/Net/Lighthouse.pm | 2 +-
lib/Net/Lighthouse/Util.pm | 16 ++++++++++++++--
4 files changed, 24 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit a2aac351ebbdcf771ff12cca23050cc801a30ed5
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Sep 9 10:36:47 2009 +0800
people can choose either YAML::Syck or YAML
diff --git a/Makefile.PL b/Makefile.PL
index 3c689a6..a30871a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -10,12 +10,17 @@ requires 'Params::Validate';
requires 'XML::Simple';
requires 'LWP';
requires 'MIME::Base64';
-requires 'YAML::Syck';
requires 'DateTime';
requires 'URI::Escape';
-eval { require Moose };
-if ($@) {
+if ( can_cc() ) {
+ requires 'YAML::Syck';
+}
+else {
+ requires 'YAML' unless can_use( 'YAML::Syck' );
+}
+
+unless ( can_use('Moose') ) {
requires 'Mouse' => 0.28;
}
diff --git a/README b/README
index a5b02ad..22ce634 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Net-Lighthouse version 0.01
+Net-Lighthouse version
INSTALLATION
diff --git a/lib/Net/Lighthouse.pm b/lib/Net/Lighthouse.pm
index 32691ba..de00a08 100644
--- a/lib/Net/Lighthouse.pm
+++ b/lib/Net/Lighthouse.pm
@@ -51,7 +51,7 @@ Net::Lighthouse - Perl interface to lighthouseapp.com
=head1 VERSION
-This document describes Net::Lighthouse version 0.01
+This document describes Net::Lighthouse version 0.02
=head1 SYNOPSIS
diff --git a/lib/Net/Lighthouse/Util.pm b/lib/Net/Lighthouse/Util.pm
index ac528d9..f46d91f 100644
--- a/lib/Net/Lighthouse/Util.pm
+++ b/lib/Net/Lighthouse/Util.pm
@@ -4,7 +4,19 @@ use warnings;
package Net::Lighthouse::Util;
use XML::Simple;
use DateTime;
-use YAML::Syck;
+
+BEGIN {
+ local $@;
+ eval { require YAML::Syck; };
+ if ($@) {
+ require YAML;
+ *_Load = *YAML::Load;
+ }
+ else {
+ *_Load = *YAML::Syck::Load;
+ }
+}
+
sub translate_from_xml {
my $class = shift;
@@ -30,7 +42,7 @@ sub translate_from_xml {
$class->datetime_from_string( $ref->{$k}{content} );
}
elsif ( $ref->{$k}{type} && $ref->{$k}{type} eq 'yaml' ) {
- $ref->{$k} = Load( $ref->{$k}{content} );
+ $ref->{$k} = _Load( $ref->{$k}{content} );
}
elsif ( $ref->{$k}{type} && $ref->{$k}{type} eq 'integer' ) {
$ref->{$k} =
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list