Created
February 3, 2015 18:57
-
-
Save noam87/82adee65f7f2e9039617 to your computer and use it in GitHub Desktop.
fake return
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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