[Radiant] Three Steps to Ease Extensions

2010-04-24 Thread Jeff Casimir
Morning All,

I've been thinking about extensions on and off for the past few
months.  I really think installing extensions is too hard, here are
three ideas to ease the process.  These assume that the work Jim has
done to gem-ify extensions is good and that all extensions should be
distributed as gems.

Sneaky Asset Management =

I want to get rid of radiant:extensions:xyz:update and the Rails
router does most of the hard work.  Let's establish that assets for
extensions are held in a place like /public/extensions/xyz/assets/.
We'd need a route and controller that listened for that route, then
just pull the assets from within the gem (stored in some similarly
structured folder within the library).

Of course a few users will want to customize the assets.  So we need a
radiant:extensions:xyz:unpack_assets (basically the same as the old
update) that copies the assets to the same place in
/public/extensions/xyz/assets.  The Rails router will pickup these
static files with a higher precedence than the asset-finding-in-gems
route, so there is nothing complicated.

Why do this?  Reducing the steps and complexity for the installation.
Drop the gem in, require it, and you might be ready to go.  It'd be
almost exactly like installing a normal gem for use in a Rails app.

Explicit Migrations ==

Migrations, I think, need to go the other way.  Rather than being
hidden away they should be in plain view.  I think there should be a
generator that create the migration files and puts them in a normal
place, like /db/migrate/9318938_radiant_xyz_add_my_secret_table.

Migrations, I find, are the area most in need of debugging when issues
arise with extensions.  If we're moving towards the idea of Rails 3
embeddable apps, I would want to have all my migrations in one place,
clearly organized, where I can understand what's going on.

Interactive Install Manager =

Here's the install process I'd like to see:

 gem install radiant-xyz-extension
 rake radiant:setup_extensions

Welcome to the RadiantCMS Extension Management System.
The following extensions are available in the system:

1. XYZ [inactive]
2. YAJ [inactive]
3. LDU [inactive]
4 OLD [active]

Which extension would you like to activate / deactivate?  (q to quit)

 2

To activate extension YAJ I need to require the gem in your
/config/environment.rb, is that ok? (Y or N)

 Y

Gem YAJ is now required.

The extension also needs to make changes to your database with
migrations, would you like to generate those now? (Y or N)

 Y

Generating migrations for extension YAJ...
/db/migrate/91830_radiant_yaj_create_table_for_yaj
/db/migrate/91830_radiant_yaj_modify_pages_for_yaj

Migrations generated. Would you like to RUN the migrations now? (Y or N)

 Y

(blah blah migration output)

Extension YAJ has been setup.

The following extensions are available in the system:

1. XYZ [inactive]
2. YAJ [active]
3. LDU [inactive]
4 OLD [active]

Which extension would you like to activate / deactivate?  (q to quit)


==

That's my brainstorm for this morning.  FYI, in my head I modeled this
install process after the EXCELLENT experience of installing Phusion
Passenger.

- Jeff

---
Jeff Casimir
Jumpstart Lab by Casimir Creative, LLC
http://jumpstartlab.com
@jumpstartlab on twitter
___
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
List Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Radiant: http://radiantcms.org
Extensions: http://ext.radiantcms.org


Re: [Radiant] Three Steps to Ease Extensions

2010-04-24 Thread Haselwanter Edmund
thumbs up to this idea +1

Sent from my iPhone

On 24.04.2010, at 13:38, Jeff Casimir j...@casimircreative.com wrote:

 Morning All,

 I've been thinking about extensions on and off for the past few
 months.  I really think installing extensions is too hard, here are
 three ideas to ease the process.  These assume that the work Jim has
 done to gem-ify extensions is good and that all extensions should be
 distributed as gems.

 Sneaky Asset Management =

 I want to get rid of radiant:extensions:xyz:update and the Rails
 router does most of the hard work.  Let's establish that assets for
 extensions are held in a place like /public/extensions/xyz/assets/.
 We'd need a route and controller that listened for that route, then
 just pull the assets from within the gem (stored in some similarly
 structured folder within the library).

 Of course a few users will want to customize the assets.  So we need a
 radiant:extensions:xyz:unpack_assets (basically the same as the old
 update) that copies the assets to the same place in
 /public/extensions/xyz/assets.  The Rails router will pickup these
 static files with a higher precedence than the asset-finding-in-gems
 route, so there is nothing complicated.

 Why do this?  Reducing the steps and complexity for the installation.
 Drop the gem in, require it, and you might be ready to go.  It'd be
 almost exactly like installing a normal gem for use in a Rails app.

 Explicit Migrations ==

 Migrations, I think, need to go the other way.  Rather than being
 hidden away they should be in plain view.  I think there should be a
 generator that create the migration files and puts them in a normal
 place, like /db/migrate/9318938_radiant_xyz_add_my_secret_table.

 Migrations, I find, are the area most in need of debugging when issues
 arise with extensions.  If we're moving towards the idea of Rails 3
 embeddable apps, I would want to have all my migrations in one place,
 clearly organized, where I can understand what's going on.

 Interactive Install Manager =

 Here's the install process I'd like to see:

 gem install radiant-xyz-extension
 rake radiant:setup_extensions

 Welcome to the RadiantCMS Extension Management System.
 The following extensions are available in the system:

 1. XYZ [inactive]
 2. YAJ [inactive]
 3. LDU [inactive]
 4 OLD [active]

 Which extension would you like to activate / deactivate?  (q to quit)

 2

 To activate extension YAJ I need to require the gem in your
 /config/environment.rb, is that ok? (Y or N)

 Y

 Gem YAJ is now required.

 The extension also needs to make changes to your database with
 migrations, would you like to generate those now? (Y or N)

 Y

 Generating migrations for extension YAJ...
 /db/migrate/91830_radiant_yaj_create_table_for_yaj
 /db/migrate/91830_radiant_yaj_modify_pages_for_yaj

 Migrations generated. Would you like to RUN the migrations now? (Y  
 or N)

 Y

 (blah blah migration output)

 Extension YAJ has been setup.

 The following extensions are available in the system:

 1. XYZ [inactive]
 2. YAJ [active]
 3. LDU [inactive]
 4 OLD [active]

 Which extension would you like to activate / deactivate?  (q to quit)


 ==

 That's my brainstorm for this morning.  FYI, in my head I modeled this
 install process after the EXCELLENT experience of installing Phusion
 Passenger.

 - Jeff

 ---
 Jeff Casimir
 Jumpstart Lab by Casimir Creative, LLC
 http://jumpstartlab.com
 @jumpstartlab on twitter
 ___
 Radiant mailing list
 Post: Radiant@radiantcms.org
 Search: http://radiantcms.org/mailing-list/search/
 List Site: http://lists.radiantcms.org/mailman/listinfo/radiant
 Radiant: http://radiantcms.org
 Extensions: http://ext.radiantcms.org
___
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
List Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Radiant: http://radiantcms.org
Extensions: http://ext.radiantcms.org