inject_into_module(path, module_name, *args, &block)public
Injects text right after the module definition. Since it depends on insert_into_file, it’s reversible.
Parameters
|
path of the file to be changed | |
module_name<String|Class> |
the module to be manipulated |
|
the data to append to the class, can be also given as a block. | |
|
give :verbose => false to not log the status. |
Examples
inject_into_module "app/helpers/application_helper.rb", ApplicationHelper, " def help; 'help'; end\n" inject_into_module "app/helpers/application_helper.rb", ApplicationHelper do " def help; 'help'; end\n" end