DBIx-Class-TimeStamp-WithTimeZone

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension DBIx::Class::TimeStamp::WithTimeZone.


0.03  Sat Jan  2 13:53:05 CET 2016
	- fix build dependencies
	- include proper perldoc

0.02  Thu May 21 18:00:53 CEST 2015
	- changed default timezone to GMT

0.01  Tue Feb 15 03:20:06 2011
	- original version; created by h2xs 1.23 with options
		-AXc -n DBIx::Class::TimeStamp::WithTimeZone

MANIFEST  view on Meta::CPAN

Changes
Makefile.PL
MANIFEST
README
t/DBIx-Class-TimeStamp-WithTimeZone.t
lib/DBIx/Class/TimeStamp/WithTimeZone.pm
META.yml                                 Module meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

META.json  view on Meta::CPAN

{
   "abstract" : "DBIx::Class::TimeStamp extension that uses a specified timezone",
   "author" : [
      "Javier Arturo Rodriguez <javier@rodriguez.org.mx>"
   ],
   "dynamic_config" : 1,
   "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150005",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : "2"
   },
   "name" : "DBIx-Class-TimeStamp-WithTimeZone",
   "no_index" : {
      "directory" : [
         "t",
         "inc"
      ]
   },
   "prereqs" : {
      "build" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "DBIx::Class::TimeStamp" : "0.14",
            "DateTime" : "1.18"
         }
      }
   },
   "release_status" : "stable",
   "version" : "0.03",
   "x_serialization_backend" : "JSON::PP version 2.27300"
}

META.yml  view on Meta::CPAN

---
abstract: 'DBIx::Class::TimeStamp extension that uses a specified timezone'
author:
  - 'Javier Arturo Rodriguez <javier@rodriguez.org.mx>'
build_requires:
  ExtUtils::MakeMaker: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150005'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: DBIx-Class-TimeStamp-WithTimeZone
no_index:
  directory:
    - t
    - inc
requires:
  DBIx::Class::TimeStamp: '0.14'
  DateTime: '1.18'
version: '0.03'
x_serialization_backend: 'CPAN::Meta::YAML version 0.014'

Makefile.PL  view on Meta::CPAN

use 5.010001;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    NAME         => 'DBIx::Class::TimeStamp::WithTimeZone',
    VERSION_FROM => 'lib/DBIx/Class/TimeStamp/WithTimeZone.pm',
    PREREQ_PM    => {
        'DateTime' => 1.18,
        # We're an actual subclass of DBIx::Class::TimeStamp
        'DBIx::Class::TimeStamp' => '0.14',
    },
    LICENSE => 'perl_5',
    (   $] >= 5.005
        ?    ## Add these new keywords supported since 5.005
            (
            ABSTRACT_FROM => 'lib/DBIx/Class/TimeStamp/WithTimeZone.pm',
            AUTHOR => 'Javier Arturo Rodriguez <javier@rodriguez.org.mx>',
            )
        : ()
    ),
);

README  view on Meta::CPAN

DBIx-Class-TimeStamp-WithTimeZone version 0.02
==============================================

The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.

A README file is required for CPAN modules since CPAN extracts the
README file from a module distribution so that people browsing the
archive can use it get an idea of the modules uses. It is usually a
good idea to provide version information here so that people can
decide whether fixes for the module are worth downloading.

INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

This module requires these other modules and libraries:

  blah blah blah

COPYRIGHT AND LICENCE

Put the correct copyright and licence information here.

Copyright (C) 2015 by Javier Arturo Rodriguez

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.


lib/DBIx/Class/TimeStamp/WithTimeZone.pm  view on Meta::CPAN

package DBIx::Class::TimeStamp::WithTimeZone;

use 5.010001;
use strict;
use warnings;

use base qw(DBIx::Class::TimeStamp);

use DateTime;

our $VERSION = '0.03';

=head1 NAME

DBIx::Class::TimeStamp::WithTimeZone - DBIx::Class::TimeStamp extension that uses a specified timezone

=head1 DESCRIPTION

A subclass of DBIx::Class::TimeStamp that uses a specified timezone instead of the floating timezone.

=head1 SYNOPSIS

 package My::Schema;

 __PACKAGE__->load_components(qw( TimeStamp::WithTimezone ... Core ));

 __PACKAGE__->add_columns(
    id => { data_type => 'integer' },
    t_created => { data_type => 'datetime', set_on_create => 1 },
    t_updated => { data_type => 'datetime',
        set_on_create => 1, set_on_update => 1 },
 );

The timezone will be taken from the first environment variable defined:

* TZ

* TIMEZONE

It will default to 'GMT' otherwise.

=cut

sub get_timestamp {
    return DateTime->now->set_time_zone($ENV{TZ}||$ENV{TIMEZONE}||'GMT');
}

1;

t/DBIx-Class-TimeStamp-WithTimeZone.t  view on Meta::CPAN

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl DBIx-Class-TimeStamp-WithTimeZone.t'

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

# change 'tests => 1' to 'tests => last_test_to_print';

use Test::More tests => 1;
BEGIN { use_ok('DBIx::Class::TimeStamp::WithTimeZone') };

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

# 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.



( run in 1.961 second using v1.01-cache-2.11-cpan-8450f2e95f3 )