Guest User

Untitled

a guest
Jan 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. (ns blog.core
  2. (:require [ring.adapter.jetty :as jetty]
  3. [clojure.contrib.io :as io]
  4. [clojure.contrib.classpath :as cp])
  5. (:import [org.jruby.embed ScriptingContainer LocalContextScope]))
  6.  
  7. (def scripting-container (ScriptingContainer. LocalContextScope/THREADSAFE))
  8.  
  9. (defn execute-rb [rb-string]
  10. (. scripting-container runScriptlet rb-string))
  11.  
  12. (gem-require "rubygems"
  13. (gem-require "haml-3.1.3/gem/haml")
  14.  
  15. (def haml-engine (execute-rb "Haml::Engine")) ;; C-x C-e from the REPL says HAML is not defined
  16. ;; However, if I type this line out in the REPL, it works. Puzzling.
Add Comment
Please, Sign In to add comment