Bustikated

Equal parts geeknobabble & jackassery

Phoenix Ruby Users Group

Posted by BM5k on August 19, 2008 at 07:47 PM

List of crap we’d like to talk about

  • Camping / Merb / Rack
  • PDF / Image Libs
  • Config Mgmt / Cruise Control
  • Passenger
  • REST
  • Attachment Plugins
  • Mock / Stubs
  • Testing frameworks
  • Messaging Queues
  • Search Index (Solr/Sphinx)
  • Fixtures
  • Javascript
  • GIT / SVN
  • Deployment / Capistrano / Vlad
  • Thin Controllers / Fat Models / No Logic in Views
  • Work process
  • E-Commerce / Activemerchant
  • BJ / Background DRB
  • Charts & Graphs

Rails + vCard

Posted by BM5k on June 19, 2008 at 04:52 AM

I was looking at microformats for use in a current project, and decided that I’d like a way to export contact data as a vCard. A quick google search revealed this, which just happens to be by Derek Neighbors. It uses the VPIM library, which I found here.

Being the “There’s no way I’ll remember any of this later” person that I am, I tossed this into a pastie, and am blogging about it more for my benefit than yours.

WeeMap 0.0.4

Posted by BM5k on May 14, 2008 at 09:30 AM

I’ve updated the live WeeMap with the numerous minor changes in the last few days.

  • Corrected email subjects
  • User info bar (with username and logout link)
  • Login redirects to Maps instead of Home
  • Various tweaks

The BIGGEST change in this release is the addition of tag based filtering/searching.

And with that, I’m off to bed. Be sure to check back here or the lighthouse for support/feedback.

Oh, and I’ve created a topic on the WeeWar Tangler Group for the app as well. Trying to keep everyone up to date.

WeeMap is Live!

Posted by BM5k on May 09, 2008 at 05:49 AM

My simple little WeeWar maps app is live!

Check it out: WeeMap

DNS might still be updating, so check back if it’s down for you.

Warehouse + Leopard Server

Posted by BM5k on April 13, 2008 at 04:03 AM

I’ve managed to get SVN & Warehouse somewhat up and running on my server, and now that he’s online, I’m trying to get everything 100%.

Right now, I’m testing the following post-commit hook in one of my repositories to see if it works. The directory names have been changed to match my server, but otherwise this is just the basic suggestion from the Warehouse FAQ.

#!/bin/sh
cd /Library/WebServer/Rails/warehouse-1.1.6
/usr/bin/rake warehouse:post_commit \
RAILS_ENV=production \
REPO_PATH=$1 \
REVISION=$2

CSS Media Fu

Posted by BM5k on March 21, 2008 at 10:51 PM

Inspired by a similar php solution found here, I decided to try and do this in Rails.

I quickly realized that something like this could be implemented as a plugin, in spite of it’s simplicity.

Google led me to this howto on creating generators, and following along with this and another of Urubatan’s guides, I was able to get a working plugin created.

Installation

As of right now, I do not have a public subversion repository. This should change within a week or two. The only way to install the plugin is to manually unzip it into your application’s vendor/plugin directory.

Get the zip here

This is my first plug-in, and was written more as a chance for me to explore plugin creation than out of necessity.

If you’re interested in creating your own plugin, you can read my notes by clicking ‘more’.

more

Putting your GEMs on Ice

Posted by BM5k on March 19, 2008 at 09:53 AM

Mostly for my benefit later, but maybe helpful to you other rails newbs: I always seem to not be able to find this quickly when I want to freeze mah gems. It isn’t that hard, I’m just that absent minded.

To lock in a specific version:
rake rails:freeze:edge TAG=rel_2-0-2
Ensure all your config files match:
rake rails:update:configs
To double check which version is actually being run by your app:
script/about

Acts As Taggable on Steroids

Posted by BM5k on March 15, 2008 at 03:02 AM

Most of this was stolen directly from the Readme

Since I stole everything else, I figured I’d duplicate the donation link as well.

If you find this plugin useful, please consider a donation to the author to show your support!

Author’s Email: jonathan.viney@gmail.com

Installation

ruby script/plugin install
http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids

ruby script/generate acts_as_taggable_migration
rake db:migrate

more

Comments: 0 (view/add your own) Tags: HOWTO, RoR, Ruby, Site

WeeWar API HQ

Posted by BM5k on February 24, 2008 at 10:36 PM

If you haven’t already, see parts 1, 2 and 3

This script checks your HQ and prints out a list of games. You can see the returned xml data here.

Example Output

Active Games
One if by land
Someone else’s turn for the last 2 hours

It’s been brought
Someone else’s turn for the last 8 hours 12 Minutes

WAR 2
Someone else’s turn for the last 10 Minutes

Go Baby Go
Someone else’s turn for the last 1 hours 35 Minutes

Lobby
Moo, This Means War

more

Comments: 0 (view/add your own) Tags: API, Ruby, WeeWar

WeeWar API Games

Posted by BM5k on February 24, 2008 at 09:41 PM

If you haven’t already, see parts 1 and 2

This script will request information about a game, and output it nicely. You can see the returned xml data here.

Example Output

Game Info
map => lakes1187102532212
type => Pro
pace => 1 day
cbp => 150
round => 14
credits => 100
name => One if by land
started => Mon Feb 25 02:54:46 UTC 2008

Players
BM5k, bowerman4875, sbowerman’s turn

more

Comments: 0 (view/add your own) Tags: API, Ruby, WeeWar

WeeWar API Players

Posted by BM5k on February 24, 2008 at 07:48 PM

If you haven’t already, see Part 1

I’ve thrown together a script that requests my player info, and outputs it to the screen. You can see the returned xml data here.

Example Output

About Me
name => BM5k
online => true
id => 10908

My Stats
wins => 9
losses => 4
draws => 1
credits => 103350
points => 1523

Friends
sbowerman, bowerman4875, spacecadetjuno

Games
56945, 56698, 56939, 56992, 57266, 57641, 57639

more

Comments: 0 (view/add your own) Tags: API, Ruby, WeeWar

Ruby API Development with WeeWar

Posted by BM5k on February 24, 2008 at 07:32 PM

As a ruby newb, I thought that I’d document my first trek into API development.

Lately, I’ve been quite taken to wasting hours in front of WeeWar, to the extend that it’s interfering with my normal goofing off. Among other things, WeeWar has a relatively simple API. An introduction can be found here.

There are only a few API accessible objects, Players, Games, All Players, and the HQ. Click on the preceding links for sample of the data returned by each.

These URLs are pretty straight forward. The key thing to realize is that while games are selected by numerical id, players are selected by name. (Names are NOT case sensitive, i.e. Bert is the same as BeRT.) Also, accessing your HQ requires both a user name and an API token. You can find your API token on your account page.