dry-rb/dry-files

Dry::Files#readlines method is broken

Open

#20 opened on Mar 1, 2024

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Ruby (8 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (40 stars)
PR merge metrics
 (PR metrics pending)

Description

Describe the bug

The Dry::Files#readlines method that is mentioned in the user documentation seems to be broken. It is a private method and a call of the method raises the NoMethodError.

To Reproduce

require "dry/files"

Gem.loaded_specs["dry-files"].version # => 1.1.0

files = Dry::Files.new

files.readlines("test.txt")
# => private method `readlines' called for #<Dry::Files:0x00007fe5efe86cf0 @adapter=#<Dry::Files::FileSystem:0x00007fe5efec8088 @file=File, @file_utils=FileUtils>> (NoMethodError)

Expected behavior

Should be public and return an array of strings.

My environment

  • Affects my production application: YES
  • Ruby version: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
  • OS: Kernel: 5.15.0-97-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 5.8.4 tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy

Contributor guide