crinja v0.4.0 Release Notes

Release Date: 2018-10-16 // over 5 years ago
  • ๐Ÿš€ This release comes with some refactorings of the public API to make it easier to use. Most prominently, annotation based autogenerator for exposing object properties to the Crinja runtime were added.

    require "crinja"
    
    class User
      include Crinja::Object::Auto
    
      @[Crinja::Attribute]
      def name : String
        "john paul"
      end
    end
    
    Crinja.new.from_string("{{ user.name }}").render({"user" => User.new}) # => "john paul"
    

    ๐Ÿš€ Autogeneration of crinja_call will be left for the next release.

    ๐Ÿ‘ท Most other changes involve the CI infrastructure, with Circle CI taking over the main load from travis.

    • (breaking-change) Replaced Crinja::PyObject by Crinja::Object and renamed hook methods to crinja_attribute and crinja_call. getitem hook has been removed.
    • (breaking-change) Added Crinja::Object::Auto for generating automatic bindings for crinja_attribute (previously provided by Crinja::PyObject.getattr). The behaviour can be configured using annotations Crinja::Attribute and Crinja::Attributes.
    • (breaking-change) Renamed Crinja::Callable::Arguments to Crinja::Arguments. The API has been simplified by removing unused setters.
    • (breaking-change) Removed Crinja::Arguments#[](key : Symbol). Use a string key instead.
    • (breaking-change) Renamed Crinja::Callable::Arguments::UnknownArgumentException to Crinja::Arguments.:UnknownArgumentError.
    • (breaking-change) Renamed Crinja::Callable::Arguments::ArgumentError to Crinja::Arguments::Error.
    • (breaking-change) Renamed Crinja::PyTuple to Crinja::Tuple.
    • (breaking-change) Updated BakedFileLoader for compatibility with baked_file_system 0.9.6
    • โฌ†๏ธ Upgraded to Crystal 0.26.1.
    • ๐Ÿ›  Fixed number filters (int and float) to not rely on raising an error.
    • ๐Ÿ›  Fixed generate-docs script.
    • โž• Added Makefile.
    • โž• Added Circle CI integration with nighly builds testing with Crystal nightly.
    • โž• Added integration tests for usage examples (./examples) in travis-ci and Circle CI.
    • โž• Added automatic docs generation to circle CI workflow and removed it from travis-ci.
    • โž• Added formatter checks to CI checks.
    • โž• Added preliminary Windows support by removing dependency on xml.
    • โž• Added this changelog.
    • ๐Ÿ‘Œ Improved reference to exmples in README.