Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit e5d25ff07afb54e499612d53c80542b1da781b0c @rafeca rafeca committed Sep 28, 2011
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules/
@@ -0,0 +1,5 @@
+.git*
+examples/
+spec/
+autotest.js
+.DS_Store
@@ -0,0 +1,36 @@
+0.1.0 / 2011-09-19
+==================
+
+ * Added Twitter provisioning commands
+ * Added multiple phone number provisioning commands
+ * Added the new optional parameters to voice channels (welcome messages and privacy)
+ * Fixed bug in getAllVoiceChannels() command
+ * Updated connFu hostnames to the pre-release ones
+ * Improved the example applications
+ * Added a new CoffeeScript example application that shows events in Growl
+ * Added inline documentation to example applications
+
+0.0.4 / 2011-08-24
+==================
+
+ * Added the ability to send RSS commands via the connFu REST API
+ * Standarized the format of the events data
+ * Added autotest feature to ease the BDD development
+
+
+0.0.3 / 2011-07-28
+==================
+
+ * Added the ability to send voice commands via the connFu REST API
+
+
+0.0.2 / 2011-07-27
+==================
+
+ * Added a logging system to ease the debugging
+
+
+0.0.1 / 2011-07-26
+==================
+
+ * Initial release
23 LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2011 Rafael de Oleza <roa@tid.es>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
121 README.md
@@ -0,0 +1,121 @@
+# connFu
+
+connfu package provides an easy way to get access to connFu platform using the defined DSL.
+
+## How to install
+
+Downloading it from `npm` repository:
+
+```bash
+ $ npm install connfu
+```
+
+If you'd prefer to install the latest master version of connFu, you can clone the `connfu-node` source repository
+from GitHub and then install it using `npm`:
+
+```bash
+ $ git clone https://github.com/dogfood20/connfu-node.git
+
+ $ npm install -g connfu-node/
+```
+
+## How to use
+
+### Connecting to streams
+
+First, require `connfu` package:
+
+```js
+var connFu = require('connfu');
+```
+
+Next, create a basic application using your connFu API KEY:
+
+```js
+var app = connFu.createApp(<your_api_key>);
+```
+
+Then, attach some event handlers:
+
+```js
+app.on("voice", {
+ join: function(params){
+ console.log("The number " + params.from + " joined to the conference with number " + params.to);
+ },
+ leave: function(params){
+ console.log("The number " + params.from + " left the conference with number " + params.to);
+ }
+});
+```
+
+Finally, just listen!
+
+```js
+app.listen();
+```
+
+### Sending commands
+
+The `connFu` package can also send commands to handle some aspects of the application:
+
+```js
+var connFu = require('connfu');
+
+// Init application
+var app = connFu.createApp(<your_api_key>);
+
+// Create a voice channel with a UK number
+app.commands.voice().create("conference", "uk", {welcome_message: "Welcome to the conference"}, function(){
+ // Add a number to the whitelist
+ app.commands.voice("conference").whitelist().create("+44xxxxxx", "rafeca", function(){
+ // Update the name of the recently whitelisted number
+ app.commands.voice("conference").whitelist("+4444xxxxxx").update("the wizard");
+ });
+});
+
+(...)
+
+// Delete the voice channel
+app.commands.voice("conference").delete();
+```
+
+For more thorough examples, look at the `examples/` directory.
+
+## Running Tests
+
+To run the test suite first invoke the following command within the repo, installing the development dependencies:
+
+```bash
+ $ npm install
+```
+
+then run the tests:
+
+```bash
+ $ npm test
+```
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 Rafael Oleza &lt;roa@tid.es&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,74 @@
+/**
+ * Autotester to execute the tests when a file is modified and notify the results to Growl
+ **/
+var watch = require('nodewatch');
+var growl = require('growl');
+var Path= require('path');
+var jasmine = require('jasmine-node');
+var sys = require('sys');
+
+growl.binVersion(function(err, version){
+ if (err) {
+ sys.puts('You have to install growlnotifier to be able to use autotest');
+ process.exit(1);
+ }
+
+ watch.add('./spec').add('./spec/spies').add('./lib').onChange(function(file,prev,curr){
+
+ sys.puts('File ' + file + ' modified... Executing tests...');
+
+ var specFolder = Path.join(process.cwd(), 'spec');
+ var libFolder = Path.join(process.cwd(), 'lib');
+ var indexFile = Path.join(process.cwd(), 'index.js');
+
+ // Configure jasmine-node
+ jasmine.dev_mode = 'src';
+ for (var key in jasmine) {
+ global[key] = jasmine[key];
+ }
+ jasmine.loadHelpersInFolder(specFolder, new RegExp("[-_]helper\\.(js)$"));
+
+ jasmine.executeSpecsInFolder(
+ specFolder,
+ function(runner, log){
+ if (runner.results().failedCount == 0) {
+ growl.notify(
+ 'All tests passed! (' + runner.results().passedCount + '/' + runner.results().totalCount + ')',
+ {title: 'connFu-dsl Unit Tests', image: 'resources/tests-pass.png'}
+ );
+ } else {
+ // Get the desc of the first failing test
+ var description = '1';
+ runner.results().items_.forEach(function(value){
+ if (value.failedCount !== 0) {
+ value.items_.forEach(function(val){
+ if (val.failedCount !== 0) {
+ description = val.description;
+ }
+ });
+ }
+ });
+
+ growl.notify(
+ runner.results().failedCount + ' tests failed! (' + runner.results().passedCount + '/' + runner.results().totalCount + ')',
+ {title: description, image: 'resources/tests-fail.png'}
+ );
+ }
+
+ // Restart jasmine environment after executing the test suite
+ var jasmineEnv = jasmine.getEnv();
+ jasmineEnv.currentRunner_ = new jasmine.Runner(jasmineEnv);
+
+ // Remove loaded files from cache
+ for (var required in require.cache) {
+ if (required.indexOf(specFolder) === 0 || required.indexOf(libFolder) === 0 || required.indexOf(indexFile) === 0) {
+ delete require.cache[required];
+ }
+ }
+ },
+ true, // Verbose mode
+ true , // Show colors
+ new RegExp(".spec\\.(js)$", 'i')
+ );
+ });
+});
Oops, something went wrong.

0 comments on commit e5d25ff

Please sign in to comment.