Since the dependency is on Rails framework, the right approach is to create a RailsEngine that you can share across your Rails applications not gem.
Bala Paranj www.rubyplus.com On Friday, August 1, 2014 6:12:31 PM UTC-7, Ruby-Forum.com User wrote: > > I am creating an application using rails and spree at work. One point > of value is the administrator being able to upload files that will seed > the database. > > > Our original solution was datashift_spree: > https://github.com/autotelik/datashift_spree > > Two problems arose. 1) apparently, the datashift bundle is 250 MB and > was hindering our deployment to heroku. 2) We couldn't figure out how > to use it from within a deployed application. > > After a few people spent a few days with these problems, I ended up just > writing the functionality myself ( no datashift at all ). We have two > applications being developed, and the code is valuable to both. > > We would like to extract it, and the first thought was 'gem'. > > And thus the questions arise :) > > Assuming making a gem is the correct idea, I'm going to need to call > ActiveRecord methods such as 'create' from within the gem. How do I > create or simulate a database that the gem can connect to? When I do > get passed that question, how do I tell the gem to be able to 'know' > when it is just me testing it, and it being in a real rails environment? > > Thanks. > > -- > Posted via http://www.ruby-forum.com/. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f07a013b-a4f6-4b2f-a828-a3d38fa7b66f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

