Giter VIP home page Giter VIP logo

hanami-ruby3's Introduction

Hanami Ruby 3.0

Monkey patches Hanami components to support Ruby 3.0. This includes

  1. Copying Hanami 1.3.X files to support Ruby 3 syntax.
  2. Copying Hanami 1.3.X files and getting rid of deprecated DRY libraries to allow upgrade of those gems.

Overview

To use this gem, make sure your app works with Ruby 2.7.6.

This should only be installed for a short time, during the Hanami Upgrade process. It just overrides a few of the Hanami classes, replacing code raising deprecation warnings with updated code supported Ruby 3.0 syntax.

Warning!!!

This code just overrides the Hanami components, does not introduce tests of any sort. Before you upgrade your Ruby version, make sure, that your code is covered with tests, and your deprecations tracked.

Usage

In your project, install overrides for the given classes

# custom-hanami-utils is required to allow installing Hanami 1.3.5 with ruby 3
gem 'hanami-utils', github: 'swilgosz/hanami-utils', branch: '1.3.x-support-ruby-3.0'

# Deprecated DRY libraries are renamed to RDY - we install those so we can update our DRY libraries freely.
%w[core container configurable equalizer monads logic types struct validation].each do |name|
  gem "rdy-#{name}", ascenda_private: "Kaligo/rdy", glob: "lib/rdy/#{name}/rdy-#{name}.gemspec"
end

gem 'hanami-ruby3'

Then load overrides in the environment.rb, after loading Hanami files.

require 'hanami/setup'
require 'hanami/ruby3'

With this, you should not have any Ruby Deprecation warnings and you should be fine do update to Ruby 3.0

hanami-ruby3's People

Contributors

swilgosz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.