Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. # Must be run in the context of your rails app
  2. # if you put this in a rake task, you'll need to ensure the task depends on the :environment task
  3.  
  4. require 'rails/generators'
  5. require "#{::Rails.root.to_s}/lib/generators/foo_bar/article/article_generator.rb"
  6.  
  7. # make a generator (new calls .shift on the first arg, so it must be looking for an array)
  8. gen = FooBar::ArticleGenerator.new(["Der title of der article"])
  9.  
  10. # run your create_ methods here:
  11. gen.create_article
  12. gen.create_article_file
Add Comment
Please, Sign In to add comment