Articles tagged 'merb'

Setup Feather to run as a slice within a Merb app Jan 30

In response to a few queries and comments on my post about the ejdraper.com blog running as a Feather slice underneath a parent Merb application, I decided to put together a sample app demonstrating just how you’d configure such a beast.

Introducing Feather Sample Slice Host… this is an up-to-date Merb application (Merb 1.0.8.1) that hosts Feather as a slice. It comes with a few common plugins installed, and an ultra basic theme override to demonstrate the themes working. It shows how you can easily integrate Feather into a Merb application, and you should be able to use it as a base for any application that you’d like to build with Feather integrated. You need to install Feather as a gem first - for now, simply “git clone” the Feather code, and then run “sudo rake install” in the root of the Feather codebase. A configured development sqlite3 database is included with the sample app so that you should then just be able to “git clone” the host app code and fire it up!

For those that are interested, integrating Feather as a slice boils down to the following steps:

  • if you haven’t already, grab Feather as a gem (same as above, clone the code, and then “sudo rake install” in the project root; this will change when the first gem version of Feather, 0.5, is officially released shortly)
  • create a brand new Merb app
  • add Feather, and a few of it’s dependencies to “config/dependencies.rb”
  • add the appropriate Feather slice commands to the host apps router, to mount Feather at /blog (or wherever you would like)
  • run “rake slices:feather:install” and “rake slices:merb-auth-slice-password:install” from the root of the host app to copy static resources over
  • setup the database, using the “Feather::Database.initial_setup” method from the Merb console (“merb -i”)
  • implement a login form under the “app/views/exceptions/unauthenticated.html.erb” view
  • install any plugins required
  • setup any themes needed (if using the themes plugin)
  • implement the rest of the functionality you want in your host application!

For any of the steps above that aren’t all too clear, you should be able to refer to the sample application now to see exactly what is required. It isn’t currently as straightforward as I’d like, and as a part of the aforementioned 0.5 gem release, I’d like to provide an easy command to add Feather to a Merb application, or create a new Merb host app with Feather already installed as a slice. For now though, the above checklist alongside the sample app should have most of you up and running in no time!

As always, any questions, please feel free to contact me or leave a comment.

Comments

Reboot Jan 10

I’ve designed and built a brand new personal site here at ejdraper.com, and have moved over this blog - all url’s from crazycool.co.uk now point to ejdraper.com/blog, and the blog integrates with the rest of my personal site, which also includes a bit about me, my portfolio of work, my code and a lifestream on the homepage aggregating content from this blog, GitHub, Flickr, Delicious and Twitter.

As part of the migration I’ve created a new feed with FeedBurner, at http://feeds.feedburner.com/ejdraper. I’ve left the old crazycool feed running too though, and pointed it at the new site, so those of you subscribed should continue to receive the latest articles, but if you get chance it may be worth switching your subscriptions to the new feed to ensure that it always works in future.

For those interested, this new site runs on Merb, and is hosted using Apache and Passenger. The blog portion still runs on Feather, however it runs as a slice inside the main ejdraper.com app. I’ve spent a fair bit of time recently on bringing the Feather codebase up to speed to make it work with the latest Merb/DM, to finish up slices support, fix some of the bigger bugs, and to make it more stable and reliable. Soon enough I’ll be wrapping up the latest code into a 0.5 gem release, so watch this space!

Any comments on the new site and design will be welcome, and I’m going to be more blogging a lot more regularly from here on out!

Comments

Call To Arms Jun 25

So a quick Feather update: we’re now running against the latest stable versions of Merb (0.9.3) and DataMapper (0.9.1), which should make getting Feather up and running even easier. We’re also currently starting work on running against edge Merb, to try and implement merb-slices, so that Feather can be run as a slice within other apps, and so that Feather plugins themselves are slices in their own right. If you’d like to contribute to that effort, there is a “slices” branch for both core, and plugins. Just fork, hack away, and send me a pull request with your changes!

In other news, the official Merb blog is now running the best Merb blog in the world – that’s right, Feather! It’s great to see the blog running Feather, and we hope we can continue to improve it to make it even more useful for the Merb guys to be able to get out important Merb information and articles!

Also, I’ve been through the tickets on the Feather Lighthouse, and setup two milestones – 0.5, and 1.0. The idea is that 0.5 will aim for stability, and getting the work on slices up and running. Milestone 1.0 will be for trying to improve the distribution, setup and configuration of Feather to make it more user friendly.

