I''m using ActiveRecord on a Sinatra app. I need one of my tables to be sorted, so I''m using acts_as_list (https://github.com/swanandp/acts_as_list). However, it isn''t a gem, so I don''t know how to get it to work with Bundler. Currently, I just cloned the source into a dir named "vendor". This works, but when I search my code, it keeps including acts_as_list code in the results. It also means more folders and files, so just generally more overhead. I''d like it to be as transparent as all the gems I use. Is there some way to get Bundler to deal with it, or is there a best practice for this situation? (I was thinking I could probably fork it, give it a gemspec, and then tell Bundler to look at my forked repo, does that sound reasonable?) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Josh Cheek
2011-May-30 00:52 UTC
Re: How to use an ActiveRecord plugin in a non-Rails project
On Sat, May 28, 2011 at 7:32 AM, Josh Cheek <josh.cheek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I was thinking I could probably fork it, give it a gemspec, and then tell > Bundler to look at my forked repo, does that sound reasonable? > >I ended up doing this. https://github.com/JoshCheek/acts_as_list Add one fairly simple file, and now it works with Bundler. Then load it into my app with: require "active_record/acts/list.rb" ActiveRecord::Base.send :include, ActiveRecord::Acts::List I think this was a good solution. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Wael Nasreddine
2011-May-30 07:46 UTC
Re: Re: How to use an ActiveRecord plugin in a non-Rails project
Hey Josh, Just as a side note, I think it would be more respectful to list all the authors of this gem in your gemspec file Gem::Specification.new do |s| ….. s.authors = [''Joshua Cheek''] ….. end Wael On May 30, 2011, at 2:52 AM, Josh Cheek wrote:> On Sat, May 28, 2011 at 7:32 AM, Josh Cheek <josh.cheek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I was thinking I could probably fork it, give it a gemspec, and then tell Bundler to look at my forked repo, does that sound reasonable? > > > I ended up doing this. https://github.com/JoshCheek/acts_as_list Add one fairly simple file, and now it works with Bundler. Then load it into my app with: > > require "active_record/acts/list.rb" > ActiveRecord::Base.send :include, ActiveRecord::Acts::List > > > I think this was a good solution. > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.