DevHeads.net

Postings by Brandon Weaver

Illustrated Guide to Ruby

Hey all, I'm working on a new book: An Illustrated Guide to Ruby. Havenwood
is helping me write as well.

<a href="https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/" title="https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/">https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/</a>

Short version: I'm using cute Lemurs to teach Ruby.

Currently it's my NaNoWriMo project, but a long term idea of mine I wanted
to fully realize. After reading books like Learn You a Haskell and Why's
Poignant Guide I wanted to write a true beginners book for Ruby.

The illustrations take a bit to catch up as they take ~20-30m each
including digitalization, though I'm getting faster.

Daily Reminder: TCL > Ruby 19927

shoutz to irc.gangnet.ru #tclmafia 1304

Daily Reminder: TCL > Ruby 11116

shoutz to irc.gangnet.ru #tclmafia 28528

Daily Reminder: TCL > Ruby 22043

shoutz to irc.gangnet.ru #tclmafia 16155

Daily Reminder: TCL > Ruby 6972

shoutz to irc.gangnet.ru #tclmafia 23762

Daily Reminder: TCL > Ruby 8110

shoutz to irc.gangnet.ru #tclmafia 8905

Daily Reminder: TCL > Ruby 20558

shoutz to irc.gangnet.ru #tclmafia 3869

Daily Reminder: TCL > Ruby 28462

shoutz to irc.gangnet.ru #tclmafia 28265

Daily Reminder: TCL > Ruby 26812

shoutz to irc.gangnet.ru #tclmafia 21949

Daily Reminder: TCL > Ruby 8127

shoutz to irc.gangnet.ru #tclmafia 23288

Daily Reminder: TCL > Ruby 1476

shoutz to irc.gangnet.ru #tclmafia 10060

Izzy - Condense long conditionals

Izzy lets you condense long conditionals into more terse code.

<a href="https://github.com/baweaver/izzy" title="https://github.com/baweaver/izzy">https://github.com/baweaver/izzy</a>

So let's see it in action: (Person class is in the readme)

brandon = Person.new('brandon', 23, 'm')

# Boolean matchers
brandon.all_of? :older_than_18?, :male?, :me?, :geek? # => true
brandon.none_of? :younger_than_18?, :female? # => true
brandon.any_of? :male?, :female?, :geek? # => true

# === matchers
brandon.matches_all? name: /^br/, age: (20..30) # => true
brandon.matches_any? name: /br$/, age: (20..30) # => true
brandon.matches_none?

New Array Methods idea

So granted I've ventured over to Lisp land a bit, but these ideas still
seem like they could be useful:

array = [1, 2, 3, 4, 5]

# Exists
array.first # => 1

# Proposed
array.rest # => [2, 3, 4, 5]
# ...and/or array.tail

Granted it would be as simple as array[1..-1] but that lacks the distinct
eloquence of most ruby syntax and it seems to be far more of a language
feature possibility.

Monkey patching it on would be trivial, yes, but I would rather avoid that
in favor of discussing this as a possible feature.

This of course inspired by Lisp's car/cdr or first/rest and head/tail (of
which I

Mime

Hey Ruby-Talk,

Working on a project that I'd like to get some feedback on:
<a href="https://github.com/baweaver/mime" title="https://github.com/baweaver/mime">https://github.com/baweaver/mime</a>

While working on showing some newer technicians how I did things, I
realized that I should really automate these tasks. I then took to making a
script to do this, and halfway through thought to myself why in the world
am I doing this? By showing them the steps I'd already done the task, why
rewrite the entire thing?

Pure Ruby Jobs

One thing has been bugging me lately. I've been looking around for jobs in
Ruby and I always find Rails within minutes, but pure Ruby or Raw Ruby are
never really mentioned. I just find it odd that Rails completely dominates
the Ruby market when quite frankly Ruby itself is an excellent language for
administration on its own. I can understand it falling under "a scripting
language" in most markets like Python or Perl, but given its strengths why
doesn't it stand more on its own outside of large scale DSLs?

numeric?

I've found a bit of an annoyance trying to find out if a number is numeric
or not. I thought it would probably be a simple string method but I found
far more contrived solutions like regex matches. Eventually I settled on
monkey patching string with a Numeric? method using Float(self)! = nil
rescue false.

Is there a better way to go about this? If not, can we get something added
to the core?

Thanks for your time,

Brandon

Ruby Conferences for Students

I'd love to be able to go to a Ruby conference, but 350$ is somewhat
outside my price range as a full time student. Are there any
programs available for students to get a discount to attend such meetings?

Thanks for your time,

Brandon Weaver

Teaching a Class on Ruby

Hey guys, I'm new to the list. I'm a Student Rubyist/Unix Hacker out of
Joplin, MO.

I'm looking into starting a Class/Podcast on Ruby because of some of the
interest I've generated in the language. I've been asked if I could show
various sets of people (approx 15) how to program in Ruby, so instead of
individually teaching each one I've decided to host a class of sorts. Some
of those interested have experience in .NET and Java, while others haven't
ever touched programming.