This file contains 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
ENV["WATCHR"] = "1" | |
system 'clear' | |
def growl(message) | |
growlnotify = `which growlnotify`.chomp | |
title = "Watchr Test Results" | |
puts message | |
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png" | |
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'" | |
system %(#{growlnotify} #{options} &) |
This file contains 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
# == Paperclip without ActiveRecord | |
# | |
# Simple and lightweight object that can use Paperclip | |
# | |
# | |
# Customized part can be extracted in another class which | |
# would inherit from SimplePaperclip. | |
# | |
# class MyClass < SimplePaperclip | |
# attr_accessor :image_file_name # :<atached_file_name>_file_name |
This file contains 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
defimpl Poison.Encoder, for: Timex.DateTime do | |
use Timex | |
def encode(d, _options) do | |
fmt = Timex.format!(d, "{ISO}") | |
"\"#{fmt}\"" | |
end | |
end |