module Thor::Actions
def uncomment_lines(path, flag, *args)
uncomment_lines 'config/initializers/session_store.rb', /active_record/
==== Example
config
flag
path
==== Parameters
the comment hash and removes the hash and any immediate following space.
Uncomment all lines matching a given regex. Preserves indentation before
def uncomment_lines(path, flag, *args) flag = flag.respond_to?(:source) ? flag.source : flag gsub_file(path, /^(\s*)#[[:blank:]]?(.*#{flag})/, '\1\2', *args) end