Have you ever tried to install a Rails plugin in front of 40 people? If so, you know that no matter what plugin you choose, it will take at least 3 minutes and 18 seconds for ./script/plugin to discover the plugin you requested, and another 36 seconds to copy the files to your application. By that time you’ve finished writing an entire blog and a Flickr clone in Rails.
At RubyConf, I talked to James, Ben, and Kyle about designing a centralized plugin repository and a better ./script/plugin. We received the blessing of the Rails core team via Rick.
The first product of this is RaPT (Rails Plugin Tool). It keeps a cache of plugin repositories and metadata to make plugin installation speedy.
Rick also suggested that we develop it separately until it is completely ready to be submitted back to the Rails core.
# Install the gem $ sudo gem install rapt # Reload the shell's executable paths $ rehash # Rebuild cache at ~/.rails/plugin_source_cache.yml $ rapt discover --no-prompt discovered: http://mattmccray.com/svn/rails/plugins/ $ rapt install comatose + ./comatose/CHANGELOG + ./comatose/INSTALL + ./comatose/about.yml ...
If your plugin has it’s own about.yml, you can do this:
$ rapt about comatose --- plugin: http://mattmccray.com/svn/rails/plugins/comatose license: MIT author: Matt McCray rails_version: 1.0+ summary: A micro CMS for embedding in Rails applications. version: 0.3 homepage: http://mattmccray.com
Future enhancements include a central repository for plugins, auto-announcing of plugins you’ve developed (but only if you choose to open-source them), and auto-upgrading. I’m going to try to match the syntax of RubyGems for the commands since the functionality is similar.

Not to sound retarded, but should RaPT only work inside of a Rails directory? When I executed it in my home folder, it fails miserably, stating that ‘root’ is not a method (on line 10 in commands.rb). I looked, and it’s trying to find the value of root in a Rails environment… Of course, it worked inside of a Rails app folder, confirming my hypothesis. So, is this intended? Should RaPT fail completely, without a warning as to why, if it’s outside? Am I just stupid for trying to use it outside of a Rails app directory? :)
Thanks, though, for the work on this. It looks like a great gem (pun pseudo-intended) and I look forward to it being integrated into Rails along with the central repository, et al.
Cheers,
M.T.
Also, is there a possibility of having a -c option to add the files to the Subversion repository? :D
Hmm, is there a Trac up for this thing yet? Hehehe.
M.T.
Thanks for trying it out so quickly!
There is a RubyForge project and bug tracker:
http://rubyforge.org/projects/rapt/
Bug Tracker at RubyForge
It’s a branch off the same code that ./script/plugin uses. However, we want to improve on the existing behavior and make it smarter in relation to Subversion projects. I’ll add a -c option to the feature list.
There is a—root=/path/to/my/rails_app argument from the old code, but it doesn’t seem to be working. I’ll add a bug and work on fixing that.
Very nice! This sped things up immensely for a new project I’m starting today.
Good stuff, Geoff! Auto-Upgrading sounds interesting. I’m assuming that’ll be more than just using
svn:externals...Oh and free advertising, to boot! So what do I owe you for the Comatose plug? ;-)
M: No charge! That’s a reward for including an about.yml in your plugin! :-) (and for writing a useful one, too).Cool.
Maybe you could do this before, but I’m having a ball just reading the
plugin_source_cache.ymlthat is produced. Thanks!I overheard you talking about this at RailsConf. Glad to see this project out in the open!
I’ve always wanted to see some sort of plugin dependency system in rails… perhaps that’s something this project could implement?
The way I see it is in a plugin’s YML file, there’d be a list of other plugins it requires (like acts_as_versioned or something). After a plugin is installed, the YML would be read and any other plugins that weren’t already installed would then be downloaded and the process repeats.
@warren: That’s a great idea and I hope to implement that feature into the system.
Thanx for the elaborate discussion! Great feature! I hope to start this one soon into my system. Wish it runs successfully.
Do I have to rediscover the plugins for each Rails app? Or can it only be done once?