module Thor::Actions

def comment_lines(path, flag, *args)


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

==== Example

config:: give :verbose => false to not log the status.
flag:: the regexp or string used to decide which lines to comment
path:: path of the file to be changed
==== Parameters

a single space after the comment hash.
which existed before the beginning of the line in tact and will insert
Comment all lines matching a given regex. It will leave the space
def comment_lines(path, flag, *args)
  flag = flag.respond_to?(:source) ? flag.source : flag
  gsub_file(path, /^(\s*)([^#|\n]*#{flag})/, '\1# \2', *args)
end