Commits

Toby Inkster committed 42fbc70

adjustments to get makefile working

Comments (0)

Files changed (5)

+#!/usr/bin/perl
+
+use strict;
+
+BEGIN
+{
+	print STDERR "Reading vCard input from STDIN.\n"
+		unless @ARGV;
+}
+
+use RDF::vCard;
+use RDF::Trine;
+
+my $importer = RDF::vCard::Importer->new;
+
+unless (@ARGV)
+{
+	my ($lang) = split /\./, $ENV{LANG};
+	$lang =~ s/_/-/g;
+
+	local $/ = undef;
+	my $input = <>;
+	
+	$importer->import_string($input, lang => $lang);
+}
+
+while (my $input = shift @ARGV)
+{
+	if ($input =~ /^(ftp|http|https|file):/i)
+	{
+		$importer->import_url($input);
+	}
+	else
+	{
+		$importer->import_file($input);
+	}
+}
+
+my $ser = RDF::Trine::Serializer::Turtle->new(
+	namespaces => {
+		v     => 'http://www.w3.org/2006/vcard/ns#',
+		vx    => 'http://buzzword.org.uk/rdf/vcardx#',
+		},
+	);
+print $ser->serialize_model_to_string($importer->model);
+#!/usr/bin/perl
+
+use strict;
+
+BEGIN
+{
+	print STDERR "Reading vCard input from STDIN.\n"
+		unless @ARGV;
+}
+
+use RDF::vCard;
+use XML::LibXML;
+
+my $importer = RDF::vCard::Importer->new;
+my @cards;
+
+unless (@ARGV)
+{
+	my ($lang) = split /\./, $ENV{LANG};
+	$lang =~ s/_/-/g;
+
+	local $/ = undef;
+	my $input = <>;
+	
+	push @cards, $importer->import_string($input, lang => $lang);
+}
+
+while (my $input = shift @ARGV)
+{
+	if ($input =~ /^(ftp|http|https|file):/i)
+	{
+		push @cards, $importer->import_url($input);
+	}
+	else
+	{
+		push @cards, $importer->import_file($input);
+	}
+}
+
+my $doc;
+foreach my $c (@cards)
+{
+	if ($doc)
+	{
+		$c->add_to_document($doc);
+	}
+	else
+	{
+		die "No XML support available (please install XML::LibXML)\n"
+			unless $c->can('to_xml');
+		# Kinda annoying that we only get it as a string, and then need to parse it as XML. :-(
+		$doc = XML::LibXML->new->parse_string($c->to_xml);
+	}
+}
+
+printf("%s\n", $doc->toString) if $doc;

meta/makefile.ttl

 		"namespace::clean",
 		"RDF::Trine 0.135",
 		"RDF::TrineX::Functions",
-		"Test::vFile::asData 0.07",
+		"Text::vFile::asData 0.07",
 		"URI".
 
 _:main

script/vcard2rdf

-#!/usr/bin/perl
-
-use strict;
-
-BEGIN
-{
-	print STDERR "Reading vCard input from STDIN.\n"
-		unless @ARGV;
-}
-
-use RDF::vCard;
-use RDF::Trine;
-
-my $importer = RDF::vCard::Importer->new;
-
-unless (@ARGV)
-{
-	my ($lang) = split /\./, $ENV{LANG};
-	$lang =~ s/_/-/g;
-
-	local $/ = undef;
-	my $input = <>;
-	
-	$importer->import_string($input, lang => $lang);
-}
-
-while (my $input = shift @ARGV)
-{
-	if ($input =~ /^(ftp|http|https|file):/i)
-	{
-		$importer->import_url($input);
-	}
-	else
-	{
-		$importer->import_file($input);
-	}
-}
-
-my $ser = RDF::Trine::Serializer::Turtle->new(
-	namespaces => {
-		v     => 'http://www.w3.org/2006/vcard/ns#',
-		vx    => 'http://buzzword.org.uk/rdf/vcardx#',
-		},
-	);
-print $ser->serialize_model_to_string($importer->model);

script/vcard2xml

-#!/usr/bin/perl
-
-use strict;
-
-BEGIN
-{
-	print STDERR "Reading vCard input from STDIN.\n"
-		unless @ARGV;
-}
-
-use RDF::vCard;
-use XML::LibXML;
-
-my $importer = RDF::vCard::Importer->new;
-my @cards;
-
-unless (@ARGV)
-{
-	my ($lang) = split /\./, $ENV{LANG};
-	$lang =~ s/_/-/g;
-
-	local $/ = undef;
-	my $input = <>;
-	
-	push @cards, $importer->import_string($input, lang => $lang);
-}
-
-while (my $input = shift @ARGV)
-{
-	if ($input =~ /^(ftp|http|https|file):/i)
-	{
-		push @cards, $importer->import_url($input);
-	}
-	else
-	{
-		push @cards, $importer->import_file($input);
-	}
-}
-
-my $doc;
-foreach my $c (@cards)
-{
-	if ($doc)
-	{
-		$c->add_to_document($doc);
-	}
-	else
-	{
-		die "No XML support available (please install XML::LibXML)\n"
-			unless $c->can('to_xml');
-		# Kinda annoying that we only get it as a string, and then need to parse it as XML. :-(
-		$doc = XML::LibXML->new->parse_string($c->to_xml);
-	}
-}
-
-printf("%s\n", $doc->toString) if $doc;