A
A
Anton Ivanov2017-04-04 23:18:25
Ruby on Rails
Anton Ivanov, 2017-04-04 23:18:25

How to call a specific command in rails after every use of a generator?

Hello.
I want even more magic))) I want to automatically add files created by generators in git. I didn’t find this in the documentation (any hook for generators)
You can, of course, change each generator (take the default ones and drag them into the project by adding a git call, but I don’t want to bother myself with synchronizing changes after each update)
Maybe you can decoy - patch some class that is called when rails generate is called?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Ivanov, 2017-04-04
@Fly3110

The issue was solved with the Rails::Generators.invoke decoy patch

C
Chronic 86, 2017-04-05
@chronic86

As an option to do without decoy-patching, create your own generators. guides.rubyonrails.org/generators.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question