Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Must be run in the context of your rails app
- # if you put this in a rake task, you'll need to ensure the task depends on the :environment task
- require 'rails/generators'
- require "#{::Rails.root.to_s}/lib/generators/foo_bar/article/article_generator.rb"
- # make a generator (new calls .shift on the first arg, so it must be looking for an array)
- gen = FooBar::ArticleGenerator.new(["Der title of der article"])
- # run your create_ methods here:
- gen.create_article
- gen.create_article_file
Add Comment
Please, Sign In to add comment