Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update README with Rake instructions #1

Merged
merged 4 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.