Sha256: 3829d05ff2c993b36518993f6dcfa474ceeda147e07a5cf8cbb72cd07d9d4596
Contents?: true
Size: 816 Bytes
Versions: 9
Compression:
Stored size: 816 Bytes
Contents
module Kthxbye module Helper #:nodoc: all def redis Kthxbye.redis end def log(msg) if Kthxbye::Config.options[:verbose] puts "!! #{msg} - #{Time.now.strftime("%I:%M%p")}" end end # # encode/decode code taken and modified from Resque # (http://github.com/defunkt/resque/blob/master/lib/resque/helpers.rb) # def encode( data ) if defined? Yajl Yajl::Encoder.encode(data) else data.to_json end end def decode( data ) return unless data if defined? Yajl begin Yajl::Parser.parse( data, :check_utf8 => false ) rescue Yajl::ParseError end else begin JSON.parse( data ) rescue JSON::ParseError end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems