Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@devn
Created September 17, 2011 21:55
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 devn/1224410 to your computer and use it in GitHub Desktop.
Save devn/1224410 to your computer and use it in GitHub Desktop.
def'd haml-engine cannot be eval'd via the REPL?
(ns blog.core
(:require [ring.adapter.jetty :as jetty]
[clojure.contrib.io :as io]
[clojure.contrib.classpath :as cp])
(:import [org.jruby.embed ScriptingContainer LocalContextScope]))
(def scripting-container (ScriptingContainer. LocalContextScope/THREADSAFE))
(defn execute-rb [rb-string]
(. scripting-container runScriptlet rb-string))
(gem-require "rubygems"
(gem-require "haml-3.1.3/gem/haml")
(def haml-engine (execute-rb "Haml::Engine")) ;; C-x C-e from the REPL says HAML is not defined
;; However, if I type this line out in the REPL, it works. Puzzling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment