Socket
Book a DemoInstallSign in
Socket

recursive_replace

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recursive_replace

0.1.2
bundlerRubygems
Version published
Maintainers
2
Created
Source

recursive_replace

A ruby gem for recursively replacing text in multiple files and directories. It also escapes special characters, so you can replace code syntax and special characters easily. recursive_replace also comes with a testing suite for verification against several data types and programming languages.

Installation

gem install recursive_replace

Usage

From Console/Terminal

recursive_replace [original] [replacement] [optional_path] 
echo "bad bad good" > test
recursive_replace bad good # replaced bad with bad
cat test # => good good good
rm test

Ruby

echo "<%= @object[:bad] %>" > test # use quotes when using special characters 
recursive_replace "<%= @object[:bad] %>" "<%= @new_object[:good] %>" 
cat test # => <%= @new_object[:good] %>
rm test

From Code

require "recursive_replace"
file = File.join("home", "bob", "Documents")
RecursiveReplace.replace("bad", "good", :path => file)

FAQs

Package last updated on 09 Sep 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.