[libcatmandu-perl] 69/101: Pod pod pod
Jonas Smedegaard
dr at jones.dk
Tue Feb 23 13:43:57 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcatmandu-perl.
commit 3bbf3bc017bd209911da1c00c7d56d00d310af15
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date: Thu Feb 4 15:59:10 2016 +0100
Pod pod pod
---
Build.PL | 4 ++--
lib/Catmandu/Exporter/JSON.pm | 4 ++--
lib/Catmandu/Exporter/Null.pm | 6 ++++--
lib/Catmandu/Exporter/TSV.pm | 2 +-
lib/Catmandu/Exporter/Text.pm | 12 ++++++++++++
lib/Catmandu/Importer/CSV.pm | 5 ++---
lib/Catmandu/Importer/JSON.pm | 20 ++++++++++++++++----
lib/Catmandu/Importer/Null.pm | 11 ++++++-----
lib/Catmandu/Importer/TSV.pm | 2 +-
lib/Catmandu/Importer/Text.pm | 6 +++---
lib/Catmandu/Importer/YAML.pm | 6 ++++++
11 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/Build.PL b/Build.PL
index aae0a0a..946832e 100644
--- a/Build.PL
+++ b/Build.PL
@@ -1,5 +1,5 @@
-# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v5.041.
+# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v5.039.
use strict;
use warnings;
@@ -15,7 +15,7 @@ my %module_build_args = (
},
"dist_abstract" => "a data toolkit",
"dist_author" => [
- "Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >>"
+ "Nicolas Steenlant <nicolas.steenlant\@ugent.be>"
],
"dist_name" => "Catmandu",
"dist_version" => "0.9505",
diff --git a/lib/Catmandu/Exporter/JSON.pm b/lib/Catmandu/Exporter/JSON.pm
index 5929fcc..56aebad 100644
--- a/lib/Catmandu/Exporter/JSON.pm
+++ b/lib/Catmandu/Exporter/JSON.pm
@@ -79,11 +79,11 @@ Catmandu::Exporter::JSON - a JSON exporter
=head1 SYNOPSIS
-Command line interface:
+ # From the command line
catmandu convert YAML to JSON --pretty 1 < input.yml
-In Perl code:
+ # In a Perl script
use Catmandu -all;
diff --git a/lib/Catmandu/Exporter/Null.pm b/lib/Catmandu/Exporter/Null.pm
index c44a665..b772b94 100644
--- a/lib/Catmandu/Exporter/Null.pm
+++ b/lib/Catmandu/Exporter/Null.pm
@@ -26,10 +26,12 @@ Catmandu::Exporter::Null - a expoter that doesn't export anything
# From the commandline
$ catmandu convert JSON --fix myfixes to Null < /tmp/data.json
+ $ catmandu convert JSON --fix 'add_to_exporter(.,JSON)' to Null < /tmp/data.json
+
=head1 DESCRIPTION
-This exporter exports nothing and can be used as in situations where you e.g. export
-data from a fix.
+This exporter exports nothing and can be used as in situations where you export
+data in the Fix script itself.
=head1 SEE ALSO
diff --git a/lib/Catmandu/Exporter/TSV.pm b/lib/Catmandu/Exporter/TSV.pm
index 742f6f9..f18fa49 100644
--- a/lib/Catmandu/Exporter/TSV.pm
+++ b/lib/Catmandu/Exporter/TSV.pm
@@ -44,7 +44,7 @@ Catmandu::Exporter::TSV - a tab-delimited TSV exporter
=head1 SYNOPSIS
- # On the command line
+ # From the command line
$ catmandu convert JSON to TSV --fields "id,title,year" < data.json
diff --git a/lib/Catmandu/Exporter/Text.pm b/lib/Catmandu/Exporter/Text.pm
index 814a4a2..31f2647 100644
--- a/lib/Catmandu/Exporter/Text.pm
+++ b/lib/Catmandu/Exporter/Text.pm
@@ -107,6 +107,13 @@ Catmandu::Exporter::Text - a Text exporter
=head1 SYNOPSIS
+ # From the command line
+
+ # Write all field values as a line of Text
+ $ catmandu convert JSON to Text --field_sep "," < data.json
+
+ # In a Perl script
+
use Catmandu::Exporter::Text;
# Print to STDOUT
@@ -124,6 +131,11 @@ Catmandu::Exporter::Text - a Text exporter
printf "exported %d objects\n" , $exporter->count;
+=head1 DESCRIPTION
+
+This C<Catmandu::Exporter> exports items as raw text. All field values found
+in the data will be contactenated using C<field_sep> as delimiter.
+
=head1 CONFIGURATION
=over 4
diff --git a/lib/Catmandu/Importer/CSV.pm b/lib/Catmandu/Importer/CSV.pm
index 496a922..ac726dc 100644
--- a/lib/Catmandu/Importer/CSV.pm
+++ b/lib/Catmandu/Importer/CSV.pm
@@ -120,8 +120,7 @@ Catmandu::Importer::CSV - Package that imports CSV data
echo '12157;$The Journal of Headache and Pain$;2193-1801' | \
catmandu convert CSV --header 0 --fields 'id,title,issn' --sep_char ';' --quote_char '$' to XLSX --file journal.xlsx
-
- # Or in a Perl script
+ # In a Perl script
use Catmandu;
@@ -134,7 +133,7 @@ Catmandu::Importer::CSV - Package that imports CSV data
=head1 DESCRIPTION
-The L<Catmandu::Importer> package imports comma-separated values (CSV). The object
+The package imports comma-separated values (CSV). The object
fields are read from the CSV header line or given via the C<fields> parameter.
Strings in CSV are quoted by C<quote_char> and fields are separated by
C<sep_char>.
diff --git a/lib/Catmandu/Importer/JSON.pm b/lib/Catmandu/Importer/JSON.pm
index e8623c9..945fda9 100644
--- a/lib/Catmandu/Importer/JSON.pm
+++ b/lib/Catmandu/Importer/JSON.pm
@@ -77,18 +77,30 @@ Catmandu::Importer::JSON - Package that imports JSON data
=head1 SYNOPSIS
- use Catmandu::Importer::JSON;
+ # From the command line
+
+ $ catmandu convert JSON to YAML < data.json
- my $importer = Catmandu::Importer::JSON->new(file => "/foo/bar.json");
+ # or for faster newline delimited input
+
+ $ catmandu convert JSON --line_delimited 1 to YAML < data.json
+
+ # In a Perl script
+
+ use Catmandu;
+
+ my $importer = Catmandu->importer('JSON', file => "/foo/bar.json");
my $n = $importer->each(sub {
my $hashref = $_[0];
# ...
});
+=head1 DESCRIPTION
-The parser is quite liberal in the input is accepts. You can use the
-C<line_delimited> option to parse newline delimited JSON faster:
+This package imports JSON data. The parser is quite liberal in the input
+it accepts. You can use the C<line_delimited> option to parse "newline
+delimited JSON" faster:
{ "recordno": 1, "name": "Alpha" }
{ "recordno": 2, "name": "Beta" }
diff --git a/lib/Catmandu/Importer/Null.pm b/lib/Catmandu/Importer/Null.pm
index 3852322..a8dd101 100644
--- a/lib/Catmandu/Importer/Null.pm
+++ b/lib/Catmandu/Importer/Null.pm
@@ -30,14 +30,15 @@ Catmandu::Importer::Null - Null importer used for testing purposes
=head1 SYNOPSIS
- # On the command line
+ # From the command line
+
catmandu convert Null --fix 'add_field(foo,bar)'
# creates { "foo": "bar" }
- # In perl
- use Catmandu::Importer::Null;
+ # In a Perl script
+ use Catmandu;
- my $importer = Catmandu::Importer::Null->new();
+ my $importer = Catmandu->importer('Null');
my $n = $importer->each(sub {
my $hashref = $_[0];
@@ -46,7 +47,7 @@ Catmandu::Importer::Null - Null importer used for testing purposes
=head1 DESCRIPTION
-The Null importer generated one empty record and exists. This importer can be used to
+The importer generates one empty record and then exists. This importer can be used to
test fix functions, generating a single record.
=head1 METHODS
diff --git a/lib/Catmandu/Importer/TSV.pm b/lib/Catmandu/Importer/TSV.pm
index 97833df..06bb147 100644
--- a/lib/Catmandu/Importer/TSV.pm
+++ b/lib/Catmandu/Importer/TSV.pm
@@ -70,7 +70,7 @@ Catmandu::Importer::TSV - Package that imports tab-separated values
=head1 DESCRIPTION
-The L<Catmandu::Importer> package imports tab-separated values (TSV). The object
+This package imports tab-separated values (TSV). The object
fields are read from the TSV header line or given via the C<fields> parameter.
=head1 CONFIGURATION
diff --git a/lib/Catmandu/Importer/Text.pm b/lib/Catmandu/Importer/Text.pm
index d115dc5..21e3fe4 100644
--- a/lib/Catmandu/Importer/Text.pm
+++ b/lib/Catmandu/Importer/Text.pm
@@ -71,7 +71,7 @@ Catmandu::Importer::Text - Package that imports textual data
=head1 SYNOPSIS
-With L<catmandu> command line client:
+ # From the command line
# separate fields by whitespace sequences just like awk
catmandu convert Text --split '\s+'
@@ -79,7 +79,7 @@ With L<catmandu> command line client:
# import all lines starting with '#', omitting this character
catmandu convert Text --pattern '^#(.*)'
-In Perl code:
+ # In a Perl script
use Catmandu::Importer::Text;
@@ -93,7 +93,7 @@ In Perl code:
=head1 DESCRIPTION
-This L<Catmandu::Importer> reads textual input line by line. Each line is
+This package reads textual input line by line. Each line is
imported as item with line number in field C<_id> and text content in field
C<text>. Line separators are not included. Lines can further be split by
character or pattern and a regular expression can be specified to only import
diff --git a/lib/Catmandu/Importer/YAML.pm b/lib/Catmandu/Importer/YAML.pm
index 99614cf..1dd00fd 100644
--- a/lib/Catmandu/Importer/YAML.pm
+++ b/lib/Catmandu/Importer/YAML.pm
@@ -55,6 +55,12 @@ Catmandu::Importer::YAML - Package that imports YAML data
=head1 SYNOPSIS
+ # From the command line
+
+ $ catmandu convert YAML to JSON < data.yaml
+
+ # In a Perl script
+
use Catmandu::Importer::YAML;
my $importer = Catmandu::Importer::YAML->new(file => "/foo/bar.yaml");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git
More information about the Pkg-perl-cvs-commits
mailing list