Google Groups Home
Help | Sign in
Mephisto Plugin Support
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Rick Olson  
View profile
 More options Nov 13 2006, 5:11 pm
From: "Rick Olson" <technowee...@gmail.com>
Date: Mon, 13 Nov 2006 22:11:12 -0000
Local: Mon, Nov 13 2006 5:11 pm
Subject: [EXPERIMENTAL] Mephisto Plugin Support
So, I committed very basic plugin support for adding an admin
controller.  Try it, let's see if it works out.  I can't guarantee any
of this is going to stick though.  I'm worried that this will turn
Mephisto in a hacked frankenstein project, and that's just not
something I'm interested in working on.  I would just like to put in
enough to let some of you adventurous hackers tear into it without
having to bug me if stuff breaks.

This is just one of a few types of Mephisto plugins I can think of.
Future possibilities include plugins that add settings, plugins that
tweak admin forms, etc.  We've discussed this previously on the list,
but I wasn't far enough along in Mephisto to start writing code.  Now
that I have, feel free to tear it apart (followed closely with
suggestions...).

Some items I'm already thinking of:

- add a way to specify where to add the admin tab
- full migration support?
- Plugins page in the settings area, storing plugin migration version,
plugin settings, etc.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[EXPERIMENTAL] Mephisto Plugin Support" by Mislav Marohnić
Mislav Marohnić  
View profile
 More options Nov 13 2006, 5:35 pm
From: "Mislav Marohnić" <mislav.maroh...@gmail.com>
Date: Mon, 13 Nov 2006 23:35:08 +0100
Local: Mon, Nov 13 2006 5:35 pm
Subject: Re: [Mephisto] [EXPERIMENTAL] Mephisto Plugin Support

On 11/13/06, Rick Olson <technowee...@gmail.com> wrote:

> Some items I'm already thinking of:

> - add a way to specify where to add the admin tab
> - full migration support?
> - Plugins page in the settings area, storing plugin migration version,
> plugin settings, etc.

Rick,

I'm currently writing "Migration Extensions" plugin. It's going to change
the way people use migrations (well, overcome some obstacles at least) by
allowing separate migration sets as well as migrations from plugins - there
is already a new plugin for that some guys wrote, but my will supersede it.

If you remember, I'm writing the plugin because of my need to extend
Mephisto which we discussed some time ago. I will let you know about the
first release for you to consider adding it to Mephisto as a part of the
future plugin system.

This is the README if anyone's still wondering what I'm talking about:
https://idonee.irb.hr/svn_mislav/public/rails/migration_extensions/RE...

--
Mislav


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Caudill  
View profile
 More options Nov 13 2006, 11:59 pm
From: Stephen Caudill <scaud...@gmail.com>
Date: Mon, 13 Nov 2006 23:59:57 -0500
Local: Mon, Nov 13 2006 11:59 pm
Subject: Re: [Mephisto] [EXPERIMENTAL] Mephisto Plugin Support
Looks like an excellent first pass.  Now for the flogging ;D (I kid!  
I kid!)

for a plugin named 'foo_bar' the schema installation expects a file  
to be at:

vendor/plugins/mephisto_foo_bar/lib/mephisto_foo_bar/schema

Is the "mephisto_" preface going to be the convention?  Obviously,  
plugins relying on the mephisto plugin need to come alphabetically  
after it, so that may be a good way to ensure they're loaded after  
it, until rails implements plugin load ordering.  Seems pretty rigid  
though, and drastically reduces the available namespace... not that I  
have a better alternative though.

After a minor patch [1] to add the .rb extension to the path name,  
the installation still produces errors:

[11:22:31][caudill@lazuli][trunk]$ script/runner -e production  
'Mephisto::Plugin.install :foo_bar'
-- create_table("foo_bars", {:force=>true})
    -> 0.6597s
