diff --git a/META6.json b/META6.json index 9385d63..3ba3620 100644 --- a/META6.json +++ b/META6.json @@ -1,8 +1,12 @@ { "name": "Text::LDIF", "description": "Pure Perl6 LDIF file parser", - "version": "1.0", + "version": "1.0.5", "perl": "6.c", + "authors": [ + "Sylwester Lunski", + "Alexander Kiryuhin" + ], "auth": "github:slunski", "depends": [], "test-depends": [ @@ -14,7 +18,6 @@ "Text::LDIF::Grammar": "lib/Text/LDIF/Grammar.pm6" }, "license": "Artistic-2.0", - "source-url": "git://github.com/slunski/perl6-text-ldif.git", - "author": "Sylwester Lunski", + "source-url": "git://github.com/Altai-man/perl6-text-ldif.git", "repo-type": "git" } \ No newline at end of file diff --git a/README.md b/README.md index c5c0c47..4ac35ea 100644 --- a/README.md +++ b/README.md @@ -117,9 +117,7 @@ if $result { } ``` -BUGS: +### Authors -Grammar for basic attributes values use just \N* pattern so some -invalid values (eg. binary numbers with invalid format) are accepted. -If database don't allow such values they will be rejected during -import. +* The original module was developed by @slunski +* Current fork was started by @Altai-man who introduced some compatibility breaking changes diff --git a/lib/Text/LDIF/Actions.pm6 b/lib/Text/LDIF/Actions.pm6 index b080cf1..774a06e 100644 --- a/lib/Text/LDIF/Actions.pm6 +++ b/lib/Text/LDIF/Actions.pm6 @@ -2,7 +2,7 @@ use v6; class Text::LDIF::Actions { method TOP($/) { - my %attrs = version => ~$[0]; + my %attrs = version => $[0].Int; with $ { %attrs = .made; @@ -25,15 +25,15 @@ class Text::LDIF::Actions { my %attrs; for $attributes.kv -> $k, $v { if $v.elems == 1 { - %attrs{$k} = $v[0].value; + %attrs{$k} = $v[0]; } else { - if $v.map(*.key eq '').all { - %attrs{$k} = $v.map(*.value); - } else { - %attrs{$k} = $v.Hash; - } + %attrs{$k} = $v.List; } } + if %attrs.elems == 1 { + # We have only single key, so return a single Pair + return %attrs.keys[0] => %attrs{%attrs.keys[0]}; + } %attrs; } @@ -41,20 +41,17 @@ class Text::LDIF::Actions { with $ { make .Str; } orwith $ { - make .Str; + make Pair.new('base64', .Str); } } method attrval-spec($/) { with $ -> $attr { - my @options; - with $attr { - @options.push($_.Str) for $_