Skip to content

Commit

Permalink
Prepare v1.4.0 for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Petherbridge committed Feb 12, 2016
1 parent fdc33ea commit 53c6393
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes

* 1.4.0 2016-02-11
- Add support for asynchronous object macros (using promises via RSVP.js),
and the accompanying `replyAsync()` function and example code.
- Add ability to use an array in a reply element as a shortcut for random
text: `- (@myArray)` translates to `- {random}my|array|content{/random}`.

* 1.2.1 2016-02-03
- Fix `setSubroutine()` not accepting a function object as an argument.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rivescript",
"version": "1.2.1",
"version": "1.4.0",
"description": "RiveScript is a scripting language for chatterbots, making it easy to write trigger/response pairs for building up a bot's intelligence.",
"keywords": [
"bot",
Expand Down
10 changes: 5 additions & 5 deletions src/rivescript.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"use strict"

# Constants
VERSION = "1.2.1"
VERSION = "1.4.0"

# Helper modules
Parser = require "./parser"
Expand Down Expand Up @@ -120,12 +120,12 @@ class RiveScript
# Promise Promise
#
# Alias for RSVP.Promise
#
#
# You can use shortcut in your async subroutines
#
#
# ```javascript
# rs.setSubroutine("asyncHelper", function (rs, args) {
# return new rs.Promise(function (resolve, reject) {
# return new rs.Promise(function (resolve, reject) {
# resolve(42);
# });
# });
Expand Down Expand Up @@ -778,7 +778,7 @@ class RiveScript
#
# Asyncronous version of reply. Use replyAsync if at least one of the subroutines
# used with <call> tag returns a promise
#
#
# Example: using promises
#
# ```javascript
Expand Down
7 changes: 7 additions & 0 deletions test/test-rivescript.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ exports.test_reply_arrays = (test) ->
bot = new TestCase(test, """
! array greek = alpha beta gamma
! array test = testing trying
! array format = <uppercase>|<lowercase>|<formal>|<sentence>
+ test random array
- Testing (@greek) array.
Expand All @@ -450,6 +451,9 @@ exports.test_reply_arrays = (test) ->
+ test weird syntax
- This (@ greek) shouldn't work, and neither should this @test.
+ random format *
- (@format)
""")
bot.replyRandom("test random array", [
"Testing alpha array.", "Testing beta array.", "Testing gamma array.",
Expand All @@ -466,6 +470,9 @@ exports.test_reply_arrays = (test) ->
"I'm trying more beta (@arrays).", "I'm trying more gamma (@arrays)."
])
bot.reply("test weird syntax", "This (@ greek) shouldn't work, and neither should this @test.")
bot.replyRandom("random format hello world", [
"HELLO WORLD", "hello world", "Hello World", "Hello world",
])
test.done()

################################################################################
Expand Down

0 comments on commit 53c6393

Please sign in to comment.