Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

`rails plugin new` generator #94

Closed
wants to merge 36 commits into from

5 participants

@drogus
Collaborator

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
@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.
cfcea1d
@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
b8a0fab
@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
b36fa51
@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
48fef64
@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
68295bc
@drogus drogus DRY up app generator and plugin new generator. Moved shared options t…
…o AppBase generator
d995953
@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…
…gine
671d146
@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…
…ator
489b279
@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
cfbe595
@drogus drogus Added Hash#deep_dup function which performs deep duplication on given…
… hash
5071b72
@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.
a5311ee
@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
4d108cb
@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
f9e33fc
@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)
cbe391b
@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
@rafaelfranca

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.

https://github.com/rails/rails/blob/master/railties/lib/rails/test_help.rb#L15
https://github.com/seattlerb/minitest/blob/master/lib/minitest.rb#L750-L764

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
Commits on Nov 2, 2010
  1. @drogus

    Added 'rails plugin new' generator which generates gem plugin skeleton.

    drogus authored
    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.
  2. @drogus
  3. @drogus
  4. @drogus
  5. @drogus
  6. @drogus
  7. @drogus
  8. @drogus
  9. @drogus
  10. @drogus

    Ensure that tests run properly

    drogus authored
  11. @drogus
  12. @drogus
  13. @drogus
  14. @drogus

    Remove integration tests and ActionModel/ActiveRecord calls from 'rak…

    drogus authored
    …e plugin new' generator, it shouldn't be available as default option
  15. @drogus
  16. @drogus
  17. @drogus
  18. @drogus
  19. @drogus
  20. @drogus
  21. @drogus
  22. @drogus

    Use application's generators defaults as engine defaults to not force…

    drogus authored
    … users to manually set it
  23. @drogus
  24. @drogus

    Make deep copy of application generators on engine initialization.

    drogus authored
    Otherwise nested hashes will be same objects for both application and engine,
    which will result in overwriting each others values on changes.
  25. @drogus
  26. @drogus
  27. @drogus
  28. @drogus
  29. @drogus
  30. @drogus
  31. @drogus
  32. @drogus
  33. @drogus

    Add --mountable option to 'plugin new' generator which generates full…

    drogus authored
    … mountable application (engine)
Commits on Nov 3, 2010
  1. @drogus
Commits on Nov 4, 2010
  1. @drogus
Commits on Nov 8, 2010
  1. @drogus
Something went wrong with that request. Please try again.