There are currently a ton of feature requests and small bug fixes outstanding, that I’ve assigned to me on the LH tracker. I’m going to start to try to get through them, but if anyone out there fancies taking any of them on (a lot of them are great little ways to get into Feather development!), then just let me know, and I can re-assign the ticket to you. There’s no deadline on the 0.5 milestone just yet, but the more contributions we can get to knock off some of the outstanding items, the quicker we’ll hit the milestone! Consider this a call to arms :-)

Lastly, big shout out to some of the contributions coming in – after a mammoth merge session the other night, I rolled in great contributions from aflatter, sudothinker, jf, piclez and fujin. Apologies if I missed anyone else – ping me if I did, and I’ll give you the appropriate kudos.

Comments

Feather + DataMapper 0.9 Jun 11

Last night I finished merging some of the work Alexander Flatter did on converting Feather core code for use with DataMapper 0.9, along with the work I did that was required on the plugins code to be compatible with DM 0.9, and some other fixes that popped up during initial testing. It’s a lot of changes, and so there are bound to be certain bits that aren’t quite right. Also, after some testing today, it appears that the various combinations of Merb and DataMapper that are getting used are causing some strange errors for some people. We’ve taken the decision to try and get Feather running cleanly on the latest versions of Merb and DM, so that if people are experiencing problems, the nice simple solution should be installing the latest versions of both dependencies.

We’ve committed a workaround within Feather for the merb-cache issue that was holding us back from running on the latest Merb (0.9.3), and I’ve updated the Getting Started guide over on GitHub to provide more details on how to setup the core dependencies (Merb and DataMapper) to ensure you are using the latest versions (as well as detailing another potential conflict with the latest version of ParseTree).

As is to be expected with a project as young as Feather, it’s in a fair state of flux at the minute, but please bear with us as we try to improve and upgrade the application to use the latest versions of its core dependencies; we hope that by doing this it will make it easier to setup and install Feather in the long run, and it’ll also eventually make Feather more stable if we are using the latest stable versions of both Merb and DM.

