{"action":"created","issue":{"url":"https://api.github.com/repos/eserte/p5-Kwalify/issues/3","repository_url":"https://api.github.com/repos/eserte/p5-Kwalify","labels_url":"https://api.github.com/repos/eserte/p5-Kwalify/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/eserte/p5-Kwalify/issues/3/comments","events_url":"https://api.github.com/repos/eserte/p5-Kwalify/issues/3/events","html_url":"https://github.com/eserte/p5-Kwalify/issues/3","id":155761520,"number":3,"title":"Using @try_order for library load can eat a couple of hours for debug... if 'YAML::Syck' in use","user":{"login":"taurus-forever","id":1928266,"avatar_url":"https://avatars.githubusercontent.com/u/1928266?v=3","gravatar_id":"","url":"https://api.github.com/users/taurus-forever","html_url":"https://github.com/taurus-forever","followers_url":"https://api.github.com/users/taurus-forever/followers","following_url":"https://api.github.com/users/taurus-forever/following{/other_user}","gists_url":"https://api.github.com/users/taurus-forever/gists{/gist_id}","starred_url":"https://api.github.com/users/taurus-forever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taurus-forever/subscriptions","organizations_url":"https://api.github.com/users/taurus-forever/orgs","repos_url":"https://api.github.com/users/taurus-forever/repos","events_url":"https://api.github.com/users/taurus-forever/events{/privacy}","received_events_url":"https://api.github.com/users/taurus-forever/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-19T15:10:59Z","updated_at":"2016-05-23T07:22:34Z","closed_at":null,"body":"Hi,\r\n\r\nFunction read_file have a nice code to guest which library to use:\r\n```\r\n        if      ($try eq 'YAML::Syck' && eval { require YAML::Syck; 1 }) {\r\n            my @data = eval { YAML::Syck::LoadFile($file) };\r\n            return @data if !$@;\r\n            push @errors, $@;\r\n        } elsif ($try eq 'YAML'       && eval { require YAML; 1 }) {\r\n            my @data = eval { YAML::LoadFile($file) };\r\n            return @data if !$@;\r\n            push @errors, $@;\r\n        } elsif ...\r\n```\r\n\r\nAs a result you can have different results (probably due to some bug in YAML::Syck):\r\n\r\n```\r\nroot@spce:~# cat test.yaml \r\n---\r\ntest:\r\n  -\r\n    operand: =\r\n  -\r\n    operand: LIKE\r\n  -\r\n    operand: \"LIKE\"\r\n  -\r\n    operand: 'LIKE'\r\n  -\r\n    operand: NOT LIKE\r\n  -\r\n    operand: \"NOT LIKE\"\r\n  -\r\n    operand: 'NOT LIKE'\r\n  -\r\n    operand: =\r\n  -\r\n    operand: \"=\"\r\n  -\r\n    operand: '='\r\n  -\r\n    operand: <\r\n  -\r\n    operand: \"<\"\r\n  -\r\n    operand: '<'\r\n  -\r\n    operand: <>\r\n  -\r\n    operand: \"<>\"\r\n  -\r\n    operand: '<>'\r\nroot@spce:~# cat schema.yml \r\nname: test.yml\r\ndesc: test\r\ntype: map\r\nmapping:\r\n\r\n \"test\":\r\n   type: seq\r\n   required: yes\r\n   sequence:\r\n     -\r\n       type: map\r\n       required: yes\r\n       mapping:\r\n         \"operand\": { type: str, required: yes, enum: [ '=', '!=', '<', '>', '<=', '>=', '<>', '<=>', 'IS', 'IS NOT', 'LIKE', 'NOT LIKE' ] }\r\n\r\nroot@spce:~# pkwalify -V\r\npkwalify 1.13\r\nKwalify.pm 1.22_90\r\nperl 5.020002\r\nroot@spce:~# pkwalify -f schema.yml test.yaml \r\ntest.yaml#0: valid.\r\n\r\n\r\nroot@spce:~# apt-get install libyaml-syck-perl\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nThe following NEW packages will be installed:\r\n  libyaml-syck-perl\r\n0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.\r\nNeed to get 80.5 kB of archives.\r\nAfter this operation, 184 kB of additional disk space will be used.\r\nGet:1 http://debian.sipwise.com/debian/ jessie/main libyaml-syck-perl amd64 1.27-2+b2 [80.5 kB]\r\nFetched 80.5 kB in 0s (3,742 kB/s)           \r\nSelecting previously unselected package libyaml-syck-perl.\r\n(Reading database ... 70569 files and directories currently installed.)\r\nPreparing to unpack .../libyaml-syck-perl_1.27-2+b2_amd64.deb ...\r\nUnpacking libyaml-syck-perl (1.27-2+b2) ...\r\nProcessing triggers for man-db (2.7.0.2-5) ...\r\nSetting up libyaml-syck-perl (1.27-2+b2) ...\r\nroot@spce:~#\r\n\r\n\r\nroot@spce:~# pkwalify -f schema.yml test.yaml \r\ntest.yaml#0: INVALID\r\n  - [/test/0/operand] '=': invalid operand value\r\n  - [/test/7/operand] '=': invalid operand value\r\nroot@spce:~#\r\n\r\n\r\nroot@spce:~# apt-get purge libyaml-syck-perl\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nThe following packages will be REMOVED:\r\n  libyaml-syck-perl*\r\n0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.\r\nAfter this operation, 184 kB disk space will be freed.\r\nDo you want to continue? [Y/n] \r\n(Reading database ... 70584 files and directories currently installed.)\r\nRemoving libyaml-syck-perl (1.27-2+b2) ...\r\nProcessing triggers for man-db (2.7.0.2-5) ...\r\nroot@spce:~#\r\n\r\n\r\nroot@spce:~# pkwalify -f schema.yml test.yaml \r\ntest.yaml#0: valid.\r\nroot@spce:~# \r\n```\r\n\r\nIs it possible to introduce option to force use requested library?\r\nAlso, maybe you see what 'YAML::Syck' doesn't like here?\r\n\r\nTnx!"},"comment":{"url":"https://api.github.com/repos/eserte/p5-Kwalify/issues/comments/220905114","html_url":"https://github.com/eserte/p5-Kwalify/issues/3#issuecomment-220905114","issue_url":"https://api.github.com/repos/eserte/p5-Kwalify/issues/3","id":220905114,"user":{"login":"taurus-forever","id":1928266,"avatar_url":"https://avatars.githubusercontent.com/u/1928266?v=3","gravatar_id":"","url":"https://api.github.com/users/taurus-forever","html_url":"https://github.com/taurus-forever","followers_url":"https://api.github.com/users/taurus-forever/followers","following_url":"https://api.github.com/users/taurus-forever/following{/other_user}","gists_url":"https://api.github.com/users/taurus-forever/gists{/gist_id}","starred_url":"https://api.github.com/users/taurus-forever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taurus-forever/subscriptions","organizations_url":"https://api.github.com/users/taurus-forever/orgs","repos_url":"https://api.github.com/users/taurus-forever/repos","events_url":"https://api.github.com/users/taurus-forever/events{/privacy}","received_events_url":"https://api.github.com/users/taurus-forever/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T07:22:34Z","updated_at":"2016-05-23T07:22:34Z","body":"> What about options -yamlmod and -jsonmod\r\n\r\nYou can create them as well, while I do not need them until \"auto-detect\" here works without an issues.\r\n\r\n> And probably I should add support for YAML::XS\r\n\r\nIf you will provide an options to force specific library, changing defaults will be a risky part not not so critical anymore. You can add YAML::Tiny as well... while why do you need more then one library here?\r\n\r\nIMHO you should have 1 library which you will support and it must cover the use cases for p5-kwalify. Everything else is just an unnecessary work."}}
{"actor":{"display_login":"taurus-forever"}}