tokuhirom / p6-Crust

PSGI library stack for Perl6
Artistic License 2.0
66 stars 18 forks source link

Remove use of abspath #89

Closed zoffixznet closed 7 years ago

zoffixznet commented 7 years ago

This method no longer exists.

skaji commented 7 years ago

LGTM

skaji commented 7 years ago

Does rakudo remove s method from IO::Handle too?

❯ prove -e 'perl6 -Ilib' t/Crust-Middleware/content-length.t
t/Crust-Middleware/content-length.t .. 1/? No such method 's' for invocant of type 'IO::Handle'
  in sub content-length at /Users/skaji/src/github.com/tokuhirom/p6-Crust/lib/Crust/Utils.pm6 (Crust::Utils) line 52
  in method CALL-ME at /Users/skaji/src/github.com/tokuhirom/p6-Crust/lib/Crust/Middleware/ContentLength.pm6 (Crust::Middleware::ContentLength) line 11
  in block <unit> at t/Crust-Middleware/content-length.t line 53

❯ perl6 -e 'say IO::Handle.^methods'
(open nl-in close eof get getc comb words lines read readchars Supply seek tell write opened t lock unlock printf print put print-nl slurp-rest slurp spurt path IO flush encoding DESTROY native-descriptor split iterator say Str gist perl chomp nl-out)
zoffixznet commented 7 years ago

Yes, all file tests are gone from Handle. See upgrade notice: http://rakudo.org/2017/04/17/final-notes-on-changes-due-to-io-grant-work/

You can use $handle.path.s as substitute, but note that not all IO::Handles are path-based, so doing that is a bit flimsy