Postings by leam hall

Getting basic data from Ruby itself?

I'm building my study tools for the Ruby certification exam. Is there a
way to query Ruby itself for:

Key words (def, begin, end, etc)
What those key words do
The list of built-in modules and classes
The standard library modules

Some things seem to have ri documentation, some I just haven't figured
out how to get yet. I do not want a web page with the data, but a web
tutorial on how to get it would be great.



Unsubscribe: <>

Final iteration lost?

I'm parsing a data file with each_line, each section starts with a line
that ends in ")". Each section has 2-3 subsections, delimited by blank
lines. The original test for a new section was:

if line.end_with?(')')

However, that means the last section is never dealt with, since the
"each_line" ends at EOF.

Simple Sinatra app speed based failure?

I have a simple Sinatra based app:
<a href="" title=""></a>

That calls some defaults if data is not provided:
<a href="" title=""></a>

This morning I noticed that one set of basic tests would randomly (one,
both, neither) fail:
<a href="" title=""></a>

At first I thought my RSpec-fu was weak, but using curl to test gave
interesting results:
<a href="" title=""></a>

In the speed_errors.txt log, the end colu

Trouble-shooting Apache 2.2 Alias

Following the Alias docs (
<a href="" title=""></a>) and it's not
working. Debug is turned on and i know some security stuff has been done to
the config. Since mod_alias is still there, what else could prevent an
Alias from getting a "Forbidden".

If I take an unmodified config file, tack on the alias, it works.


"Circular require considered harmful"

Trying to figure out how to resolve this error:

warning: loading in progress, circular require considered harmful

This is the file it is referencing:

<a href="" title=""></a>

How do I resolve the errors?

An issue with a Technical Meritocracy

As we talk about "Nice" and "Tk" I saw an issue in the traditional
Open Source meritocracy pattern.

We promote, through "cred" (credibility), those who show strong
technical merit. They become "leaders". Yet "leading", and "organizing
a group who can contribute to a project", are very different skills
from "coding ability" and "technical savvy".

I thought through Marvin Gülker's comments about people contributing
to revive Tk. Mixed that with Andy's reply and Nicola's support, and
realized that a team could be formed but the organizer would need to
be able to do Ruby, C, and leadership.

Trying to identify directories

Trying to figure out why this doesn't put just the directory names.
There are directories in options[:source] and if I start an irb
session in that directory, pick a directory name like "docs", and do:'docs')
it returns true.

Besides a brain, a clue.

Key book re-writes?

A few Ruby books are aging; the pickaxe book is one favorite that could use
an update. Is there any push to update Key Ruby books, maybe in time for
Ruby 3?

Or am I just wishing harder than usual?


Class that opens and adds variables to instances of another class?

I think I'm trying to figure out the Decorator pattern. What I want is
to have a <thing> that takes an instance of <something> and changes it.

undefined symbol: mjit_init_p

I pulled Ruby trunk on 3 Jul and am now getting errors similar to the

MJIT warning: failure in loading code from
'/tmp/': /tmp/ undefined
symbol: mjit_init_p

The pull before that was 4 June and I didn't get the errors.

Up for Architectural Review?

Well, okay, feel free to comment on my Ruby. There's room for improvement.

I have been playing at some code for a while and decided to make it
actually "work" today. That means prioritizing a very few processes
and pushing back on scope creep.

Is this a decent start on a Factory?

Trying to learn the Factory pattern. What can be improved on the
"Crew" class as a Factory?


class Crew
def initialize(crew_number)
@crew = []
crew_number.times do
ncp =
career = ["Merchant", "Navy"].sample
terms = rand(1..3)
new_crewperson(career, terms, ncp)
@crew << ncp
def show_crew
counter = 1
@crew.each do |c|
print("Crewperson #%d is %d years old.

Why require autoconf 2.67+

Please pardon the intrusion; I am new to Ruby and like to pull the
development version of Ruby to compile and code with.

On 8 Feb 18 (US/Eastern) I pulled the code from GitHub and Ruby
2018-02-09 trunk 62326 compiled fine and all tests except for some
timezone ones passed.

Today I pulled the source again.

Module using object defined outside of method?

I have a class Dice with a method "roll_1". It gives a result between 1-6.

class Dice
def roll_1

The module CharacterTools uses Dice.roll_1.

module CharacterTools

require 'dice'
dice =

def roll_1
dice =

"dice" is declared twice, outside and inside the roll_1 method
definition. I am trying to figure out how to instantiate one "dice"
object outside of the method that calls it. For each program run there
are lots of calls to roll_1.

"90 Day Wonder" Mentoring

Having a mentor helps you grow much faster than just consuming a book or
video. Insightful feedback pushes you to learn faster. Mentors have long
been a strength of the coding community.

Except for those of us who don't work in a coding shop, or we're doing a
language/skill no one at work knows or cares about. IRC is good for fast
answers but not as helpful for long term growth.

A few years ago I ran a "90 Day Wonder" mentoring program. We took a
book and worked through it together. Since I wasn't a subject matter
expert I enlisted smarter people to help.

"Well used built in classes and modules" for Ruby Certification Exams?

The Silver Certification exam references:

"Well-used built-in classes and modules (e.g., Object, Numerical
classes, String, Array, Hash, Kernel, Enumerable, Comparable)"

