1 2 3 4
def test(a, b) capitalize_args puts a # => Hello ...
Ruby Bindings on caller
I dont really have a need f...
1 2 3 4
def monitor(uri) Thread.new(uri) do |uri| begin ...
Ruby Initial script execution ve...
by Tj Holowaychuk,
November 22, 2008 02:27,
No refactoring
Below is a little snippit o...
1 2 3 4
require 'uri' module URI ...
Ruby On Shortest regular expression...
by Tj Holowaychuk,
November 21, 2008 07:53
I would maybe consider exte...
1 2 3 4
# Suppose I have San::Languages::JavaScript as the 'lang' local var below # I want a string of 'JavaScript' from this example ...
Ruby Retrieve class name only
by Tj Holowaychuk,
November 07, 2008 04:41,
1 refactoring
Im sure there is a better w...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 18:31
Hmm well that makes sense a...
1 2 3 4
def something(var) var = 'world' end ...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 16:21
Strange.. must just have my...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 16:12
So my code above just flat ...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 15:55
and the bottom call to each...
1 2 3 4
def some_method(var, &block) yield var end ...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 15:52
I understand that now, but ...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 02:30
Aware of that now :) makes ...
1 2 3 4
class Array def inject(accumulator = 0) each { |element| yield(accumulator, element) } ...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 01:58
Hmm i understand that, Im s...
Ruby On Yield by 'reference'
by Tj Holowaychuk,
October 24, 2008 01:36
It is interesting that the ...
1
res = path_without_calculation.scan(/\{([^}]+)\}/).flatten
Ruby On Extract text between {} bra...
by Tj Holowaychuk,
October 23, 2008 22:48
This is maybe a little nit-...
1 2 3 4
class Array def new_inject(initial, &block) self.each { |v| yield initial, v } ...
Ruby Yield by 'reference'
by Tj Holowaychuk,
October 23, 2008 22:25,
16 refactorings
This has been bugging me, i...
Ruby On Source code analysis
by Tj Holowaychuk,
September 26, 2008 22:58
I am skipping rails for now...
Ruby On Source code analysis
by Tj Holowaychuk,
September 26, 2008 03:05
Yikes, not sure what is up ...
1 2 3 4
#!/usr/bin/env ruby # == Synopsis ...
Ruby Source code analysis
by Tj Holowaychuk,
September 26, 2008 03:04,
3 refactorings
Small class to analyze scri...
Cool thanks! not overly pra...