Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Organising workflow for custom gem development

I want to add some features to one gem. I've forked this gem on GitHub, add changes and push them. Then I created another rails project and add this gem with GitHub link to my repo. Now I can see changes in this gem work.

Now my workflow is:

  1. Change something in the gem
  2. Push changes to GitHub
  3. Run bundle install in other app
  4. Start server
  5. Watch changes

Now I want to make my work more intensive, so I need more convenient way to organise my workflow. I want to see changes in gem without pushing to GitHub and so on. How to minimise actions to this:

  1. Change something in gem locally
  2. Restart rails app
  3. See changes in gem work

Update 1

Installing gem with 'path' option seems not help. I add tag to main gem layout, add alert with text. Then I run my main app, and see this alert. After that I go to the gem folder, change alert text. In main app I do bundle install and bundle update, restart main app, but the text in alert didn't change

FINAL

I try to add alert not to layout, but to js script. Now my changes appear as I want. In previous edit my error was that layout is generated once and doesn't change, while scripts are included and can be updated.

like image 305
Kindoloki Avatar asked Apr 26 '26 14:04

Kindoloki


1 Answers

If you use bundler you can point gems to a local path. In your Gemfile:

gem 'madeup', path: '/path/to/gem'

This will allow you to see changes immediately.

It is also worth mentioning that you can point to a GitHub repo as well. Although that won't help you in this instance, it's still useful to know.

gem 'madeup', github: 'http://github.com/user/repo', branch: 'my-branch'
like image 110
jordelver Avatar answered Apr 29 '26 04:04

jordelver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!