Skip to content

Releases: jessedoyle/shrink_wrap

1.0.2

04 Feb 01:39
5314036
Compare
Choose a tag to compare
  • Fix an issue with the shrink_wrap require statement. #8 , Thanks @mvandenbeuken!

1.0.1

01 Jun 17:49
b795dc2
Compare
Choose a tag to compare

Previously the default callable option on a property translation would not correctly resolve a value when the input hash value was nil. This release fixes the default property resolution logic when values are explicitly nil.

i.e.

class MyClass
  include Shrink::Wrap
  transform(Shrink::Wrap::Transformer::Symbolize)
  translate(
    name: { from: :name, allow_nil: false, default: -> { 'jane'  } }
  )
end
instance = MyClass.shrink_wrap(name: nil)

# previous behaviour
instance.name # => nil

# fixed behaviour
instance.name # => "jane"

1.0.0

01 Oct 21:43
61bdc9d
Compare
Choose a tag to compare
  • Explicity require stringio from the standard library as it is used for some error messages.

0.2.0

17 Apr 19:12
20ecc31
Compare
Choose a tag to compare
  • breaking change: Modify the CollectionFromKey transformer to map non-hash values into a hash with a value property.

i.e.

input = { names: { john: 'foo', jane: 'bar' } }
transformer.transform(input) #=>  { names: [{ name: :john, value: 'foo' }, { name: :jane, value: 'bar' }] }

0.1.1

26 Mar 23:46
1ba1591
Compare
Choose a tag to compare
  • Previously a coercion that was defined as follows:

    coerce(
      boolean: ->(v) { v.to_s.casecmp('true').zero? }
    )
    

    would incorrectly return the string 'false' when given an input
    string of 'false'. This was due to short-circuit evaluation.

  • Fix the bug by using an explicit if/else block.

  • Relax the restriction on bundler in the dev environment - there's
    no need to require a specific version.

  • Bump version to 0.1.1.

  • Setup Github Actions for CI.

0.1.0

03 Dec 00:27
f974639
Compare
Choose a tag to compare
  • Initial Release!