Why design the callback parameter as a Module?
The docs are not super clear, but you can also supply a sub-class of FileWatch
. That would let you use locals more easily.
It takes either a module with the needed methods, or a class with the needed methods AND it must be a sub-class of the desired class.
Take a look at the code, specifically, the klass_from_handler method.
Map multidimensional array with join as proc
I don't recommend doing it that way, but if you insist, this is a way to do it:
$, = " "
[["a", "airway", "sarsaparilas"], ["a", "sarsaparilas", "airway"]].map!(&:join)
#=> ["a airway sarsaparilas", "a sarsaparilas airway"]
If necessary, you can revert $,
back to the default value after doing this.$, = nil
Related Topics
Ruby: Converting a Nested Ruby Hash to an Un-Nested One
Rails Redirecting Invalid Route to Root
Problem with Vim's Ruby Plugin
How to Validate Overlapping Times in Rails with Postgresql
Algorithm to Render a Horizontal Binary-Ish Tree in Text/Ascii Form
Sinatra on Nginx Configuration - What's Wrong
How to Write (Large) Files with Ruby Eventmachine
List Array of Days Between Two Dates
How to Make Devise Registrationscontroller to Show Sign_Up Page Only If User Is Already Signed In
Phusion Passenger with Ruby 1.8 and 1.9
Undefined Method 'Merge' for '####':String <%= Form_For %> Helper
Why Is Split(' ') Trying to Be (Too) Smart
Ruby: Start Reading at Arbitrary Point in Large File
Convert Durations in Ruby - Hh:Mm:Ss.Sss to Milliseconds and Vice Versa
Difference Between "Class A; Class B" and "Class A::B"
How to Add Usr/Local/Bin to Path Environment Variable on Ubuntu 12.0.4