How to manage rails plugin and test application versions together

I am creating my first rails plugin and find that version control of the plugin and test application is quite annoying.

Here is my problem:

To really test my plugin in action, I need to run it in a test application (which basically is just the scaffold application in which I install the plugin)

When I make changes to the plugin, it’s convenient for me to change it in a test application to see the changes right away. However, when I want to commit and revert my changes to github, I will end up copying all the files from the test application back to my Naked Plugin folder and making my commits.

Is there a better way to handle this without copying files back and forth? I am interested to hear from other plugin developers, if possible, about how you deal with this situation.

One of the potential solutions that I realized is to have another git repository in the vendor / plugins / myplugin directory (which will have a remote github repo). I'm not sure if this is the best (and so far I have not really managed to get it to work ...)

+3
source share
4 answers

I recommend using git submodules, a detailed description .

+3
source

vendor/plugin, . Windows, junction . :

c:\test_app
     vendor
       plugin
         foo_plugin -> points to c:\foo_plugin

c:\foo_plugin
  lib
+1

, . , , / script/server. , , , .

, - lib rails. 99%, lib . .

+1

, . scaffold Gemfile :

gem 'foo',: path = > "../foo"

, scaffold / ; git. - , ( , 3).

, , :

http://keithschacht.com/creating-a-rails-3-engine-plugin-gem

As the end user of the plugin, I think it is much easier if it is packaged like a gem. Not only can you use more functionality with the gem, developers can install it once and use it in many applications, dependencies can be easily processed, updates are as simple as changing the version number, and you do not need to store the whole plugin in your The main repository application.

+1
source

Source: https://habr.com/ru/post/1760464/


All Articles