./script/../config/../vendor/rails/railties/lib/commands/runner.rb:
47: ./script/../config/../vendor/rails/activerecord/lib/../../
activesupport/lib/active_support/dependencies.rb:471:in  
`const_missing': uninitialized constant FooBar::Schema (NameError)
         from ./script/../config/../vendor/plugins/mephisto/lib/
mephisto_core/plugin.rb:56:in `find_plugin_migration'
         from ./script/../config/../vendor/plugins/mephisto/lib/
mephisto_core/plugin.rb:17:in `install'
         from (eval):1
         from script/runner:3:in `eval'
         from ./script/../config/../vendor/rails/railties/lib/
commands/runner.rb:47
         from script/runner:3

Not too sure where it's looking for FooBar::Schema or what it would  
be if I knew where it should be...  The install *does* however create  
the table though, errors and all.  The uninstall doesn't remove the  
table though:

[11:32:12][caudill@lazuli][trunk]$ script/runner -e production  
'Mephisto::Plugin.uninstall :foo_bar'
-- create_table("foo_bars", {:force=>true})
    -> 0.6953s
./script/../config/../vendor/rails/railties/lib/commands/runner.rb:
47: ./script/../config/../vendor/rails/activerecord/lib/../../
activesupport/lib/active_support/dependencies.rb:471:in  
`const_missing': uninitialized constant FooBar::Schema (NameError)
         from ./script/../config/../vendor/plugins/mephisto/lib/
mephisto_core/plugin.rb:56:in `find_plugin_migration'
         from ./script/../config/../vendor/plugins/mephisto/lib/
mephisto_core/plugin.rb:22:in `uninstall'
         from (eval):1
         from script/runner:3:in `eval'
         from ./script/../config/../vendor/rails/railties/lib/
commands/runner.rb:47
         from script/runner:3

Same error.

After running things down for a while, I got a basic admin plugin [2]  
working (well, after a fashion, visiting the controller in the admin  
pulls up fine the first time, but throws errors every time it's  
loaded after that), but I had to do something odd in the controller  
to avoid this:

vendor/plugins/mephisto_foo_bar/lib/foo_bar_controller.rb to define  
FooBarController

Apparently, the `returning Mephisto::Plugin.controller` call in  
Mephisto::Admin to instantiate the controller causes it to expect both:

Module Admin
   class FooBarController; end
end

  -- and --

class FooBarController; end

which makes for a wacky looking controller :)

I'll keep digging around tomorrow and see if I can provide more  
feedback and patches.

Cheers!

- Stephen

[1] http://pastie.caboo.se/22604
[2] http://svn.exdolo.com/projects/plugins/mephisto_foo_bar/

On Nov 13, 2006, at 5:11 PM, Rick Olson wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Olson  
View profile
 More options Nov 14 2006, 12:53 am
From: "Rick Olson" <technowee...@gmail.com>
Date: Mon, 13 Nov 2006 23:53:37 -0600
Local: Tues, Nov 14 2006 12:53 am
Subject: Re: [Mephisto] Re: [EXPERIMENTAL] Mephisto Plugin Support
On 11/13/06, Stephen Caudill <scaud...@gmail.com> wrote:

> Looks like an excellent first pass.  Now for the flogging ;D (I kid!
> I kid!)

> for a plugin named 'foo_bar' the schema installation expects a file
> to be at:

> vendor/plugins/mephisto_foo_bar/lib/mephisto_foo_bar/schema

> Is the "mephisto_" preface going to be the convention?  Obviously,
> plugins relying on the mephisto plugin need to come alphabetically
> after it, so that may be a good way to ensure they're loaded after
> it, until rails implements plugin load ordering.  Seems pretty rigid
> though, and drastically reduces the available namespace... not that I
> have a better alternative though.

Yup, there's a mephisto plugin now that does some basic monkey
patching, and adds the Mephisto::Plugin and Mephisto::Admin classes.
I don't see rails getting plugin load ordering behind alphabetical any
time soon.

