Skip to content

Instantly share code, notes, and snippets.

@eraserhd
Created February 4, 2019 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eraserhd/f4f8f52fb43a2e4a5b6fc740a1101c02 to your computer and use it in GitHub Desktop.
Save eraserhd/f4f8f52fb43a2e4a5b6fc740a1101c02 to your computer and use it in GitHub Desktop.
(ns twou.centralpark.data.loader)
(defn ns-task-data [symbol]
(let [subtasks (->> (ns-publics symbol)
vals
(filter (comp :taskdef? meta)))
ns-meta (meta (:ns (meta (first subtasks))))
task-name (name (:taskdef/code-keyword ns-meta))
_ (prn :name task-name)
_ (prn :type (class task-name) (type task-name))
task-symbol (symbol task-name)
_ (prn :task task-name task-symbol)]
(concat
(list 'task task-symbol (str (:taskdef/uuid ns-meta))
(:taskdef/name ns-meta))
subtasks)))
dev=> (twou.centralpark.data.loader/ns-task-data 'twou.centralpark.proc.new-marketing-strategy)
:name "new-marketing-strategy"
:type java.lang.String java.lang.String
:task "new-marketing-strategy" nil
(task nil "5b197af0-a62e-48c5-b51b-445d522c1d11" "Stand up marketing strategy - {{:taskexec/marketing-strategy :marketing-strategy/shortname}}" #'twou.centralpark.proc.new-marketing-strategy/marketing-site-specified #'twou.centralpark.proc.new-marketing-strategy/marketing-strategy-details #'twou.centralpark.proc.new-marketing-strategy/live-in-landing-page-specified #'twou.centralpark.proc.new-marketing-strategy/branding-exists #'twou.centralpark.proc.new-marketing-strategy/prospect-form-grouping-in-cms #'twou.centralpark.proc.new-marketing-strategy/landing-page-specified #'twou.centralpark.proc.new-marketing-strategy/live-in-marketing-site-specified #'twou.centralpark.proc.new-marketing-strategy/landing-page-exists #'twou.centralpark.proc.new-marketing-strategy/prospect-form-grouping-specified)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment