March 12, 2015 by Daniel P. Clark

Substitution with Regex Groupings

As I continue to grow in experience I was looking into how I might do some in-place substitution that I had been accustomed to performing with array matching (split-map-join).  What I’m referring to isn’t just a letter for letter substitution, but something that would find a match and modify it.  For example; if I wanted…

Continue Reading »

March 9, 2015 by Daniel P. Clark

Ruby: Actionable Meta

The more you program the more likely you will need to change a string to the object the string represents. For example you may have a string with a mystery class name in it the you need to call methods on. Lets go a step further, lets say the method you need to call on…

Continue Reading »

March 7, 2015 by Daniel P. Clark

Configuration With a Singleton Instance

I was considering how I might want to further implement my gem and incorporate configuration settings for it.  I wanted only one instance of my configuration and it needed to be part of my module.  So I’ve come up with a solution I like that allows me to do this and even have a true…

Continue Reading »

March 6, 2015 by Daniel P. Clark

Numeric Bases and Defining Your Own

Lately I’ve been teaching my niece a new way to do math.  She would have difficulty with addition and subtraction of numbers if they contained more than a few digits.  I asked her if she’d ever seen a clock where the numbers rolled over (like in the movie Ground Hog Day).  She hadn’t.  I decided…

Continue Reading »

March 3, 2015 by Daniel P. Clark

Ruby: The Case for Case

It’s nice to have case and when available in Ruby.  But I don’t see it used too often.  I myself don’t use it much because I’m more accustomed to just using if and else.  So let’s get into case switching. person = “employee” case person when “boss” puts “Yes sir!” when “employee” puts “Sure I’ll…

Continue Reading »

March 1, 2015 by Daniel P. Clark

Version Both Your Github Repo and Gem

There are many howtos on getting started with Github and creating a Ruby gem.  What I haven’t come across is a blog about versioning your github releases.  So I will demonstrate here the steps I go through after verifying a gem is ready, releasing it, and publishing a version to the code base on Github….

Continue Reading »

February 27, 2015 by Daniel P. Clark

Value Assignment and Deferment with Lambdas/Procs

When assigning a variable with a raw value the outcome is as you would expect. greeting = “hello” # => “hello” puts greeting # hello Now while learning about assigning methods to variables I used to wonder if I was assigning the result value from the method, or simply pointing to the method to be…

Continue Reading »

February 24, 2015 by Daniel P. Clark

Writing methods for both class and instance levels

When perusing the Rails documentation for various methods I noticed something that seemed odd to me.  The method descriptions seemed to show an extra parameter as the first parameter that I was never using.  It’s strange when you use the methods all the time and it doesn’t seem to be implemented the way the documentation…

Continue Reading »

February 21, 2015 by Daniel P. Clark

Minitest with Watir-webdriver

Why, you might ask, would I even think of Watir-webdriver?  Well let me tell you.  It’s because it’s easy and fun.  It’s not a fast way to run tests though.  What Watir will do for you is open an actual web browser window and let you check and interact with it from your Ruby code….

Continue Reading »

February 20, 2015 by Daniel P. Clark

Some Basic Ruby Tools for Sniffing out Errors

Needing to know what’s going on under the hood is a big part to solving problems and challenges.  For the longest time I only ever used print statements to output to the console the state of something at a specific point.  That’s all I ever used in Python.  But sometimes you need to do a…

Continue Reading »

Page 6 of 11
1 4 5 6 7 8 11
1 4 5 6 7 8 11