> After a minor patch [1] to add the .rb extension to the path name,
> the installation still produces errors:

Why do you need the .rb extension?

This is what you need for the schema.
module FooBar
  class Schema < ActiveRecord::Migration
    def install
    end
    def uninstall
    end
  end
end

> After running things down for a while, I got a basic admin plugin [2]
> working (well, after a fashion, visiting the controller in the admin
> pulls up fine the first time, but throws errors every time it's
> loaded after that), but I had to do something odd in the controller
> to avoid this:

> vendor/plugins/mephisto_foo_bar/lib/foo_bar_controller.rb to define
> FooBarController

lib/admin/foo_bar_controller.rb

module Admin
  class FooBarController < Admin::BaseController
  end
end

Probably would have helped if I had included a reference plugin to go
by.  It's just not ready for release yet.

--
Rick Olson
http://weblog.techno-weenie.net
http://mephistoblog.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Caudill  
View profile
 More options Nov 14 2006, 12:17 pm
From: Stephen Caudill <scaud...@gmail.com>
Date: Tue, 14 Nov 2006 12:17:40 -0500
Local: Tues, Nov 14 2006 12:17 pm
Subject: Re: [Mephisto] Re: [EXPERIMENTAL] Mephisto Plugin Support

On Nov 14, 2006, at 12:53 AM, Rick Olson wrote:

>> After a minor patch [1] to add the .rb extension to the path name,
>> the installation still produces errors:

> Why do you need the .rb extension?

Apparently I didn't :P  I didn't note the fact that that was a  
require, I was just hunting down errors in the console and I thought  
that solved a problem I was having. reverted the change and it works  
fine.

> This is what you need for the schema.
> module FooBar
>   class Schema < ActiveRecord::Migration
>     def install
>     end
>     def uninstall
>     end
>   end
> end

Still can't get this working... Here's the latest version of the schema:

http://svn.exdolo.com/projects/plugins/mephisto_foo_bar/lib/
mephisto_foo_bar/schema.rb

[12:16:11][caudill@lazuli][trunk]$ script/runner -e production  
'Mephisto::Plugin.install :foo_bar'
./script/../config/../vendor/rails/railties/lib/commands/runner.rb:
47: /Users/caudill/Desktop/trunk/vendor/plugins/mephisto_foo_bar/lib/
mephisto_foo_bar/schema.rb:1: FooBar is not a module (TypeError)

>> vendor/plugins/mephisto_foo_bar/lib/foo_bar_controller.rb to define
>> FooBarController

> lib/admin/foo_bar_controller.rb

> module Admin
>   class FooBarController < Admin::BaseController
>   end
> end

Weird.  I could swear that I did that in one of my attempts.  Oh  
well, works now :)

Cheers Rick :)   This is really awesome!

- Stephen


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Mephisto Plugin Support" by empath
empath  
View profile
 More options Nov 30 2006, 10:48 am
From: "empath" <emp...@gmail.com>
Date: Thu, 30 Nov 2006 15:48:04 -0000
Local: Thurs, Nov 30 2006 10:48 am
Subject: Re: Mephisto Plugin Support
Being able to install plugins from admin instead of the command line
would be hot.

On Nov 13, 5:11 pm, "Rick  Olson" <technowee...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Olson  
View profile
 More options Nov 30 2006, 10:55 am
From: "Rick Olson" <technowee...@gmail.com>
Date: Thu, 30 Nov 2006 09:55:33 -0600
Local: Thurs, Nov 30 2006 10:55 am
Subject: Re: [Mephisto] Re: Mephisto Plugin Support
On 11/30/06, empath <emp...@gmail.com> wrote:

> Being able to install plugins from admin instead of the command line
> would be hot.

Due to the way that rails apps run, this wouldn't be easy.  Anyone up
to the challenge?

--
Rick Olson
http://weblog.techno-weenie.net
http://mephistoblog.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google