Skip to content

Instantly share code, notes, and snippets.

@noam87
Created February 3, 2015 18:57
Show Gist options
  • Save noam87/82adee65f7f2e9039617 to your computer and use it in GitHub Desktop.
Save noam87/82adee65f7f2e9039617 to your computer and use it in GitHub Desktop.
fake return
# WARNING:
# Horrible things happening here for development reasons.
# Do not leave this in.
require 'colorize'
module Zing
module PlayerRecommender
class Todo
def self.warn
str ||= ''
caller_locations(2, 1).first.tap do |loc|
puts "#{loc.label}".green.bold + " mocked but not implemented!!!!111:".red.bold
puts " #{loc.path}:#{loc.lineno}".red
end
end
end
end
end
class Object
def fake_return(output)
Zing::PlayerRecommender::Todo.warn
return output
end
def self.fake_return(output)
Zing::PlayerRecommender::Todo.warn
return output
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment