Skip to content

Commit

Permalink
無駄な改行とか削除した
Browse files Browse the repository at this point in the history
  • Loading branch information
hisaichi5518 committed Oct 20, 2012
1 parent 6906d33 commit 711ebcc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
4 changes: 1 addition & 3 deletions lib/Malts/Setup/Command/init.pm
Expand Up @@ -9,10 +9,8 @@ sub run {
my $class = shift;
my ($opts, @args) = $class->parse_options(@_);

my $module = Malts::Setup::Module->new(name => $args[0]);
my $flavor = Malts::Setup::Flavor->new(name => $args[1]);
my $module = Malts::Setup::Module->new(
name => $args[0],
);

die "!! exists ".$module->dist if -e $module->dist && !$opts->{force};

Expand Down
21 changes: 7 additions & 14 deletions lib/Malts/Setup/Command/new.pm
Expand Up @@ -15,16 +15,15 @@ sub run {
my $tag_config = $config->{tags}->{$opts->{tag}}
or die "!! Can't find tags.@{[$opts->{tag}]} in .maltsconfig.";

my $flavor = Malts::Setup::Flavor->new(
name => $args[1] || $config->{template_name},
);
my $module = Malts::Setup::Module->new(
name => $config->{app_name},
);
my $flavor_name = $args[1] || $config->{flavor_name}
or die "!! Can't find flavor_name in .maltsconfig.";

my $files = $module->build_files($flavor->files);
my $flavor = Malts::Setup::Flavor->new(name => $flavor_name);
my $module = Malts::Setup::Module->new(name => $app_name);

my $files = $module->build_files($flavor->files);
my $tagged_files = {};

for my $template_name (keys %{$files}) {
next if !($template_name ~~ $tag_config->{files});

Expand All @@ -47,18 +46,12 @@ sub run {
$tagged_files->{$template_name} = $body;
}

$module = Malts::Setup::Module->new(
name => $args[0],
);

$module = Malts::Setup::Module->new(name => $args[0]);
$files = $module->build_files($tagged_files);

$class->create_files($files, {
dry_run => $opts->{'dry-run'},
});



}

sub option_spec {
Expand Down
4 changes: 2 additions & 2 deletions lib/Malts/Setup/Command/new_template.pm
Expand Up @@ -11,8 +11,8 @@ sub run {
my $class = shift;
my ($opts, @args) = $class->parse_options(@_);

my $base_dir = $opts->{dir} or die;
my $module = $opts->{module} or die;
my $base_dir = $opts->{dir} or die "!! Can't find --dir.";
my $module = $opts->{module} or die "!! Can't find --module.";

my @templates;
dir($base_dir)->recurse(
Expand Down

0 comments on commit 711ebcc

Please sign in to comment.