~/.tmux.conf:
bind z send-keys "say ack" C-m
~/.tmux.conf:
class Role < Module | |
IncompleteInterface = Class.new(RuntimeError) | |
def included(receiver) | |
missing_methods = @public_api.map(&:to_sym) - receiver.public_instance_methods.map(&:to_sym) | |
unless missing_methods.empty? | |
raise IncompleteInterface, | |
"#{receiver} must implement these methods: #{missing_methods.inspect}" | |
end |
Hi, [insert recruiter's first name here]-
I've gone to some lengths to save everyone some time by maintaining a FAQ page on my resume website: http://resume.livingston-gray.com/faq.html
I've even gone so far as to change my LinkedIn profile so that it directs recruiters to read the FAQs before contacting me about relocation opportunities. So, thank you, [recruiter's first name]! By carefully ignoring all of that information, you've freed me from having to feel even remotely guilty for sending you a canned response.
I really like the idea of testing the interface of the base Bicycle class, but I'm having that "someone on the Internet is WRONG!" feeling when I get to the section "Testing Concrete Subclass Behavior".
Specifically, you write "The RoadBikeTest should ensure that local_spares works while maintaining deliberate ignorance about the existence of the spares method. The shared BicycleInterfaceTest already proves that RoadBike responds correctly to spares, it is redundant and ultimately limiting to reference that method directly in this test."
The thing is, though, that--at least as written in the Rough Cut version of the book I'm looking at--the BicycleInterfaceTest doesn't prove that RoadBike responds correctly to spares. It only proves that it responds to spares.
So I went off to recreate the code locally to make sure that what I was seeing was correct, and sure enough, I can comment out the entire method body of Bicycle#spares, and all the interface tests pass because they're just checking #respon
Rubyists! In the process of doing an "extract method object" refactoring, I wound up with a service object that calls several other (inner) service objects. A simplified version is below.
Note that (a) I'm using a simple Result object to report success/failure back to the calling code, and (b) I'm passing the same Result instance around to subservices (to keep track of overall process state).
My question is this: in a multistep process, how should I handle failure in an intermediate step?
The options I can think of are:
do_phase_3 unless @result.failure?
), explicitly check for failure in a substep, and abort manually.NO CONNECTION / Car temporarily not available for rental
require 'new_relic/agent/method_tracer' | |
class NR | |
# Convenience method for adding NewRelic tracing around specific methods of interest. | |
# | |
# Note about performance: | |
# | |
# " CAUTION - adding probes to your code adds overhead. | |
# Each probe burns about 20 microseconds of CPU. | |
# Be careful not to probe a method that's called frequently in a loop. " |
(In response to https://gist.github.com/1687527, with apologies and smoochies to @jc00ke.) | |
my-proj | |
| | |
-- app | |
| | |
-- data_mappers <--- (see note below) | |
-- models | |
-- views | |
-- controllers |
If you'd prefer not to receive e-mail like this from Adobe in the future, please unsubscribe. Alternatively, you may mail your unsubscribe request to: | |
UNSUBSCRIBE | |
Adobe Systems Incorporated | |
Attn: Change of Address/Privacy | |
343 Preston Street | |
Ottawa, ON K1S 1N4 | |
Canada |
class HashProxy | |
instance_methods.each { |meth| undef_method(meth) unless meth =~ /^__/ } | |
def self.new(delegate) | |
return delegate unless delegate.kind_of?(Hash) | |
super | |
end | |
def initialize(hash) | |
@hash = hash |