method

comment_lines

ruby latest stable - Class: Bundler::Thor::Actions

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

comment_lines(path, flag, *args)
public

Comment all lines matching a given regex. It will leave the space which existed before the beginning of the line in tact and will insert a single space after the comment hash.

Parameters

path

path of the file to be changed

flag<Regexp|String>

the regexp or string used to decide which lines to comment

config

give :verbose => false to not log the status.

Example

comment_lines 'config/initializers/session_store.rb', /cookie_store/