Any questions, comments, issues or bugs can be raised with us in IRC (irc.freenode.net, #feather), or on our new Feather mailing list (http://groups.google.com/group/feather-dev). At the minute, we’d like as many people as possible to try to use Feather against Merb 0.9.3 and DM 0.9, so we can resolve any outstanding issues promptly, so if you encounter any problems, please let us know!

Comments

Feather by mail Jun 7

As an alternative to IRC, we’ve now got a mailing list setup for Feather, where you can discuss ideas, feature requests and issues. Also, we’ll use it for announcements surrounding Feather releases. The mailing list is on Google Groups here, and you can browse the messages and sign up there. The more the merrier, so sign up, and drop the list a mail if you have something to say about Feather!

Comments

Feathered May 9

So it’s been two weeks since we open-sourced Feather. The feedback so far has been great, really pleasing, we’ve had some great coverage, and some great contributions. I figured I’d do an update on where we’re at, and highlight some of the cool things from the last two weeks.

So first of all, the coverage the project has gotten is great. We made it on to the brilliant “This Week In Ruby” on Antonio Cangiano’s blog, for April 28th. We also made it on to the Rails Envy podcast, another great source of the latest Ruby and Rails information, on April 30th. On top of that, after submitting the announcement post link to RubyFlow, it then made it on to Ruby Inside, in a round-up post of the best of RubyFlow for the last couple of weeks. RubyFlow seems to be a great site for the latest and greatest news in the world of Ruby, so it was brilliant to be picked in a round-up post from two weeks worth of links!

We also received numerous links from other bloggers, and there seems to be quite a buzz about the project so far, which is great!

As for the sourcecode itself, thanks to GitHub we are able to keep a great handle on the interest level, and we’ve seen that skyrocket! At the minute, we now have 95 watchers on the main codebase, and 13 people have forked the code! For the plugins codebase, we have 6 forks, with 40 watchers! And each day we have more and more people watch or fork the code.

We’ve also made some great progress with features and bug fixes. In the last couple of weeks since opening up the codebase, we’ve had:

  • XHTML/styling fixes from Michael Bleigh
  • custom permalink formats from Jake Good
  • Mike added pagination for the admin article index, and also for the admin comment index
  • Atom feed support for articles/comments from Markus Prinz
  • a Mephisto importer plugin from Jake Good
  • a Typo importer plugin from Marc Seeger
  • a small markup fix from Bradly Feeley
  • Mike also nailed a few other fixes

I think that’s most of the major contributions, apologies if I’ve missed anyone (let me know in the comments and I’ll update the list!). Considering that it’s only been open source for two weeks though, I think that’s great! We also have some other contributions in the pipeline, and so things seem to be progressing nicely. A list of contributors is also available on the GitHub wiki (thanks to Mike) here. If you’d like to see your name there, you know what to do!

To try and organize fixes, issues and feature requests, we’ve setup a Lighthouse instance for Feather. It’s available at http://feather.lighthouseapp.com. You’ll be able to add bugs or feature requests, and if you’d like to contribute by tackling any of the issues or feature requests there, let us know and we’ll give you access so that you can be assigned them so everyone knows your working on them. We’ve also setup an IRC channel to hang out and discuss Feather on irc.freenode.net (#feather). Me and Mike are in there quite a lot, so come on in to talk about Feather, whether it’s talking about how to set it up, how to extend it, or specific issues you might be having. The more the merrier!

Something else to mention is those that have switched their blogs to Feather. Obviously me and Mike are running Feather, and Jake finally got his blog over to Feather once he finished his Mephisto importer. And more recently, in the last few days Marc got his blog up and running with Feather too. They all look great, and if anyone else is using Feather, it’d be great to hear about it, so let me know!

Besides logging a few bugs, and hanging out in IRC to help people with some setup issues, I was also able to knock together a basic getting started guide this week. It’s available on the GitHub wiki for the project, here. One of our aims is to make setup easier over the next few weeks, but in the meantime at least there is a set of instructions to hopefully make it easier for people to get up and running.

Also over the next few weeks, we’ll be aiming to get an official Feather site up and running, which will include news, updates, an official plugin repository so that we can have one-click installs for plugins, and some more guides to using Feather, and developing plugins for it.

With more plugins on the way, a few bugs to fix, and some new features to put together, I’m sure the next two weeks and beyond will be just as productive for Feather. If you’re interested in getting involved, drop by #feather and introduce yourself, you’ll be more than welcome!

Comments

Defer To May 3

So one of the really great features within the Merb router is “defer_to”. This enables you to defer certain routing decisions to runtime, allowing you to evaluate and decide what needs to be handled where based on runtime factors. This is used in a couple of places within Feather and its plugins, specifically the main use is the handling of the article permalinks. Each article has a permalink stored against it, and while there is a default pattern for new articles, we allow any url as a permalink for an article to ensure that importing/backwards compatibility is straightforward. As this may not follow any particular pattern, we need to be able to evaluate this at runtime.

Originally, Feather handled this with a custom Rack handler, that ran before the main Merb application handler. It checked the request uri, and if it matched an article permalink, it dispatched the call to the articles controller to show the appropriate article. If it didn’t match, it simply went on and processed using the Merb app handler as normal. This worked fine, but looked like in the long run it might be difficult to maintain – it would certainly be nice to have a way to handle it all from within Merb routing.

Lo and behold, there is! Enter, defer_to. Let’s take a look at the article matching code from Feather first of all to see how it works:


r.match("").defer_to do |request, path_match|
  unless (article = Article.find_by_permalink(request.uri.to_s.chomp("/"))).nil?
    {:controller => "articles", :action => "show", :id => article.id}
  end
end

So what is this doing? Well it’s basically starting by matching all routes. It then calls “defer_to”, specifying a block to be used to evaluate a request at runtime. This block is passed the incoming request, which is all we need for our purpose here (the second argument is a set of parameters containing information about the route matched so far – in our case we are matching everything to try and then match the permalink at runtime, so we don’t use this argument).

We then basically use the incoming request uri to evaluate whether it matches an article permalink, and if it does we return the routing information for that particular article. Otherwise, the block will just return nothing, and so the Merb router will then continue on its way attempting to find a route that matches for the request. This means that the moment a new article is posted, or perhaps old articles are imported with specific permalinks, they are available and will be handled, all using Merb routing, thanks to “defer_to”. It’s a tidy, lightweight, great way of handling a complex routing problem.

Comments

Lights Out Apr 28

The response to us open-sourcing Feather has been great so far, with some contributions, some questions, some comments, all good stuff. And now, thanks to the guys over at ActiveReload, we’ve got a public facing instance of Lighthouse to be able to track bugs, issues and feature requests, in both the core code, and the plugins! So if you discover an issue, or want to request a feature, then log it on there at http://feather.lighthouseapp.com and we’ll get to it! If you’d like to tackle the fixing of a bug, or the implementation of a feature, get in contact and we’ll set it up so that we can assign that particular request to you so everyone knows you’re on it!

This should make managing and co-ordinating development a lot easier! Thanks again to the guys at ActiveReload for a great product, and for hooking us up with a free account for our open source project! And thanks to everyone so far who has contributed with code, comments and queries, keep ‘em coming!

Comments

Announcing: Feather Apr 26

So after a few weeks of teaser posts, we’ve finally opened up the code on the software that powers this very blog, Feather. It’s been a collaborative effort so far between me and my boy Mike, but now it’s time to open source it, and hopefully people besides us will not only find a use for it, but will also find new ways to extend and improve it.

So what’s in the current codebase? As alluded to before, the core itself is lightweight. Basic article posting, and user management is all you’re really getting. The beauty is in the wide variety of plugins that are (and will be) available to extend the software further. Within a separate plugins repository, there are currently twelve plugins, that extend Feather to provide comments for articles, feeds, formatters for article content (Textile and Markdown), basic RSS importing for articles and comments, integration with ping services, the ability to setup hard-coded redirects on your site, sidebar and snippet content, overridden css styles, tagging, Twitter integration (to display your tweets in line with blog posts), and file uploads. The code in core and for these plugins probably isn’t perfect, but it’s good enough to power a few blogs already - and improvement is where you come in.

If you’ve got an idea for a new plugin, improvements to existing functionality, or you’ve found a bug, then by all means fork the project on GitHub, implement your code, and send us a pull request so we can merge the changes into the main trunk. Alternatively, send us your patch via e-mail, and we’ll look to include it within the application. If you submit two patches to either feather, or feather-plugins, then you’ll be given commit access to the repository in question, and will effectively become part of the core team. So what needs doing right away?

The biggest deficiency at the minute are specs - there are some specs in the core code, but it doesn’t cover a lot of the application, and ideally we’d be aiming for 100% coverage of the core controllers and models. We then need to devise a decent way of similarly shipping specs with plugins. When we start updating and improving plugins, we’ll need a way of handling data migrations smoothly and efficiently. On top of this, there are still outstanding useful plugins that need to be written, such as content search, and trackbacks, as well as integration with services other than Twitter. Lastly, there are bound to be bugs, so roll up your sleeves and fix them, it’ll be much appreciated!

We’ll be rolling out a Feather website soon, along with an official plugin directory to make installing plugins easier - for now, there’s a basic getting started page on the wiki over at GitHub, and there will be more information over the coming days on both mine and Mike’s blog. Any questions in the meantime, then let me know.

Other than that, what are you waiting for? Get your Feather on!

Comments

gem install merb-manage Apr 20

So I’ve put merb-manage up on RubyForge, and uploaded the latest gem release, 0.4. This now means that you can do “gem install merb-manage” and have it installed to your machine, ready for use! For more information on how to use it and setup your apps, see the README over in the source at GitHub.

Any questions or comments, let me know!

Comments

Manage Your Merb Apr 16

So in getting this blog up and running on a server of mine, I needed a simple way to control and configure the Merb application, preferably with the ability to quickly alter the amount of servers, the logging, or indeed the adapter being used, amongst other things. I also wanted it so that much like Nginx, the Merb application itself would automatically restart if the server got bounced for whatever reason.

Introducing… merb-manage! Hosted over at GitHub, and open source, this is a simple tool that allows you to quickly and easily manage your Merb configurations on a server, and start/stop/restart your Merb applications as per your configuration. It also includes a bash script that can be installed to act as a startup script (such as in /etc/init.d) so that when your server restarts, your Merb applications spring back to life too! You can store the configuration within your application, and simply symlink it to a central configuration directory for merb-manage to go to work on (defaults to /etc/merb-manage), and you can change the adapter, amount of servers, port, user, group, and logging level straight from the configuration! It’ll handle multiple applications and their configurations so you have a one-stop shop for configuring and managing your Merb instances!

It’s fairly simple at the minute and I’m sure there’s some more useful features to be added, so if you have any ideas then simply fork it, add them in, and send me a pull request! Likewise any bugs, issues, either let me know, or even better, fix them and I’ll add them back in to the main tree!

Comments

Drop It Like It's Hot Apr 13

So anyone that isn’t reading this in a feed reader will see that my blog has had a serious overhaul - and I’m now running on Feather. Me and Mike spent quite a bit of time last week or so expanding the Feather feature set, and it now more than copes with my existing blog. I was able to import all my old posts, customize the default theme to something a little bit different, and add in a few custom snippets (Analytics, FeedFlare etc). I was also able to add redirects for old links to ensure that (hopefully) there isn’t too much broken by the move. All old posts will have the same permalink too, handled as part of the import process.

Currently I’m running without caching, but I see my partner in crime Mike has gotten caching up and running on Feather, so I’ll get that setup and running shortly too, to improve the performance of the blog still further.

As far as I can see the blog should be running ok, but any issues - let me know with a comment, or an e-mail, and I’ll get right on it!

Comments

Page 1 of 2 | Next page