README.md in socrates-0.1.3 vs README.md in socrates-0.1.4
- old
+ new
@@ -1,8 +1,8 @@
# Socrates
-Socrates is a micro-framework for building conversational interfaces. It provides straight-forward state management, a clear pattern for modeling the states and conversational flow (transitions), and some helpers.
+Socrates is a micro-framework for building stateful conversational interfaces. It provides straight-forward state management, a clear pattern for modeling the states and conversational flow (transitions), and some helpers.
It's designed for building conversational Slack bots, but is designed in such a way that other adapters could be written. It ships with a Console adapter for testing locally in the terminal as well as a Memory adapter for use in automated tests.
*Disclaimer: This framework is currently experimental and will change.*
@@ -17,11 +17,11 @@
```ruby
class GetStarted
include Socrates::Core::State
def listen(message)
- case message.strip
+ case message.downcase
when "help"
transition_to :help
when "age"
transition_to :ask_for_name
else
@@ -111,11 +111,11 @@
def birth_date
@data.get(:birth_date)
end
def calculate_age
- ((Date.today.to_time - birth_date.to_time) / 31_536_000).floor
+ ((Date.today.to_time - birth_date.to_time) / 1.year).floor
end
end
```
## Installation
@@ -134,10 +134,23 @@
$ gem install socrates
## Usage
-TODO: Write usage instructions here.
+Socrates is intended to be used programmatically from your application.
+
+However, it's easy to see a sample conversation run in either the console or on Slack.
+
+To see socrates in action in the console:
+
+ $ socrates run
+
+And on Slack:
+
+ $ SLACK_API_TOKEN=<your token> socrates -a slack run
+
+Use `-s redis` to store state in Redis instead of memory. The key difference is that state will survive exiting and
+restarting the bot. Use the `-d` flag for debugging log information.
## Core Concepts
* Dispatcher
* Adapter (Slack, Console, Memory)