fr.ench.info

Articles on “ruby”

Image Gallery in Nanoc

Posted on ,

My image gallery for screenies is a custom data source for Nanoc which generates items for each JSON file located in the gallery directory. This makes it easy for me to grab the images rather than creating an item for each image by hand. I created a ruby script that grabs all images from my Dropbox account since it is where all my desktop screenshots are stored. The script then generates a JSON file with each image in an entry { 'image': '...', 'thumbnail': '...' }. This is my first time messing around with the Dropbox API too. The API is well documented so I just had to follow the tutoria...

Migrating to Jekyll Part 1

Posted on ,

Recently, I read about a few Drupal blogs migrating over to Jekyll — acko.net and Development Seed. The concept seems nice as you will be writing the content in files instead of a database so I thought I would give it a try. With this, I am able to write blog posts using Vim. Also, on my current blog, I am using Markdown as my input filter for writing blog posts. Installation & Configuration Installing Jekyll was easy as I had only to follow these instructions. Did the following steps to install it: $ sudo apt-get install rubygems $ sudo gem install jekyll $ sudo apt-get install pytho...

Migrating to Nanoc

Posted on ,

Recently, I've migrated my blog to Nanoc. I think there's too much hacking involved if you want to extend Jekyll. Or perhaps I didn't just read enough documentation about Jekyll. But anyway, I've already made the switch. What's done is done. The first thing I did was to convert my markdown files. This wasn't really a problem since both Jekyll and Nanoc almost have the same format for the markdown files. Only difference I think would be the kind and created_at attributes so to be able to use the Blogging helper for Nanoc. Since I am trying to learn Ruby, I decided to create a script to mak...

Migrating to Jekyll Part 2

Posted on ,

After setting up the basic install of my Jekyll site, I then migrated the posts of my current Drupal site over to Jekyll. Migrating Drupal Posts to Jekyll Migration was also easy as I only needed to follow these steps. I first installed the extensions sequel and mysqlplus. $ sudo gem install sequel mysqlplus After this, I downloaded a backup copy of the database of my current blog using Backup and Migrate and imported it to a newly created database. As far as I know, you would only actually need the tables node and node_revisions. My Drupal site has a prefix drpl_ for its tables so I nee...