DevHeads.net

Postings by leam hall

Trouble-shooting Apache 2.2 Alias

Following the Alias docs (
<a href="https://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias" title="https://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias">https://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias</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.

Leam

"Circular require considered harmful"

Trying to figure out how to resolve this error:

/usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:59:
warning:
/usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:59:
warning: loading in progress, circular require considered harmful

This is the file it is referencing:

<a href="https://github.com/makhidkarun/ftl_chargen/blob/master/lib/ftl_chargen.rb" title="https://github.com/makhidkarun/ftl_chargen/blob/master/lib/ftl_chargen.rb">https://github.com/makhidkarun/ftl_chargen/blob/master/lib/ftl_chargen.rb</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:
File.directory?('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?

Leam

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
following:

MJIT warning: failure in loading code from
'/tmp/_ruby_mjit_p20781u0.so': /tmp/_ruby_mjit_p20781u0.so: 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 = Character.new
career = ["Merchant", "Navy"].sample
terms = rand(1..3)
new_crewperson(career, terms, ncp)
@crew << ncp
end
end
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
rand(1..6)
end
end
###

The module CharacterTools uses Dice.roll_1.

###
module CharacterTools

require 'dice'
dice = Dice.new

def roll_1
dice = Dice.new
dice.roll_1
end
end
###

"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)
Numeric
Regular expression
Proc
Thread/Fiber"

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

Thanks!

Leam
-- Setting up for more Ruby in 2018!

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subje

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?

Wuby?

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?

Leam

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

Actual code:
<a href="https://github.com/LeamHall/CT_Character_Generator/blob/master/test/tc_Citizen.rb" title="https://github.com/LeamHall/CT_Character_Generator/blob/master/test/tc_Citizen.rb">https://github.com/LeamHall/CT_Character_Generator/blob/master/test/tc_C...</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?

Thanks!

Leam

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

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.

Thanks!

Leam

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
what.

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

Thanks!

Leam

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
/usr/lib/ruby/gems/etc/etc/etc...

Thanks!

Leam

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

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 ...

Nokogiri on Windows 7?

Anyone installed Nokogiri on Windows 7? I have fresh vanilla installs of
Ruby 2.2.6, nokogitri 1.7.0.1, mini_portile2-2.1.0, and RubyInstaller, When
I try to gem install nokogiri it bombs, mkmk.log below.

Thanks!

Leam

####

"gcc -o conftest.exe -IC:/Ruby22/include/ruby-2.2.0/i386-mingw32
-IC:/Ruby22/include/ruby-2.2.0/ruby/backward -IC:/Ruby22/include/ruby-2.2.0
-I.

Right classes and modules for use cases?

My character generator does the basic task and I want to expand it.
Since my experience has been with very small projects I'd like your
advice on scaling up well; the project is my path for learning more Ruby
and OOP.

Excellent Ruby code to read?

I keep seeing suggestions to read excellent Ruby code. Best suggestions
where to look? I'm interested in Ruby itself.

Thanks!

Leam