method

comment_lines

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/