Permalink
Browse files

small updates

  • Loading branch information...
1 parent d8ce195 commit cde98b728e66b183c3e08deebdc6ab50cf1d7a11 @flosse committed Dec 19, 2012
Showing with 22 additions and 17 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +7 −7 README.markdown
  4. +5 −3 lib/ServiceAdmin.coffee
  5. +5 −4 package.json
  6. +3 −3 spec/node-xmpp-serviceadmin.spec.coffee
View
@@ -0,0 +1 @@
+node_modules
View
@@ -1,2 +1,3 @@
lib/*.coffee
spec/*.coffee
+node_modules
View
@@ -15,14 +15,14 @@ With package manager [npm](http://npmjs.org/):
## Usage
```coffeescript
-xmpp = require "node-xmpp"
-sa = require "node-xmpp-serviceadmin"
+xmpp = require "node-xmpp"
+ServiceAdmin = require "node-xmpp-serviceadmin"
# define the host
service = "example.org"
# define the JID that has the admin privileges
-root = "root@mycomponent.example.org"
+root = "root@mycomponent.example.org"
# creat the xmpp connection
comp = new xmpp.Component
@@ -31,16 +31,16 @@ comp = new xmpp.Component
host : "127.0.0.1"
port : "8888"
-serviceAdmin = new sa.ServieAdmin root, comp, service
+sa = new ServieAdmin root, comp, service
# creating a new user
-serviceAdmin.addUser "jid@example.org", "secret", { name: "Der Weihnachtsmann" }, (err) ->
+sa.addUser "jid@example.org", "secret", { name: "Der Weihnachtsmann" }, (err) ->
# changing a user password
-serviceAdmin.changeUserPassword "jid@example.org", "newSecret", (err) ->
+sa.changeUserPassword "jid@example.org", "newSecret", (err) ->
# delete a user
-serviceAdmin.deleteUser "jid@example.org", (err) ->
+sa.deleteUser "jid@example.org", (err) ->
```
## Running tests
View
@@ -1,5 +1,7 @@
-# This program is distributed under the terms of the MIT license.
-# Copyright 2012 (c) Markus Kohlhase <mail@markus-kohlhase.de>
+###
+This program is distributed under the terms of the MIT license.
+Copyright 2012 (c) Markus Kohlhase <mail@markus-kohlhase.de>
+###
xmpp = require "node-xmpp"
ltx = require "ltx"
@@ -97,4 +99,4 @@ class ServiceAdmin
data[PASS] = pw
@runOneStageCmd "change-user-password", data, next
-exports.ServiceAdmin = ServiceAdmin
+module.exports = ServiceAdmin
View
@@ -1,6 +1,6 @@
{
"name": "node-xmpp-serviceadmin",
- "version": "0.1.0",
+ "version": "0.1.1",
"main": "./lib/ServiceAdmin",
"description": "Service Administration (XEP-0133) library for node-xmpp",
"author": "Markus Kohlhase",
@@ -12,13 +12,14 @@
"engine": "node",
"dependencies":
{
- "node-xmpp": ">=0.3.1",
- "ltx": ">= 0.1.2"
+ "node-xmpp": ">=0.3.1",
+ "node-stringprep": "*",
+ "ltx": ">= 0.1.2"
},
"devDependencies":
{
"jasmine-node": ">=1.0.21",
- "coffee-script": ">= 1.2.0"
+ "coffee-script": ">= 1.4.0"
},
"repositories":
[
@@ -1,5 +1,5 @@
-sa = require "../lib/ServiceAdmin"
-ltx = require "ltx"
+ServiceAdmin = require "../lib/ServiceAdmin"
+ltx = require "ltx"
describe "Service Admin", ->
@@ -21,7 +21,7 @@ describe "Service Admin", ->
# define the JID that has the admin privileges
root = "root@#{service}"
- serviceAdmin = new sa.ServiceAdmin root, xmppComp, service
+ serviceAdmin = new ServiceAdmin root, xmppComp, service
(expect typeof serviceAdmin).toEqual "object"
(expect serviceAdmin.jid).toEqual root
(expect serviceAdmin.service).toEqual service

0 comments on commit cde98b7

Please sign in to comment.