module Thor::Actions
def inject_into_file(destination, *args, &block)
end
gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n")
gems = ask "Which gems would you like to add?"
inject_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do
inject_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n"
==== Examples
for injection (:after or :before).
config
data
destination
==== Parameters
method is reversible.
Injects the given content into a file. Different from gsub_file, this
def inject_into_file(destination, *args, &block) if block_given? data, config = block, args.shift else data, config = args.shift, args.shift end action InjectIntoFile.new(self, destination, data, config) end