Urgent.News

What's breaking now, across thousands of outlets.

Tech

Ruby Pathname Moved to Core, Documentation Upgraded

In release 4.0, the Ruby Powers-That-Be have brought class Pathname into the Ruby core. This is a Very Good Thing. Through its many instance methods, a Pathname object provides a consistent and convenient interface to numerous methods in other classes and modules: Wraps almost all methods in class File and module FileTest . Wraps some methods in class Dir and module FileUtils . Advantages of…

In release 4.0, the Ruby Powers-That-Be have integrated the Pathname class into the Ruby core. This enhancement is a Very Good Thing as Pathname offers a consistent and convenient interface to numerous methods in other classes and modules. It wraps almost all methods in class File and module FileTest, and some methods in class Dir and module FileUtils.

Using Pathname instead of these alternatives eliminates the need to know which class or module has which methods and reduces the need to repeatedly type the class name and path variable. However, existing documentation for many Pathname methods only links to another method in another class, often with little to no local examples.

The documentation for Pathname has been significantly upgraded by the author, providing a Pathname-local description and example for each method. This rewrite eliminates the practice of linking to a similar or underlying method elsewhere. Additionally, the documentation for the Pathname class itself has been revised, and a "What's Here" section has been added.

The updated documentation can be found in Ruby master and will be released with Ruby 4.1 later this year. The author expresses hope that these improvements will make Pathnames even more user-friendly!

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How I turned Linear into a customer-facing roadmap without adding client seats

I built Feedvote because I kept running into a simple product problem: our team wanted to keep planning in Linear, but customers and stakeholders needed a much narrower view of what was happening.

  • Linear roadmap projected as controlled system, not additional client seats
  • Internal Linear system separate from public customer portal
  • Feedback and votes moderated before becoming Linear work

.NET 10 JSON Console Logging: Stop Parsing State.Message

The .NET 10 JSON console logging change is small enough to miss during an upgrade: the formatted message still exists, but a typical record no longer duplicates it at State.Message .

  • .NET 10 JSON console logging now places formatted message at top-level Message property
  • State.Message property now holds structured values, not duplicated formatted message
  • Parsers should prioritize top-level Message, retain State for structured data

More from Saturday 22 August →