I''m running 0.14.2 and am a little confused as to the best way to install mix-ins. I''m specifically using "acts_as_paranoid" as an example (as it is one of the simpler implementations). It is a gem and can be "installed" as a gem, but then what''s the best way to integrate it into my app (require_gem?). I''ve seen recommendations to require it in the environment.rb file. But is that the best way now that plugins are available. Should I go straight to the SVN version, download and simply copy into the plugins directory? It would be great to hear what the "best practice" is for getting a mix-in working in an app as 1.0 is almost here. Any help is greatly appreciated. --Ryan
"Best practise" for plugins has yet to be established, as far as I know. There are tools in the rails 1.0 trunk which work with handling plugins using SVN, but there''s been no firm word from within the Rails Core team about which way they want to go. Your best bet is to try out using externals, svn exports and gems and feedback what you thought to the team - suggestions, improvements, and whatnot. - james On 11/3/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m running 0.14.2 and am a little confused as to the best way to > install mix-ins. I''m specifically using "acts_as_paranoid" as an > example (as it is one of the simpler implementations). It is a gem and > can be "installed" as a gem, but then what''s the best way to integrate > it into my app (require_gem?). I''ve seen recommendations to require it > in the environment.rb file. But is that the best way now that plugins > are available. Should I go straight to the SVN version, download and > simply copy into the plugins directory? > > It would be great to hear what the "best practice" is for getting a > mix-in working in an app as 1.0 is almost here. Any help is greatly > appreciated. > > --Ryan > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I personally like the SVN externals method .. I just do a simple "svn up" and all my plugins are updated. On 11/3/05, James Adam <james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > "Best practise" for plugins has yet to be established, as far as I > know. There are tools in the rails 1.0 trunk which work with handling > plugins using SVN, but there''s been no firm word from within the Rails > Core team about which way they want to go. > > Your best bet is to try out using externals, svn exports and gems and > feedback what you thought to the team - suggestions, improvements, and > whatnot. > > - james > > On 11/3/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I''m running 0.14.2 and am a little confused as to the best way to > > install mix-ins. I''m specifically using "acts_as_paranoid" as an > > example (as it is one of the simpler implementations). It is a gem and > > can be "installed" as a gem, but then what''s the best way to integrate > > it into my app (require_gem?). I''ve seen recommendations to require it > > in the environment.rb file. But is that the best way now that plugins > > are available. Should I go straight to the SVN version, download and > > simply copy into the plugins directory? > > > > It would be great to hear what the "best practice" is for getting a > > mix-in working in an app as 1.0 is almost here. Any help is greatly > > appreciated. > > > > --Ryan > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
The only issue with SVN at the moment is that the script/plugin tool can''t currently deal with tagged releases, so it''s tricky for a plugin developer to have stable versions along with development versions in the same repository. That aside, SVN is very attractive. On 11/3/05, Ramin <i8ramin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I personally like the SVN externals method .. I just do a simple "svn up" > and all my plugins are updated. > > > > On 11/3/05, James Adam <james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > "Best practise" for plugins has yet to be established, as far as I > > know. There are tools in the rails 1.0 trunk which work with handling > > plugins using SVN, but there''s been no firm word from within the Rails > > Core team about which way they want to go. > > > > Your best bet is to try out using externals, svn exports and gems and > > feedback what you thought to the team - suggestions, improvements, and > > whatnot. > > > > - james > > > > On 11/3/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m running 0.14.2 and am a little confused as to the best way to > > > install mix-ins. I''m specifically using "acts_as_paranoid" as an > > > example (as it is one of the simpler implementations). It is a gem and > > > can be "installed" as a gem, but then what''s the best way to integrate > > > it into my app (require_gem?). I''ve seen recommendations to require it > > > in the environment.rb file. But is that the best way now that plugins > > > are available. Should I go straight to the SVN version, download and > > > simply copy into the plugins directory? > > > > > > It would be great to hear what the "best practice" is for getting a > > > mix-in working in an app as 1.0 is almost here. Any help is greatly > > > appreciated. > > > > > > --Ryan > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > - Ramin > http://www.getintothis.com/blog > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
On 11/3/05, James Adam <james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The only issue with SVN at the moment is that the script/plugin tool > can''t currently deal with tagged releases, so it''s tricky for a plugin > developer to have stable versions along with development versions in > the same repository.That, and not everyone uses SVN. Most of my projects use darcs now. I prefer the gem installation method because it''s a standard ruby way to do things. I wrote acts_as_paranoid before plugins were around, so a require_gem in the environment worked fine. However, I went to adding an svn:external to my acts_as_paranoid working copy so that I didn''t have to bug textdrive about installing anything. I think I would much rather see a system that uses gems, providing an easy way to unpack them into your vendor/plugins directory (or just throwing a stub init.rb with require_gem). Svn/Darcs/etc support is of course vital for projects being constantly updated though. Just my 2 cents... -- rick http://techno-weenie.net
Since the environment.rb file has been reworked for 0.14.2, where in the file would you put require_gem "acts_as_paranoid". If I add it to the end of the file, webrick will not start. I''m getting a "missing method" error when trying to use it. Is there a specific place it needs to be? --Ryan On 11/3/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 11/3/05, James Adam <james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > The only issue with SVN at the moment is that the script/plugin tool > > can''t currently deal with tagged releases, so it''s tricky for a plugin > > developer to have stable versions along with development versions in > > the same repository. > > That, and not everyone uses SVN. Most of my projects use darcs now. > I prefer the gem installation method because it''s a standard ruby way > to do things. I wrote acts_as_paranoid before plugins were around, so > a require_gem in the environment worked fine. However, I went to > adding an svn:external to my acts_as_paranoid working copy so that I > didn''t have to bug textdrive about installing anything. > > I think I would much rather see a system that uses gems, providing an > easy way to unpack them into your vendor/plugins directory (or just > throwing a stub init.rb with require_gem). Svn/Darcs/etc support is > of course vital for projects being constantly updated though. > > Just my 2 cents... > > -- > rick > http://techno-weenie.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Oh, and I''ve also tried the svn:externals method as well. I have it in the working folders under vendor/plugins/acts_as_paranoid, but it gives the missing method error there as well. Is there anything else I need to do to get Rails to recognize and load the mix-in? --Ryan On 11/3/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Since the environment.rb file has been reworked for 0.14.2, where in > the file would you put require_gem "acts_as_paranoid". If I add it to > the end of the file, webrick will not start. I''m getting a "missing > method" error when trying to use it. Is there a specific place it > needs to be? > > --Ryan > > On 11/3/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 11/3/05, James Adam <james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > The only issue with SVN at the moment is that the script/plugin tool > > > can''t currently deal with tagged releases, so it''s tricky for a plugin > > > developer to have stable versions along with development versions in > > > the same repository. > > > > That, and not everyone uses SVN. Most of my projects use darcs now. > > I prefer the gem installation method because it''s a standard ruby way > > to do things. I wrote acts_as_paranoid before plugins were around, so > > a require_gem in the environment worked fine. However, I went to > > adding an svn:external to my acts_as_paranoid working copy so that I > > didn''t have to bug textdrive about installing anything. > > > > I think I would much rather see a system that uses gems, providing an > > easy way to unpack them into your vendor/plugins directory (or just > > throwing a stub init.rb with require_gem). Svn/Darcs/etc support is > > of course vital for projects being constantly updated though. > > > > Just my 2 cents... > > > > -- > > rick > > http://techno-weenie.net > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
On 11/3/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Oh, and I''ve also tried the svn:externals method as well. I have it in > the working folders under vendor/plugins/acts_as_paranoid, but it > gives the missing method error there as well. Is there anything else I > need to do to get Rails to recognize and load the mix-in? > > --Ryan > > On 11/3/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Since the environment.rb file has been reworked for 0.14.2, where in > > the file would you put require_gem "acts_as_paranoid". If I add it to > > the end of the file, webrick will not start. I''m getting a "missing > > method" error when trying to use it. Is there a specific place it > > needs to be?What is failing? require_gem? Is rubygems loaded? Even though environment.rb changed, the old syntax should still work. unless Object.const_defined?(:Gem) require ''rubygems'' end require ''acts_as_paranoid'' -- rick http://techno-weenie.net
I am also having trouble hooking up acts_as_paranoid on my Rails 0.14.3 server. I first tried installing via "sudo gem install acts_as_paranoid". That grabbed the code and put it in my server''s ruby gems location (not ~/.rails/). Editing environment.rb to add "require ''acts_as_paranoid''" and then adding "acts_as_paranoid" to my foo_controller causes all foo urls to give: undefined local variable or method `acts_as_paranoid'' for FooController:Class Then I tried this environment.rb incantation from this mailing list thread:> unless Object.const_defined?(:Gem) > require ''rubygems'' > end > > require ''acts_as_paranoid''But this gives the same error as above. Then I found the blog entry on technoweenie.net that indicated that I could use script/plugin to install from his subversion repository. http://techno-weenie.net/blog/code/273/updates-to-scriptplugin So I did ./script/plugin install And got sensible looking stuff in my vendors/plugins directory. This tutorial (http://wiki.rubyonrails.com/rails/pages/HowToWriteAnActsAsFoxPlugin) seems to indicate that valid code in that directory should just run. But it doesn''t - with or without edits to environment.rb to add require. What do I need to do to get acts_as_paranoid to work? (If I can master the install stuff, this and acts_as_versioned look like just what I need.) -- Cynthia Kiser cynthia.kiser-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
On 30-Nov-05, at 5:41 PM, Cynthia Kiser wrote:> undefined local variable or method `acts_as_paranoid'' for > FooController:Class >Isn''t acts_as_paranoid an ActiveRecord extension? It seems you''re trying to call the acts_as_paranoid method from a controller when (I believe) it''s something you put in your models. Regards, Trevor
The man is a genius! Moved the "acts_as_paranoid" line into the model file and works swimmingly. -- Cynthia Kiser cynthia.kiser-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> ~/.rails/). Editing environment.rb to add "require ''acts_as_paranoid''" > and then adding "acts_as_paranoid" to my foo_controller causes all foo > urls to give: >no require needed. plugins load automatically. but, you put acts_as_paranoid on your models, not controllers. -- rick http://techno-weenie.net
> Isn''t acts_as_paranoid an ActiveRecord extension? It seems you''re > trying to call the acts_as_paranoid method from a controller when (I > believe) it''s something you put in your models.Beat me to it. guess gmail was a bit slow :) -- rick http://techno-weenie.net