Permalink
Browse files

Merge pull request #1 from jsl/update-readme

Update README with Rake instructions
  • Loading branch information...
2 parents f8c4bf8 + 4bfda35 commit 2b189760528b22310ba08ffd90f93864ed3d2160 @jsl committed Aug 5, 2012
Showing with 18 additions and 24 deletions.
  1. +16 −24 README.md
  2. +2 −0 Rakefile
View
40 README.md
@@ -1,36 +1,28 @@
-# Running Ruby from Clojure
+# Ruby from Clojure
This is a simple example of calling Ruby from Clojure. It contains a simple
JRuby project and a Clojure project:
-* steel_city - a Ruby project that returns the speakers for the given day
+* `steel_city` - a Ruby project that returns the speakers for the given day
in the Steel City Ruby Conference 2012
-* speaker_selector - Returns a "top" speaker for the given day using a
+* `speaker_selector` - Returns a "top" speaker for the given day using a
sophisticated algorithm (ie, random selection)
-## Compiling
-
- cd steel_city
- jrubyc --javac schedule.rb
- jar -cf schedule.jar com/steelcity/Schedule.class
-
-## Installing with mvn
-
-In your clojure project, set up the dependencies in the project.clj.
-You will need dependencies on jruby and your compiled jar.
-
-You will have to install these with mvn so that lein deps loads the
-dependencies:
+## Running
- mvn install:install-file -DgroupId=com.steelcity.schedule \
- -DartifactId=com.steelcity.schedule -Dversion=0.0.0 \
- -Dpackaging=jar -Dfile=schedule.jar
+ $ rake
-The command to install jruby to your local mvn repository will be similar.
+ => (import com.steelcity.Schedule)
+ => (top-speaker "Friday")
+ => (top-speaker "Saturday")
-## Running
+## How does this work?
-In the Clojure REPL, load the speaker-selector.core namespace and run:
+For detailed instructions on how to get this working with your own Ruby code,
+have a look at the
+[`Rakefile`](https://github.com/jsl/ruby_from_clojure/blob/master/Rakefile)
- (top-speaker "Friday")
- (top-speaker "Saturday")
+ rake clean # Remove build artifacts
+ rake compile # Compile Ruby into Java bytecode
+ rake install # Install and copy to Clojure project
+ rake run # Start leiningen repl
View
2 Rakefile
@@ -63,3 +63,5 @@ task :run => :install do
# Open repl with leiningen
system "cd speaker_selector && lein repl"
end
+
+task :default => :run

0 comments on commit 2b18976

Please sign in to comment.