Back to Browse

How to make your ruby code terminal friendly

517 views
Jan 30, 2022
14:51

As a developer you can control the way others will see your code in the irb shell. You can use it to display more data or obstruct certain information like long strings and passwords. -= Relevant links =- Source code: https://github.com/rails-from-zero/2022-1-terminal-friendly-code Ruby on rails example: https://github.com/rails/rails/blob/df24d689bcb11953aa4e1ab5316873d2479255a3/activerecord/lib/active_record/relation.rb#L798 -= Chapters =- 0:00 Explanation on how IRB displays the last command output 1:43 Using inspect to change how a simple class is displayed 4:32 Using pretty_pretty print to change how complex data is displayed 13:18 Looking at how ActiveRecord leverages inspect and pretty_print #ruby #irb #prettyprint

Download

0 formats

No download links available.

How to make your ruby code terminal friendly | NatokHD