-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install eds2xdd script alongside module
- Loading branch information
Showing
6 changed files
with
103 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,4 @@ | |
.DS_Store | ||
Convert-EDS-XDD-*/ | ||
Convert-EDS-XDD-*.tar.gz | ||
eds2xdd | ||
fatlib/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,34 +8,37 @@ Convert::EDS::XDD - Convert CANopen EDS to POWERLINK XDD | |
|
||
=head1 SYNOPSIS | ||
|
||
perl -MConvert::EDS::XDD=eds2xdd -e "print eds2xdd 'profile.eds'" > profile.xdd | ||
$ cpan Convert::EDS::XDD # install from CPAN | ||
$ eds2xdd profile.eds > profile.xdd # Convert with the eds2xdd script | ||
|
||
=head1 DESCRIPTION | ||
|
||
EDS is an L<ini|Config::Tiny> based format specified by the CiA e.V. in order to describe CANopen devices. The Ethernet POWERLINK Standardization Group specifies an EDS-based L<XML|XML::Writer> format for EPL devices. | ||
|
||
This module Takes in an EDS file or a string with its content and returns a XDD string. A self-contained (fatpacked) C<epl2xdd> script is available L<at the Github releases page|https://github.com/epl-viz/Convert-EDS-XDD/releases/latest>. | ||
This module takes in an EDS file or a string with its content and returns a XDD string. An L<eds2xdd> wrapper script is also installed into the C<PATH>. | ||
|
||
C<eds2xdd> is also available as a self-contained (fatpacked) script L<at the Github releases page|https://github.com/epl-viz/Convert-EDS-XDD/releases/latest>. | ||
|
||
=head1 LIMITATIONS | ||
|
||
May not handle all details of the EDS. Pull requests and reports (issues on Github) welcome. | ||
May not handle all details of the EDS. Pull requests and reports (L<issues on Github|https://github.com/epl-viz/Convert-EDS-XDD/issues>) are welcome. | ||
|
||
=head1 METHODS AND ARGUMENTS | ||
|
||
=over 4 | ||
|
||
=item eds2xdd($filename, [$encoding]) | ||
|
||
Here, the [] indicate an optional parameter. | ||
Here, the C<[]> indicate an optional parameter. | ||
|
||
Returns the EDS' content as XML string on success or undef on error in file contents. | ||
|
||
Function croaks if opening file fails. | ||
|
||
$encoding may be used to indicate the encoding of the file, e.g. 'utf8' or | ||
'encoding(iso-8859-1)'. | ||
C<$encoding> may be used to indicate the encoding of the file, e.g. C<'utf8'> or | ||
C<'encoding(iso-8859-1)'>. | ||
|
||
Do not add a prefix to $encoding, such as '<' or '<:'. | ||
Do not add a prefix to C<$encoding>, such as C<< '<' >> or C<< '<:' >>. | ||
|
||
=item eds2xdd_string($string) | ||
|
||
|
@@ -57,7 +60,7 @@ Ahmad Fatoum C<< <[email protected]> >>, L<http://a3f.at> | |
|
||
=head1 COPYRIGHT AND LICENSE | ||
|
||
Copyright (C) 2017 Ahmad Fatoum | ||
Copyright (C) 2017-2018 Ahmad Fatoum | ||
|
||
This library is free software; you can redistribute it and/or modify | ||
it under the same terms as Perl itself. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!perl | ||
use strict; | ||
use warnings; | ||
# VERSION | ||
|
||
use Getopt::Std; | ||
use Convert::EDS::XDD qw(eds2xdd_string); | ||
|
||
$Getopt::Std::STANDARD_HELP_VERSION = 1; | ||
|
||
getopts '', \my %opts; | ||
|
||
local $/; | ||
while (<>) { | ||
print eds2xdd_string $_; | ||
} | ||
|
||
sub VERSION_MESSAGE() { print "Convert::EDS::XDD v$Convert::EDS::XDD::VERSION\n"; } | ||
sub HELP_MESSAGE() { | ||
print <<"EOT" | ||
Usage: $0 [eds_file] | ||
echo 'eds_content' | $0 | ||
|
||
Opens files passed as arguments and writes them to stdout as XDD. | ||
If there are no arguments, stdin is read | ||
EOT | ||
} | ||
|
||
=pod | ||
|
||
=head1 NAME | ||
|
||
eds2xdd - Command-line utility for L<Convert::EDS::XDD> | ||
|
||
=head1 SYNOPSIS | ||
|
||
$ cpan Convert::EDS::XDD # install from CPAN | ||
$ eds2xdd profile.eds > profile.xdd # Convert with the eds2xdd script | ||
|
||
=head1 DESCRIPTION | ||
|
||
EDS is an L<ini|Config::Tiny> based format specified by the CiA e.V. in order to describe CANopen devices. The Ethernet POWERLINK Standardization Group specifies an EDS-based L<XML|XML::Writer> format for EPL devices. | ||
|
||
This module takes in an EDS file or a string with its content and returns a XDD string. An L<eds2xdd> script (this one here) is also installed into the C<PATH>. | ||
|
||
C<eds2xdd> is also available as a self-contained (fatpacked) script L<at the Github releases page|https://github.com/epl-viz/Convert-EDS-XDD/releases/latest>. | ||
|
||
=head1 LIMITATIONS | ||
|
||
May not handle all details of the EDS. Pull requests and reports (L<issues on Github|https://github.com/epl-viz/Convert-EDS-XDD/issues>) are welcome. | ||
|
||
=head1 GIT REPOSITORY | ||
|
||
L<http://github.com/epl-viz/Convert-EDS-XDD> | ||
|
||
=head1 SEE ALSO | ||
|
||
L<EPL-Viz - Visualization for Ethernet POWERLINK|http://github.com/epl-viz> | ||
|
||
=head1 AUTHOR | ||
|
||
Ahmad Fatoum C<< <[email protected]> >>, L<http://a3f.at> | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
|
||
Copyright (C) 2017-2018 Ahmad Fatoum | ||
|
||
This library is free software; you can redistribute it and/or modify | ||
it under the same terms as Perl itself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,19 @@ name = Convert-EDS-XDD | |
author = Ahmad Fatoum <[email protected]> | ||
license = Perl_5 | ||
copyright_holder = Ahmad Fatoum | ||
copyright_year = 2017 | ||
copyright_year = 2018 | ||
|
||
[@Starter] | ||
|
||
[AutoPrereqs] | ||
[MetaProvides::Package] | ||
|
||
[GithubMeta] | ||
issues = 1 | ||
user = athreef | ||
user = epl-viz | ||
[@Git] | ||
[Git::Init] | ||
remote = origin [email protected]:athreef/%N.git | ||
remote = origin [email protected]:epl-viz/%N.git | ||
[Git::NextVersion] | ||
[ChangelogFromGit] | ||
[OurPkgVersion] | ||
|
@@ -23,3 +24,10 @@ type = pod | |
filename = README.pod | ||
location = root | ||
|
||
[Test::MinimumVersion] | ||
max_target_perl = 5.10 | ||
[MinimumPerlFast] | ||
[Test::Perl::Critic] | ||
[Test::Version] | ||
[Test::NoTabs] | ||
[Test::EOL] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,20 @@ Convert::EDS::XDD - Convert CANopen EDS to POWERLINK XDD | |
=head1 SYNOPSIS | ||
perl -MConvert::EDS::XDD=eds2xdd -e "print eds2xdd 'profile.eds'" > profile.xdd | ||
$ cpan Convert::EDS::XDD # install from CPAN | ||
$ eds2xdd profile.eds > profile.xdd # Convert with the eds2xdd script | ||
=head1 DESCRIPTION | ||
EDS is an L<ini|Config::Tiny> based format specified by the CiA e.V. in order to describe CANopen devices. The Ethernet POWERLINK Standardization Group specifies an EDS-based L<XML|XML::Writer> format for EPL devices. | ||
This module Takes in an EDS file or a string with its content and returns a XDD string. A self-contained (fatpacked) C<epl2xdd> script is available L<at the Github releases page|https://github.com/epl-viz/Convert-EDS-XDD/releases/latest>. | ||
This module takes in an EDS file or a string with its content and returns a XDD string. An L<eds2xdd> wrapper script is also installed into the C<PATH>. | ||
C<eds2xdd> is also available as a self-contained (fatpacked) script L<at the Github releases page|https://github.com/epl-viz/Convert-EDS-XDD/releases/latest>. | ||
=head1 LIMITATIONS | ||
May not handle all details of the EDS. Pull requests and reports (issues on Github) welcome. | ||
May not handle all details of the EDS. Pull requests and reports (L<issues on Github|https://github.com/epl-viz/Convert-EDS-XDD/issues>) are welcome. | ||
=cut | ||
|
||
|
@@ -82,16 +85,16 @@ sub _extract { | |
=item eds2xdd($filename, [$encoding]) | ||
Here, the [] indicate an optional parameter. | ||
Here, the C<[]> indicate an optional parameter. | ||
Returns the EDS' content as XML string on success or undef on error in file contents. | ||
Function croaks if opening file fails. | ||
$encoding may be used to indicate the encoding of the file, e.g. 'utf8' or | ||
'encoding(iso-8859-1)'. | ||
C<$encoding> may be used to indicate the encoding of the file, e.g. C<'utf8'> or | ||
C<'encoding(iso-8859-1)'>. | ||
Do not add a prefix to $encoding, such as '<' or '<:'. | ||
Do not add a prefix to C<$encoding>, such as C<< '<' >> or C<< '<:' >>. | ||
=cut | ||
|
||
|
@@ -108,7 +111,7 @@ sub eds2xdd { | |
close($eds); | ||
|
||
croak "Reading from '$file' returned undef" unless defined $contents; | ||
eds2xdd_string($contents) or return undef; | ||
eds2xdd_string($contents) or return; | ||
}; | ||
|
||
my $template = do { | ||
|
@@ -285,7 +288,7 @@ Ahmad Fatoum C<< <[email protected]> >>, L<http://a3f.at> | |
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2017 Ahmad Fatoum | ||
Copyright (C) 2017-2018 Ahmad Fatoum | ||
This library is free software; you can redistribute it and/or modify | ||
it under the same terms as Perl itself. | ||
|