module Thor::Actions
def uncomment_lines(path, flag, *args)
uncomment_lines 'config/initializers/session_store.rb', /active_record/
==== Example
config
flag
path
==== Parameters
between the comment hash and the beginning of the line.
which existed before the comment hash in tact but will remove any spacing
Uncomment all lines matching a given regex. It will leave the space
def uncomment_lines(path, flag, *args) flag = flag.respond_to?(:source) ? flag.source : flag gsub_file(path, /^(\s*)#[[:blank:]]*(.*#{flag})/, '\1\2', *args) end