Permalink
Browse files

Upgraded to Mime 1.2.1

  • Loading branch information...
1 parent 7dc32aa commit 6b8916223686831baa2b7f7faa5599f81eb42a40 @assaf assaf committed Jan 31, 2011
Showing with 26 additions and 137 deletions.
  1. +1 −0 .gitignore
  2. +6 −48 package.json
  3. +1 −2 spec/helpers.coffee
  4. +0 −72 src/hellow.cc
  5. +16 −10 src/index.coffee
  6. +2 −5 src/zombie/browser.coffee
View
@@ -1,4 +1,5 @@
.npm
+build
clean
html
lib
View
@@ -1,28 +1,10 @@
-{
- "name": "zombie",
+{ "name": "zombie",
"version": "0.8.11",
"description": "Insanely fast, full-stack, headless browser testing using Node.js",
"homepage": "http://zombie.labnotes.org/",
"author": "Assaf Arkin <assaf@labnotes.org> (http://labnotes.org/)",
- "keywords": [
- "test",
- "tests",
- "testing",
- "TDD",
- "spec",
- "specs",
- "BDD",
- "headless",
- "browser",
- "html",
- "html5",
- "dom",
- "css",
- "javascript",
- "integration",
- "ajax",
- "full-stack"
- ],
+ "keywords": [ "test", "tests", "testing", "TDD", "spec", "specs", "BDD", "headless", "browser",
+ "html", "html5", "dom", "css", "javascript", "integration", "ajax", "full-stack" ],
"directories": {
"doc": "./doc",
"lib": "./lib",
@@ -40,6 +22,7 @@
"doc",
"lib",
"man7",
+ "index.js",
"package.json"
],
"scripts": {
@@ -50,18 +33,16 @@
"node": ">= 0.2 < 0.3"
},
"dependencies": {
- "base64": "1.0.1",
- "cssom": "0.2.0",
"html5": "0.2.12",
"jsdom": "0.1.23",
- "mime": "1.1.0"
+ "mime": "1.2.1"
},
"devDependencies": {
"coffee-script": ">= 1.0.0",
"docco": "0.3.0",
"express": "1.0.3",
"ronn": "0.3.5",
- "vows": "0.5.3"
+ "vows": "0.5.5"
},
"repository": {
"type": "git",
@@ -75,28 +56,5 @@
"type": "MIT",
"url": "http://github.com/assaf/zombie/raw/master/MIT-LICENSE"
}
- ],
- "modules": {
- "index.js": "lib/index.js",
- "zombie/bcat.js": "lib/zombie/bcat.js",
- "zombie/browser.js": "lib/zombie/browser.js",
- "zombie/cookies.js": "lib/zombie/cookies.js",
- "zombie/eventloop.js": "lib/zombie/eventloop.js",
- "zombie/forms.js": "lib/zombie/forms.js",
- "zombie/history.js": "lib/zombie/history.js",
- "zombie/jsdom_patches.js": "lib/zombie/jsdom_patches.js",
- "zombie/protocol.js": "lib/zombie/protocol.js",
- "zombie/storage.js": "lib/zombie/storage.js",
- "zombie/xhr.js": "lib/zombie/xhr.js",
- "zombie/xpath.js": "lib/zombie/xpath.js"
- },
- "man": [
- "man7/api.7",
- "man7/changelog.7",
- "man7/guts.7",
- "man7/selectors.7",
- "man7/todo.7",
- "man7/troubleshoot.7",
- "man7/zombie.7"
]
}
View
@@ -1,9 +1,8 @@
require.paths.unshift __dirname + "/../node_modules"
-require.paths.unshift __dirname + "/../src"
fs = require("fs")
decode = require("base64").decode
express = require("express")
-zombie = require("index")
+zombie = require("../src/index")
# When you run the vows command, it picks all the files in the spec directory
View
@@ -1,72 +0,0 @@
-/* This code is PUBLIC DOMAIN, and is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. See the accompanying
- * LICENSE file.
- */
-
-#include <v8.h>
-#include <node.h>
-
-using namespace node;
-using namespace v8;
-
-class HelloWorld: ObjectWrap
-{
-private:
- int m_count;
-public:
-
- static Persistent<FunctionTemplate> s_ct;
- static void Init(Handle<Object> target)
- {
- HandleScope scope;
-
- Local<FunctionTemplate> t = FunctionTemplate::New(New);
-
- s_ct = Persistent<FunctionTemplate>::New(t);
- s_ct->InstanceTemplate()->SetInternalFieldCount(1);
- s_ct->SetClassName(String::NewSymbol("HelloWorld"));
-
- NODE_SET_PROTOTYPE_METHOD(s_ct, "hello", Hello);
-
- target->Set(String::NewSymbol("HelloWorld"),
- s_ct->GetFunction());
- }
-
- HelloWorld() :
- m_count(0)
- {
- }
-
- ~HelloWorld()
- {
- }
-
- static Handle<Value> New(const Arguments& args)
- {
- HandleScope scope;
- HelloWorld* hw = new HelloWorld();
- hw->Wrap(args.This());
- return args.This();
- }
-
- static Handle<Value> Hello(const Arguments& args)
- {
- HandleScope scope;
- HelloWorld* hw = ObjectWrap::Unwrap<HelloWorld>(args.This());
- hw->m_count++;
- Local<String> result = String::New("Hello World");
- return scope.Close(result);
- }
-
-};
-
-Persistent<FunctionTemplate> HelloWorld::s_ct;
-
-extern "C" {
- static void init (Handle<Object> target)
- {
- HelloWorld::Init(target);
- }
-
- NODE_MODULE(helloworld, init);
-}
View
@@ -1,9 +1,10 @@
-browser = require("./zombie/browser")
+zombie = require("./zombie/browser")
# Constructor for a new Browser. Takes no arguments.
-exports.Browser = browser.Browser
-exports.package = browser.package
-exports.version = browser.version
+exports.Browser = zombie.Browser
+exports.package = zombie.package
+exports.version = zombie.version
+
# ### zombie.visit(url, callback)
# ### zombie.visit(url, options, callback)
@@ -26,10 +27,15 @@ exports.version = browser.version
# * options -- Initialize the browser with these options
# * callback -- Called with error, browser
exports.visit = (url, options, callback)->
- if typeof options is "function"
- [callback, options] = [options, null]
- browser = new exports.Browser(options)
- browser.visit url, callback
- return
+ new zombie.Browser(options).visit(url, options, callback)
+
-exports.listen = require("./zombie/protocol").listen
+# ### listen port, callback
+# ### listen socket, callback
+# ### listen callback
+#
+# Ask Zombie to listen on the specified port for requests. The default
+# port is 8091, or you can specify a socket name. The callback is
+# invoked once Zombie is ready to accept new connections.
+exports.listen = (port, callback)->
+ require("./zombie/protocol").listen(port, callback)
@@ -744,8 +744,5 @@ class Browser extends require("events").EventEmitter
exports.Browser = Browser
# ### zombie.version : String
-try
- exports.package = JSON.parse(require("fs").readFileSync(__dirname + "/../../package.json"))
- exports.version = exports.package.version
-catch err
- console.log err
+exports.package = JSON.parse(require("fs").readFileSync(__dirname + "/../../package.json"))
+exports.version = exports.package.version

0 comments on commit 6b89162

Please sign in to comment.