6

I want to create an application in Rails with plugin system. Potential user should be able to upload (or better install from repository) a plugin and install it enabling my application to do something more. This should be done WITHOUT FTP/SSH/any low-level access to server.

So are there any good gems or tutorials on how it should be done in Rails 3?

Migol
  • 8,161
  • 8
  • 47
  • 69
  • possible duplicate of [Building an extension framework for a Rails app](http://stackoverflow.com/questions/2570072/building-an-extension-framework-for-a-rails-app) – lulalala May 03 '15 at 07:37

2 Answers2

0

Have you looked at http://edgeguides.rubyonrails.org/plugins.html?

It doesn't seem to be 100% compatible with Rails 3 but it can get you started. Most of the plugin articles I've seen cover Rails 2.

TK-421
  • 10,598
  • 3
  • 38
  • 34
  • This is not exactly what I have in mind, because it operates on RoR stack rather than my app. But this is some alternative for me. – Migol Jan 17 '11 at 15:01
0

I actually just recently thought about a solid concept for this myself. You want to look at $SAFE, rubys tainting mechanisms and learn all about the security implications of eval()ing ruby code, if you plan on allowing the user to write their plugins in ruby.

If you trust your users to the point of confidently allowing them to do this, that is.

There are also many resources (gems, articles, do the googling) on sandboxing in Ruby - you should evaluate for yourself how practicable and/or safe these are.

If you do not trust the user at all, you should look into writing your own DSL in ruby or implementing other means of expressing functionality without executing user submitted code directly.

Doing something like this properly is no easy task.

fx_
  • 1,932
  • 13
  • 17
  • I was thinking more of a Wordpress-like system when if user installs my software on own server he can upload anything he wants, but when on mine server he can choose from plugins that have been pre-uploaded and approved. – Migol Mar 17 '11 at 13:52
  • 3
    Then you might want to look at Rails Plugins, like suggested below. Simply let the user write a Rails Plugin that can use functionality exposed by your application to hook into it. [Redmine](http://redmine.org) does it like this, see their [Redmine Plugins Page](http://www.redmine.org/projects/redmine/wiki/Plugins). – fx_ Mar 17 '11 at 15:53