OmarSkalli / fixy

Library for generating fixed width documents
MIT License
100 stars 45 forks source link

Fix ruby 2.7 deprecation: Proc capturing #27

Closed krispenney closed 4 years ago

krispenney commented 4 years ago

See https://github.com/ruby/ruby/blob/4643bf5d55af6f79266dd67b69bb6eb4ff82029a/doc/NEWS-2.7.0#label-proc-2Flambda+without+block+is+deprecated

Currently, it is possible to define a field using a block for the value, this is done using Proc.new to capture the block. This is deprecated in ruby 2.7.

I've changed Record.field and Record.field_value to accept a block directly.