Browse files


  • Loading branch information...
1 parent d27ae0a commit e160d6ebcedb6d2ec43914b1c6ceb10f5964b941 @floere committed Jun 8, 2011
Showing with 31 additions and 21 deletions.
  1. +31 −21 README.textile
@@ -45,40 +45,49 @@ Here, he will just say the current time when entering the @:time@ state.
h3. Running it
-Running it is easy. Either use
+Running it is easy. There are multiple options:
-<pre><code>require 'rubygems'
-require 'james'
+In the terminal, just call
-# Your dialog goes here.
+<pre><code>$ james time_dialog.rb twitter_dialog.rb</code></pre>
-# This is needed to start James.
+and it will include the named dialogs, @time_dialog.rb@, @twitter_dialog.rb@.
-in your script, and call it by using
+Or a bit snappier
-<pre><code>ruby time_dialog.rb</code></pre>
+<pre><code>$ james {time,twitter}*.rb</code></pre>
-Or, without the @James.listen@, use @ruby -rexamples/your_dialog.rb -e "James.listen"@ in the command line.
+to do the same as above.
-Or else, in the terminal, just call
+There is also a shortcut:
<pre><code>$ james</code></pre>
-and it will include all dialogs (files called @_dialog{ue,}.rb@, the @ue@ is for the brits and aussies :) ) in this directory and subdirectories. E.g. @joke_dialog.rb@, @newsfeed_dialog.rb@, or @social_media/tweets_dialog.rb@.
-You can select dialogs using their file names
+<pre><code>$ james **/*_dialog.rb</code></pre>
-<pre><code>$ james time_dialog.rb twitter_dialog.rb</code></pre>
-and it will include the time dialog and the twitter dialog.
+Or do it programmatically:
-Or a bit snappier
+<pre><code>require 'rubygems'
+require 'james'
-<pre><code>$ james {time,twitter}*.rb</code></pre>
+# Your dialog goes here.
-to do the same as above.
+# This is needed to start James.
+in your script, and call it by using
+<pre><code>$ ruby time_dialog.rb</code></pre>
+Or, without the @James.listen@, use
+<pre><code>$ ruby -rexamples/your_dialog.rb -rexamples/your_other_dialog.rb -e "James.listen"</code></pre>
+on the command line.
h3. Short Version
@@ -95,6 +104,8 @@ There is a short, anonymous dialog version, using @James.use_dialog@.
+@James.use_dialog@ will directly create a dialog instance from your definitions in the block and plug it into James.
h3. Extended Version
Or there is an extended version, using initialize with parameters to set up some important stuff that needs other stuff for doing stuff, you know?
@@ -115,6 +126,7 @@ class TwitterDialog
hear 'Who mentions me?' => :mentions
into do
# Complicated feed loading
+ #
"People are saying this: #{@client.newsfeed(10).join(' ... ')}"
@@ -136,7 +148,6 @@ James.listen</code></pre>
h2. Contributions
Contributions are in the "/examples": folder.
-Sending dialog gists is appreciated. Thanks!
After forking, in the james directory, run @./bin/james examples/time_dialog.rb@ to have your first successful experience! :)
@@ -146,8 +157,7 @@ h2. Running the tests
h2. Roadmap
-* Make James (e.g. voice, core dialog) configurable.
-* Add more useful dialogs made by YOU :)
+* Add dialogs made by YOU :)
h2. Ideas

0 comments on commit e160d6e

Please sign in to comment.