Permalink
Browse files

[33] User perl modules instead of headers

Fixed inclusion of libraries

Signed-off-by: DoesntMatter <jaed1@gmx.net>
  • Loading branch information...
DoesntMatter committed Jan 23, 2012
1 parent 177cfc6 commit 53d57fae00b03ac8fc29749f36849dc68c7f1f19
@@ -21,7 +21,7 @@
use strict;
package GENERIC;
package Generic;
#
# Subroutines
@@ -21,7 +21,7 @@
use strict;
package PARSER;
package Parser;
#
# Subroutines
@@ -67,7 +67,7 @@ sub CreateRSS {
my $file = shift || return undef;
my $rss = shift || return undef;
my $github = shift;
my @items = PARSER::SplitCommits($gitlog, "\n&gt;");
my @items = Parser::SplitCommits($gitlog, "\n&gt;");
my $weblink = "https://github.com";
my $itemlink = $rss{'link'};
my $commit;
@@ -68,7 +68,7 @@ CREATE TABLE IF NOT EXISTS `gitlog` (
sub CreateSQL {
my $gitlog = shift || return undef;
my $file = shift || return undef;
my @items = PARSER::SplitCommits($gitlog);
my @items = Parser::SplitCommits($gitlog);
TableStruct($file);
View
@@ -23,10 +23,12 @@
use Getopt::Long;
use Cwd;
use HTML::Entities;
use FindBin;
require "../headers/generic.ph";
require "../headers/parser.ph";
require "../headers/rss.ph";
use lib "$FindBin::Bin/../libs";
use Generic;
use Parser;
use RSS;
my %options;
my ($gitlog, $giturl);
@@ -57,7 +59,7 @@
RSS::ShowHelp();
}
if ($options{'repo'} and $options{'repo'} ne '') {
unless (GENERIC::CheckRepo($options{'repo'})) {
unless (Generic::CheckRepo($options{'repo'})) {
RSS::ShowHelp();
}
}
@@ -77,30 +79,30 @@
$RSS::rss{'desc'} = $options{'desc'};
}
if ($options{'github'}) {
$giturl = GENERIC::GetGithubUrl($options{'repo'});
$giturl = Generic::GetGithubUrl($options{'repo'});
}
}
else {
$options{'repo'} = GENERIC::GetInput("Please enter repository path: ", 1);
unless (GENERIC::CheckRepo($options{'repo'})) {
$options{'repo'} = Generic::GetInput("Please enter repository path: ", 1);
unless (Generic::CheckRepo($options{'repo'})) {
RSS::ShowHelp();
}
$options{'count'} = GENERIC::GetInput("Please enter count of commits: ");
$options{'outfile'} = GENERIC::GetInput("Please enter outfile path: ");
$RSS::rss{'title'} = GENERIC::GetInput("Please enter RSS title: ");
$RSS::rss{'desc'} = GENERIC::GetInput("Please enter RSS description: ");
$RSS::rss{'link'} = GENERIC::GetInput("Please enter RSS link: ");
$options{'github'} = GENERIC::GetInput("Please confirm github usage (0|1): ");
$options{'count'} = Generic::GetInput("Please enter count of commits: ");
$options{'outfile'} = Generic::GetInput("Please enter outfile path: ");
$RSS::rss{'title'} = Generic::GetInput("Please enter RSS title: ");
$RSS::rss{'desc'} = Generic::GetInput("Please enter RSS description: ");
$RSS::rss{'link'} = Generic::GetInput("Please enter RSS link: ");
$options{'github'} = Generic::GetInput("Please confirm github usage (0|1): ");
if ($options{'github'}) {
$giturl = GENERIC::GetGithubUrl($options{'repo'});
$giturl = Generic::GetGithubUrl($options{'repo'});
}
}
#
# Do the job
#
$gitlog = PARSER::ParseGitLog($options{'repo'}, $options{'count'});
$gitlog = Parser::ParseGitLog($options{'repo'}, $options{'count'});
unless ($gitlog) {
print "Parsing `git log` command failed!\n";
exit;
View
@@ -22,10 +22,12 @@
use strict;
use Getopt::Long;
use Cwd;
use FindBin;
require "../headers/generic.ph";
require "../headers/parser.ph";
require "../headers/sql.ph";
use lib "$FindBin::Bin/../libs";
use Generic;
use Parser;
use SQL;
my %options;
my $gitlog;
@@ -52,7 +54,7 @@
SQL::ShowHelp();
}
if ($options{'repo'} and $options{'repo'} ne '') {
unless (GENERIC::CheckRepo($options{'repo'})) {
unless (Generic::CheckRepo($options{'repo'})) {
SQL::ShowHelp();
}
}
@@ -64,19 +66,19 @@
}
}
else {
$options{'repo'} = GENERIC::GetInput("Please enter repository path: ", 1);
unless (GENERIC::CheckRepo($options{'repo'})) {
$options{'repo'} = Generic::GetInput("Please enter repository path: ", 1);
unless (Generic::CheckRepo($options{'repo'})) {
SQL::ShowHelp();
}
$options{'count'} = GENERIC::GetInput("Please enter count of commits: ");
$options{'outfile'} = GENERIC::GetInput("Please enter outfile path: ");
$options{'count'} = Generic::GetInput("Please enter count of commits: ");
$options{'outfile'} = Generic::GetInput("Please enter outfile path: ");
}
#
# Do the job
#
$gitlog = PARSER::ParseGitLog($options{'repo'}, $options{'count'});
$gitlog = Parser::ParseGitLog($options{'repo'}, $options{'count'});
unless ($gitlog) {
print "Parsing `git log` command failed!\n";
exit;

0 comments on commit 53d57fa

Please sign in to comment.