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
require 'rails_helper' | |
class Tear | |
end | |
class Me | |
attr_accessor :you | |
def afraid? | |
!you.present? |
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
#AMQP.logging = true | |
#set_trace_func proc { |event, file, line, id, binding, classname| | |
# if event == "call" && ((file.include?("lib/amqp") && | |
# !file.include?("lib/amqp/buffer") && | |
# #!file.include?("lib/amqp/frame") && | |
# !file.include?("lib/amqp/spec")) || | |
# file.include?("eventmachine")) | |
# printf "from %-130s\t%8s\t%-25s:%-4d\t%s\n", caller[2], event, File.basename(file), line, id | |
# end | |
#} |
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
(defn transform-fields [m] | |
(into [] (flatten (for [[k v] m] [k {:type (keyword v)}])))) | |
(defn parse-json-config [s] | |
(let [jsn (keywordize-keys (json/parse-string s)) | |
result (into {} (for [[idx cfg-map] jsn] | |
{idx (into {} (for [[k v] cfg-map] | |
(if (or (= :fields k) (= :attributes k)) | |
{k (transform-fields v)} | |
{k v})))}))] |