info | twitter | github
J-_-L | Writings on Ruby Programming
05.11.12

value_struct: Read-only structs in Ruby

gem · hints · ruby · stdlib · talk

Ruby’s structs are one of my favorite data types in Ruby. They help you to keep some defined structure in the dynamic world of Ruby. Often, it makes sense to use them instead of hashes or arrays. Read-only structs take the idea a level further. […]

30.05.12 03.06.12
1 comment

Things I learned while implementing version 1.0 of pws

After releasing version 0.9 of my cli password manager, I received friendly feedback and suggestions, which encouraged me to further improve it. Here are some of my experiences implementing pws 1.0: […]

19.01.12 24.05.12
5 comments

pws: The ruby-powered command-line password manager

  • stores your passwords in a file on your disk
  • encrypts the file with a master password
  • is designed for every-day-use
  • is written in 234 lines of understandable Ruby code… Read it!
  • is tested with 222 Cucumber steps […]
24.10.11
3 comments

Pass multiple blocks to methods using named procs

codebrawl · gem · gist · hints · ruby · ruby1-9

My codebrawl entry (gist) got the 5th place (out of 20). Want to use it in real life :) […]

15.07.11 16.07.11

Three little tips for slimmer Rails migrations

gem · hints · one-liners · plugin · rails · rails2 · rails3 · ruby

Rails migrations are easy to understand and easy to write. However, you can save some unnecessary key strokes by applying these three tips :) […]

24.02.11 28.03.11

Small Ruby CLI Improvements (Part 3): Hirb vs. Unicode

Hirb: “A mini view framework for console/irb that’s easy to use, even while under its influence. Console goodies include a no-wrap table, auto-pager, tree and menu.” now supports unicode in two ways:

┌───────────────────────────────────────────┬───────────────────────────────────────────────┐ │ Support for unicode full-width characters │ Unicode table characters instead of +/- chars │ └───────────────────────────────────────────┴───────────────────────────────────────────────┘ […]

27.01.11
2 comments

Small Ruby CLI Improvements (Part 2): Wirb!

Many people use irb with wirble. I also did.

I’ve been quite happy with it, but sometimes I noted that some symbols were displayed as : without the symbol name (e.g. in method name arrays) and that the representation of regexes looked quite strange.

This is why I’ve looked at the wirble tokenizer, fixed some bugs, liked it, extended it and created Wirb. These are the improvements: […]

18.12.10
4 comments

ripl: Why should you use an irb alternative?

What does it mean when the guy who blogged about irb’s details and wrote most of the successful irb gems (hirb, bond, boson) decides to implement his own irb alternative? There must be something wrong with irb! […]

24.11.10 03.12.10
12 comments

Use fresh Ruby as your shell!

We love Ruby. And we love the command line. So… the shell needs to be rubyfied ;).

Fresh is a new gem, trying to achieve this.

Updated for fresh version 0.2.0. […]

10.11.10

IRB rockets and colors

Introducing the fancy_irb gem:

  • Use fancy colors! You can colorize the prompts, irb errors, stderr and stdout
  • Output results as Ruby comments
  • Enhance your output value using procs […]
01.11.10 19.01.12
9 comments

Tutorial: Build your own password safe with Ruby!

There are many implementations of password managers/safes out there. But lots of them are black boxes, either because they are not open source, or because they have to much features and it gets complicated to understand the source (which is most likely not written in a happy programming language). You don’t know, what really happens with your passwords. So…

Do it yourself!
Do it with Ruby!
Do it in less than 250 lines ;)
[…]

06.10.10 24.06.11
11 comments

irbtools / Release the power of irb!

Equipped with some tools discussed at the germany.rb 2010 user group meetup, I’ve played around with my ~/.irbrc and put together a little meta gem for some useful irb tools (github) […]

03.10.10 24.01.11
1 comment

Gem: clipboard

gem · ruby

The clipboard gem allows you to access the clipboard on Liunx, MacOS and Windows. […]

03.10.10 04.10.10

Requirements: A Mini RubyGems plugin

The .gemspec file of a gem allows to specify requirements for that gem – but usually you do not get to see them. These five lines patch RubyGems, so that gem displays the requirements of a gem after it has been installed: […]

01.09.10 02.09.10
9 comments

How to properly check for your Ruby interpreter, version and OS

gem · hints · ruby · tutorial · zucker

Zucker 4 adds accessors to some environment information:

  • OS: returns the current operating system
  • RubyEngine: returns the current Ruby implementation
  • RubyVersion: returns the current Ruby version

And here is how it works. […]

14.08.10 01.09.10

New features of Ruby Zucker version 2 and 3

gem · irb · ruby · ruby1-8 · ruby1-9 · zucker

The Zucker gem has gotten some new features. Installation is as easy as
 gem install zucker
and
 require 'zucker/all' […]

05.08.10 20.08.10
2 comments

Introducing Ruby Zucker - a new syntactical sugar gem

Zucker is a collection of lightweight scripts (cubes) that make Ruby even more beautiful: rubyzucker.info […]

08.07.10

The has_many_booleans Rails plugin

has_many_booleans is an ActiveRecord plugin which creates virtual boolean attributes for a model. When the object gets saved, the plugin transforms all attributes into a single integer, using a bitset. So you can easily add new attributes without changing the database structure. […]

09.09.09 21.06.10

Troubleshooting an aegis-permission problem

gem · hints · rails · ruby

In my current Rails project, I use the aegis gem for rights management. And I almost got mad, wondering, why it wouldn’t work.. […]