Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1 from jsl/update-readme

Update README with Rake instructions
  • Loading branch information...
commit 2b189760528b22310ba08ffd90f93864ed3d2160 2 parents f8c4bf8 + 4bfda35
Justin S. Leitgeb authored August 04, 2012

Showing 2 changed files with 18 additions and 24 deletions. Show diff stats Hide diff stats

  1. 40  README.md
  2. 2  Rakefile
40  README.md
Source Rendered
... ...
@@ -1,36 +1,28 @@
1  
-# Running Ruby from Clojure
  1
+# Ruby from Clojure
2 2
 
3 3
 This is a simple example of calling Ruby from Clojure. It contains a simple
4 4
 JRuby project and a Clojure project:
5 5
 
6  
-* steel_city - a Ruby project that returns the speakers for the given day
  6
+* `steel_city` - a Ruby project that returns the speakers for the given day
7 7
   in the Steel City Ruby Conference 2012
8  
-* speaker_selector - Returns a "top" speaker for the given day using a 
  8
+* `speaker_selector` - Returns a "top" speaker for the given day using a 
9 9
   sophisticated algorithm (ie, random selection)
10 10
 
11  
-## Compiling
12  
-
13  
-    cd steel_city
14  
-    jrubyc --javac schedule.rb
15  
-    jar -cf schedule.jar com/steelcity/Schedule.class
16  
-
17  
-## Installing with mvn
18  
-
19  
-In your clojure project, set up the dependencies in the project.clj. 
20  
-You will need dependencies on jruby and your compiled jar.
21  
-
22  
-You will have to install these with mvn so that lein deps loads the
23  
-dependencies:
  11
+## Running
24 12
 
25  
-    mvn install:install-file -DgroupId=com.steelcity.schedule \
26  
-    	-DartifactId=com.steelcity.schedule -Dversion=0.0.0 \
27  
-	-Dpackaging=jar -Dfile=schedule.jar
  13
+    $ rake
28 14
 
29  
-The command to install jruby to your local mvn repository will be similar.
  15
+    => (import com.steelcity.Schedule)
  16
+    => (top-speaker "Friday")
  17
+    => (top-speaker "Saturday")
30 18
 
31  
-## Running
  19
+## How does this work?
32 20
 
33  
-In the Clojure REPL, load the speaker-selector.core namespace and run:
  21
+For detailed instructions on how to get this working with your own Ruby code,
  22
+have a look at the
  23
+[`Rakefile`](https://github.com/jsl/ruby_from_clojure/blob/master/Rakefile)
34 24
 
35  
-    (top-speaker "Friday")
36  
-    (top-speaker "Saturday")
  25
+    rake clean    # Remove build artifacts
  26
+    rake compile  # Compile Ruby into Java bytecode
  27
+    rake install  # Install and copy to Clojure project
  28
+    rake run      # Start leiningen repl
2  Rakefile
@@ -63,3 +63,5 @@ task :run => :install do
63 63
   # Open repl with leiningen
64 64
   system "cd speaker_selector && lein repl"
65 65
 end
  66
+
  67
+task :default => :run

0 notes on commit 2b18976

Please sign in to comment.
Something went wrong with that request. Please try again.