Skip to content

Tag: Ruby 1.9.x

Stupid Author Geek Tricks

Post Views: 610 I am super fussy about time in my writing. I hate a sense that time isn’t a factor in the stories I write. With time, comes cycles; tides, moons, who is on shift, when’s the poker-gang meeting and such. With “Afterliving for Guys”, time is especially important; most of the main characters are vampires. They’re dead in short order if their watch is wrong. To help with keeping track of the movement of time, I actually wrote a simple Ruby-script program to let me keep moving the clock and calendar forward. It’s pretty straightforward; you give it a start point, and then a series of time increments to move the clock forward, and if it should introduce some “fuzz” so that times are much less…

Leave a Comment

Quick Hacks: Asterisk account codes, Ruby programming, and the Freshbooks API

Post Views: 698 I put together a quick hack last night that will help with managing truant accounts on JKL5’s “Cloudphones” SMB VoIP PBX. Ostensibly, it’s a pre-paid service for small to medium businesses, as well as a couple of residential customers. However, we have a couple of problem accounts that require checking on the accounts payable report followed by a few nagging emails to get to pay their bills at the 45 day mark. In each trunk and phone configuration, I have the customer’s company name set as the “Account Code” for any call they take or make. In an IAX2 trunk, it looks like this: [example_incoming_trunk] type=user host=iax04.unlimitel.ca username=1112223333 context=call_router requirecalltoken=yes accountcode=jkl5group [example_outgoing_trunk] type=peer host=edge01.my_itsp.com secret=some9797numbers username=1112223333 accountcode=jkl5group With something like a SIP phone, it’s just as easy:…

Leave a Comment

Testing your Ruby/Rails 3.x Model with Cucumber

Post Views: 813 So I’m working on a Ruby/Rails development project for a customer, and using TDD/BDD from word “Go”.  The weapon of choice here is Cucumber.  I know some of the more serious code-cutters prefer RSPEC, but I just like the “feel” of Cucumber. Naturally, part of the job includes ensuring that the various Models in the project pass very basic tests, such as if they are defined properly.  In RSPEC, you can use a solid set of tools to do that, but Cucumber is much more “View” centric in the MVC than it is good for peeking at the Models. So, for amusement, I decided I’d work out a simple Feature and Step set that can be used to verify a project Model. The Cucumber Feature…

Leave a Comment

Application Programming With Ruby-Rails 3.x – SSL Securing WEBrick

Post Views: 231 I know I normally talk about my writing, or even my personal philosophy, on this site, but I do have a life as the owner of an IT consulting company.  Part that involves doing custom application programming for our clients. I’m currently working on a call center applet for a customer.  Because of the nature of the work, I opted to ensure that the connection was SSL secured from WEBrick out, avoiding possible issues with connection security before the proxy. I found an excellent blog post on the task that reduced it to a cut-and-paste solution.  I figured I’d share the link for anyone else that might need the information in the future: Chris Rohr: Configuring Webrick To Use SSL Thanks, Chris!

Leave a Comment