`rails plugin new` generator #94

wants to merge 36 commits into


None yet
5 participants

drogus commented Nov 6, 2010

I've prepared a generator for rails plugins, which generates basic structure for rails extension:

  • lib dir with
  • tests with dummy application at test/dummy (the easiest way to test rails extension is to run tests with real rails app)
  • gemspec

It's very similar to http://github.com/josevalim/enginex, but ported to rails with support for PluginBuilder (like AppBuilder) and templates (eg. rails plugin new foo -m some_template.rb).

There is also --full option which will generate integration tests, which is handy when you want to make a rails engine. To create mountable engine you can pass --mountable option, which will additionally create routes file and engine definition and automatically mount engine in dummy application.

drogus added some commits Oct 15, 2010

@drogus drogus Added 'rails plugin new' generator which generates gem plugin skeleton.
This command is based on enginex gem by José Valim. It generates gem structure
and ads dummy application into test/dummy. This can be used to start developing
any kind of extension for rails 3.
@drogus drogus Refactored AppGenerator and PluginNewGenerator to inherit from AppBase. b37938e
@drogus drogus Ensure that options for plugin new generator are not passed to applic…
…ation generator
@drogus drogus Add support for templates for rails plugin new bcd414f
@drogus drogus That method is already declared at AppBase bbf02ff
@drogus drogus Added USAGE for rails plugin new 5c8b48a
@drogus drogus Add --dev and --edge options to rails plugin new e51e9e2
@drogus drogus Change // style regexp to %r{}, to not confuse editors code highlighting 59d5222
@drogus drogus Allow easy overriding of test framework in 'rake plugin new' generato…
…r, using PluginBuilder
@drogus drogus Ensure that tests run properly fd1562a
@drogus drogus Make tests for app and plugin generators more DRY ae1debd
@drogus drogus Builder should not be responsible for running store_application_defin…
…ition method
@drogus drogus We don't need gem tasks, we have a gemspec ac8f927
@drogus drogus Remove integration tests and ActionModel/ActiveRecord calls from 'rak…
…e plugin new' generator, it shouldn't be available as default option
@drogus drogus DRY up app generator and plugin new generator. Moved shared options t…
…o AppBase generator
@drogus drogus No need for say_step in 'plugin new' generator fdbd9df
@drogus drogus Add --full option to 'plugin new' generator, which generates rails en…
@drogus drogus Pass more options to test/dummy in 'plugin new' generator 46fdb31
@drogus drogus No need to require 'app_base', it's required in app_generator 013fc0a
@drogus drogus Don't be verbose while creating dummy application in plugin new gener…
@drogus drogus Do not create additional newline 9e86767
@drogus drogus Use application's generators defaults as engine defaults to not force…
… users to manually set it
@drogus drogus Added Hash#deep_dup function which performs deep duplication on given…
… hash
@drogus drogus Make deep copy of application generators on engine initialization.
Otherwise nested hashes will be same objects for both application and engine,
which will result in overwriting each others values on changes.
@drogus drogus Refactor app and plugin generators to use new Thor API 9cb9713
@drogus drogus We don't need to configure ActionMailer in plugin's test helper, it's…
… configured by dummy app
@drogus drogus Use rails integration tests by default in 'plugin new' generator 57fae9b
@drogus drogus Skip active record properly in 'plugin new' generator b6497d3
@drogus drogus Properly handle other databases in 'plugin new' generator 2133495
@drogus drogus Properly skip test unit in 'plugin new' generator fadad11
@drogus drogus create_dummy_app method that allows to easily create dummy applicatio…
…n from template
@drogus drogus Add example rake task to 'plugin new' generator c159b50
@drogus drogus Add --mountable option to 'plugin new' generator which generates full…
… mountable application (engine)
@drogus drogus Fix scaffold generator to be aware of namespace in isolated engine d0d30e7
@drogus drogus New version of thor was released no need to use the one from git 1fd4624
@drogus drogus Allow to set dummy application path through options cc135e3

josevalim replied Oct 26, 2014


zenspider replied Oct 27, 2014

Then the original backtrace filter (or some equivalent) should be installed. There's no good reason to provide the full backtrace for the minitest runner.


chancancode replied Oct 27, 2014


I suppose it would be better if we re-implement those rules with the AS backtrace cleaner rather than relying on the :nodoc:'ed one in minitest? (We already required it anyway..) @rafaelfranca, @zenspider?

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment