Skip to content

Commit

Permalink
DSLする際のフラグを'-Declare'に変更。また、transaction関数としてエクスポートしていた関数名を'blog_expor…
Browse files Browse the repository at this point in the history
…t'に変更。
  • Loading branch information
taiyoh committed Oct 27, 2010
1 parent d0dc1c9 commit 1313ac7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/Text/MTFormatBuilder.pm
Expand Up @@ -3,16 +3,16 @@ use strict;
use warnings;
use utf8;

our $VERSION = '0.02';
our $VERSION = '0.02.3';

use Text::MTFormatBuilder::Entry;

sub import {
my $caller = caller;
return unless $_[0] ne '-Base';
return unless $_[0] ne '-Declare';
no strict 'refs';
no warnings 'redefine';
*{"${caller}::transaction"} = \&do_transaction;
*{"${caller}::blog_export"} = \&do_transaction;
*{"${caller}::${_}"} = sub(&) { warn "DUMMY: $_"; } for (qw/metadata ping comment entry/);
my @keys = qw/title url ip blog_name date body extended_body
excerpt author email primary_category category
Expand Down
6 changes: 3 additions & 3 deletions t/08_dsl.t
Expand Up @@ -4,10 +4,10 @@ use Test::More;

BEGIN { use_ok "Text::MTFormatBuilder" };

Text::MTFormatBuilder->import('-Base');
Text::MTFormatBuilder->import('-Declare');

do {
my $export = transaction {
my $export = blog_export {
entry {
metadata {
author 'author_test';
Expand Down Expand Up @@ -40,7 +40,7 @@ test_excerpt
};

do {
my $export = transaction {
my $export = blog_export {
for (1 .. 2) {
entry {
metadata {
Expand Down

0 comments on commit 1313ac7

Please sign in to comment.