Project

General

Profile

Actions

Backport #7157

closed

Ruby ignores Kernel#gsub block

Added by popoxee (Bruce Metz) over 11 years ago. Updated over 11 years ago.

Status:
Closed
[ruby-core:47967]

Description

When working with command line and use Kernel#gsub, ruby ignores the block if given.

Reproduce code:

Test text file:
File name:
test
File Content:
test

Test Command line input:

ruby -pe 'gsub(/t([a-z])s/){"d"+$1.capitalize}' test

Expected output:

dEt

Actual output:

#Enumerator:0x00000001c78520

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0