Update generator‘s action manifest.
Methods
Public Instance methods
[ show source ]
# File vendor/rails/railties/lib/rails_generator/commands.rb, line 595
595: def complex_template(relative_source, relative_destination, template_options = {})
596:
597: begin
598: dest_file = destination_path(relative_destination)
599: source_to_update = File.readlines(dest_file).join
600: rescue Errno::ENOENT
601: logger.missing relative_destination
602: return
603: end
604:
605: logger.refreshing "#{template_options[:insert].gsub(/\.erb/,'')} inside #{relative_destination}"
606:
607: begin_mark = Regexp.quote(template_part_mark(template_options[:begin_mark], template_options[:mark_id]))
608: end_mark = Regexp.quote(template_part_mark(template_options[:end_mark], template_options[:mark_id]))
609:
610: # Refreshing inner part of the template with freshly rendered part.
611: rendered_part = render_template_part(template_options)
612: source_to_update.gsub!(/#{begin_mark}.*?#{end_mark}/m, rendered_part)
613:
614: File.open(dest_file, 'w') { |file| file.write(source_to_update) }
615: end
[ show source ]
# File vendor/rails/railties/lib/rails_generator/commands.rb, line 617
617: def directory(relative_path)
618: # logger.directory "#{destination_path(relative_path)}/"
619: end
[ show source ]
# File vendor/rails/railties/lib/rails_generator/commands.rb, line 587
587: def file(relative_source, relative_destination, options = {})
588: # logger.file relative_destination
589: end
[ show source ]
# File vendor/rails/railties/lib/rails_generator/commands.rb, line 591
591: def template(relative_source, relative_destination, options = {})
592: # logger.template relative_destination
593: end