Ideally I would have this in my gemfile
group :production do
gem 'blah' , :git => 'git:...'
end
group :development do
hostname :my_host_name do
gem "blah", :path => 'blah'
end
end
This way I could work on the gem and my collaborators could also work
on the gem and the deployment would come out of github. Of course
bundler doesn't work like this so I have tried several things to make
this work but I find none of them fully satisfactory. I am curious to
see what solutions if any you guys have come up with.
We used something like this:
https://github.com/stonean/slim/blob/master/Gemfile
--
You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rails-oceania/-/JpQF1R5DJskJ.
To post to this group, send email to rails-...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceani...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
Of course, using :path while working on it is helpful - I'd just change the Gemfile but not check it in while working on it. But yeah, that's not ideal either.
--
Pat
Once the bulk of the work was done and the engine was reasonably complete though, I think the approach you're suggesting would have been fine. My contract ended before we got to that stage though, so I don't know how it ended up! :)
Cheers,
W.
> One pain point I have is developing gems for rails.
>
> Ideally I would have this in my gemfile
>
> group :production do
> gem 'blah' , :git => 'git:...'
> end
>
> group :development do
> hostname :my_host_name do
> gem "blah", :path => 'blah'
> end
> end
This is probably a bad idea -- it's too easy for the version of the gem you develop against locally, and run the test suite against, to drift from what's running in production.
using `gem 'blah', path: '~/code/...'` is really useful for quick testing, but I don't think it should be used for your general dev setup.
The process of spec/code/commit/push on a gem is easy enough that using git paths and re-bundling isn't too much of an overhead, for most cases.
- Ben
gem 'mygem', '0.0.0', :path => 'vendor/engines/mygem'
I do a git init submodule && git update submodule in the capfile for
deployment. This works OK for my use case but it also has it's painful
spots.
Bundler really ought to have a better solution for this. I like the
idea of a hostname based solution where each developer (and possibly
each server) could have a different set of gems from different
locations.