The Gold Certification exam references:

" Well-used built-in classes and modules
(e.g., Object, Module, Kernel, Enumerable, Comparable)
Regular expression

Besides the ones specifically listed, which built in classes and modules
are considered "well used"?


-- Setting up for more Ruby in 2018!

Unsubscribe: <

Rakefile issue with Travis-CI

Probably Operator error.

Possible bug in updating glibc?

Hey all, not sure if this was operator error or what.

I'm running a KVM host on updated CentOS 6. The guest is built from the
CentOS 6.9 dvd1 with just @base and @core package groups.

When I went to install mysql it failed due to incompatibilities with the
libcc versions. Updated just glibc and glibc-common and then installed
mysql. Shortly there after it started to freeze and lost connection.

The KVM host is fairly beefy and mysql wasn't doing anything but running
with no queries or data.

Windows and Ruby?


It looks like the Installer issue has been taken up by some new folks,
cool. Still, it begs the question, is almost everyone doing Ruby doing so
on a non-Windows platform like Linux, Mac, or other *nix?


Confused on testing a Class as a Key in a Hash.

Actual code:
<a href="" title=""></a>

Trying to figure out why I can't compare a Hash key to it's value. The
key is a Class but if I use hash.each_key or each_pair it shows the key
and value. If I try to assert that hash[key] == value, it fails.

Besides a brain, a clue, and a life, what am I missing?



Unsubscribe: <>

Testing a written file?

This is the meat of a test I'm writing. The end state is that the test will
read a file another method has written. The goal is to test the writing
method. is there a better way? Should testing the nameserver IP addresses
go in a different test?

Yes, I'm probably doing a lot more testing than necessary.

to_i and to_s issue.

Trying to run a test to see if a to_i conversion in a method gives a
different string when converted back via to_s. The theory is that the
original_ip is the passed in a numeric only ip string. Unfortunately the
test fail thinking that "45" does not equal 45.to_s.

What am I missing, besides a brain, a clue, and a life? Is there a better
way to check?

How to share a ruby program without installed Ruby?

How do I take Ruby code and package it so I can give it to a Winderz or mac
user and they can run it without having to install Ruby? I would assume the
binaries would be different, but doable.



RubyTk and segfaults

Working with Ruby 2.4.0 and trying to see why it keeps seg faulting. I
saw an issue.

Ruby Jobs that are not Rails?

Not trying to cause an issue, but wondering what sorts of Ruby jobs there
are that are not Rails. Even Puppet seems to have moved away from using
Ruby directly.

SQLite update works in one file, fails in another.

In the second file, the save_characters() method fails to update the
database unless the upp string is manually set like:
upp = "777777"

If I edit the entry value it will print the new value, but not update.
If I use the same code in another program it works.

Generic class/design pattern question

I'm re-working old code from early efforts of learning Ruby. Now I'm trying
to get more OOP'ish and maybe figure out design patterns if they are
appropriate. I'm stuck on what do do with the "Career" concept.

Program design is pretty simple; there's a Class "Character" that stores
attributes of a Traveller RPG character.

Is $LOAD_PATH used for 'require "some_file"?'

Currently working on Winderz trying to figure out why

require "some_file"

Fails but

require "./some_file"

works. The $LOAD_PATH includes the directory the files being run and loaded
are in. Hit this issue on Linux as well, not sure if it's operator error or

Why does require need the "./" to find a file in the $LOAD_PATH?



How do you references database dirs in a gem?

The code I have works by making DATA_DIR from a relative path. When I
put that in a gem it fails to find the database. This is my first gem,
anyone have a good tutorial on how to make portable code find the
database, when the code goes from ${HOME}/<project> to



Unsubscribe: <>

First Gem fails to install

Ruby 1.8.7 on CentOS 6.

# As user
gem build ct_character_generator-0.0.1.gemspec
WARNING: no description specified
WARNING: no rubyforge_project specified
WARNING: deprecated autorequire specified
Successfully built RubyGem
Name: CT_Character_Generator
Version: 0.0.1
File: CT_Character_Generator-0.0.1-unknown.gem

# As root
gem install CT_Character_Generator-0.0.1-unknown.gem
ERROR: While executing gem ...