Archive for the ‘Dancer’ Category

Dancer::Plugin::Auth::Basic

Friday, October 7th, 2011

Yesterday, I released a YADP (Yet Another Dancer Plugin). It’s called Dancer::Plugin::Auth::Basic, and it adds support for basic HTTP authentication in Dancer apps. It’s a side effect of my work on a project that needed a simple access restriction mechanism — I thought it would be nice to have a HTTP authentication solution for Dancer which is easy to use and universal (meaning it does not rely on Plack or .htaccess/htpasswd files).

Here’s a simple usage example — a fragment of Dancer configuration which restricts access to a specific path (/restricted):

plugins:
  "Auth::Basic":
    paths:
      "/restricted":
        realm: Restricted zone
        user: fmulder
        password: trustno1

And that’s it. If you’d like to try the plugin in your app, it’s up on CPAN and on Github.

This plugin also happens to be the first CPAN module that I’ve built using Module::Build, instead of the rusty ExtUtils::MakeMaker. I’ve had no problems switching, the only thing that was a bit troublesome was creating a README.pod file (which is a good thing to have if you’re publishing your module on Github), but I managed to do that eventually.

Dancer::Plugin::Preprocess::Sass

Wednesday, September 21st, 2011

Are you tired of writing boring old CSS code in your Dancer application?

Do you admire the simplicity and power of Sass?

Would you like to integrate Sass into your web application using Plack::Middleware::File::Sass, but you have difficulty getting it to work, or your application is not running on Plack?

We’re introducing the great Dancer::Plugin::Preprocess::Sass, which allows you to use Sass files in your Dancer application, and have them converted into CSS ON-THE-FLY! What’s more, the generated CSS files can then be AUTOMATICALLY saved and served as static files, saving you CPU cycles AND money!

As seen on TV

CALL the number on your screen and ORDER YOURS TODAY FOR JUST $29.99!

CALL NOW and you’ll get 10 EXAMPLE SASS FILES that you can use in your application ABSOLUTELY FREE!

Ok, but seriously, the plugin is available on CPAN and on GitHub. And it’s not $29.99, it’s free.

Dancer::Plugin::DebugToolbar 0.016

Wednesday, September 14th, 2011

I have just released a new version of Dancer::Plugin::DebugToolbar, the debugging toolbar for Dancer web applications. This version introduces a new screen which displays the templates rendered by the application and lets you inspect the data passed to them. Here’s an example of this screen:

Templates screen

This release also introduces a few performance improvements and fixes a couple minor bugs.

As usual, you can get the plugin on CPAN and on GitHub.

Dancer::Plugin::DirectoryView

Sunday, September 4th, 2011

Developing Perl modules seems to become my habitual weekend activity. Here’s a new plugin for the Dancer web framework — Dancer::Plugin::DirectoryView.

The plugin generates directory indexes for selected directories on the server, allowing the users to browse through those directories and download files. It basically does the same that Apache’s mod_autoindex and Plack::App::Directory do, but it has the advantage of being integrated into the Dancer application and not depending upon how the application is deployed.

An obligatory screenshot:

Directory index generated by Dancer::Plugin::DirectoryView

I’ve put the plugin up on GitHub, and will relase it on CPAN shortly (after I polish the code a little bit).

Dancer::Plugin::DebugToolbar 0.011

Sunday, August 7th, 2011

This weekend we’re having pretty nice weather here in Warsaw, so what better way to spend your day other than to stay indoors and hack Perl? I’m here with a new version of the debugging toolbar plugin for the Dancer web framework.

A new feature introduced in this version is basic database tracking functionality. The information window can now show the DBI trace data, and display (some of) the SQL queries sent to the database. Here’s a screenshot of that:

Database information screen

I’ve also made significant changes in the basic structure of the code, and rewrote some of it from scratch. In the first release, the HTML code used to inspect the data structures was generated by Perl, which wasn’t especially elegant. Now, pretty much all presentation-related stuff happens in JavaScript, and the Perl code is only responsible for providing the data structures to display.

In the future, this might even allow me to quickly adapt the plugin to other frameworks/languages.

The new version is available on CPAN and GitHub. And, since today happens to be Dancer’s second birthday, let this release be my way of celebrating it. Happy birthday, Dancer!

Dancer::Plugin::DebugToolbar

Friday, July 29th, 2011

As you might remember, I recently got interested in Dancer, the fabulous micro web framework for Perl. That interest led me to rewrite my website to Dancer, but that wasn’t enough — I found the framework really fun and wanted to play with it a bit more. So I started a small project to develop a plugin that adds a debugging toolbar to Dancer web applications.

I have now made the plugin available on GitHub, and I will be releasing it on CPAN shortly. It’s still in an early stage of development — at this point, it only allows you to inspect your application’s routes and basic data structures. I hope to eventually turn it into a decent development tool, which would also be easy to use to help new Dancer users get familiar with the framework.

Here’s a screenshot of the toolbar displayed at the top of the browser viewport:

Dancer debugging toolbar

And this is how the data inspection window looks:

Debugging toolbar data window

As usual, I’m looking forward to feedback, especially from you fellow dancers out there.

$self =~ s/Symfony/Dancer/

Thursday, June 30th, 2011

Notice anything different about my site? No? Good, this means that the transition went smooth. I rewrote the engine that my website runs on from Symfony to Perl Dancer.

You might remember that I introduced the Symfony-based engine less than six months ago, so why the switch? Well, back when I launched it, I kind of felt that it might not last very long — mostly because Symfony was just a better-than-nothing choice. For years, my website was running on an ugly framework-wannabe solution that I developed myself. By the way, if you ever get the same idea, consider this advice:

(source: gojko.net)

By the time I finally decided to rebuild it, Symfony just happened to be around — I had a Symfony project coming up and thought it might be good to first get familiar with the framework on a smaller task. I started working on the rewrite, and I quickly got the feeling that Symfony is just too big for the purpose of running a small website like this — I only needed a tiny subset of its numerous features. All in all, it felt way too heavy. But, I really wanted to replace the old engine, so I still went with it.

As for Dancer, I first heard of it about a year ago and I knew I was going to give it a try at some point. Why? Two reasons:

  1. It’s a micro framework, which is much better suited for simple sites than a full-blown MVC framework
  2. It’s Perl, dammit!

So, two weekends of enjoyable hacking, and here it is — my website running on Perl. More precisely, it’s a Perl/PHP hybrid, as the blog is still powered by WordPress. But, the blog engine is feeding its output to the Dancer application, so everything you see is processed by Perl.

  • Archives

  • Categories

  • Meta

  • Latest Tweets


    Warning: Illegal string offset 'last_access' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 334

    Warning: Illegal string offset 'time_limit' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 334

    Warning: Illegal string offset 'last_access' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 336

    Warning: Illegal string offset 'twitter_api' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 234

    Warning: Illegal string offset 'user_token' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 262

    Warning: Illegal string offset 'user_secret' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 263

    Warning: Illegal string offset 'consumer_key' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 264

    Warning: Illegal string offset 'consumer_secret' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 265

    Warning: Illegal string offset 'twitter_username' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 270

    Warning: Illegal string offset 'show_retweets' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 272

    Warning: Illegal string offset 'exclude_replies' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 275

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 282

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 350

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 351
    Twitter outputted an error:
    .
    Warning: Illegal string offset 'time_format' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 484
  • Follow odyniec on Twitter