Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No se levanta el proceso en entorno de desarrollo

  • Loading branch information...
commit 2f7263de310e1b7ffcaab4dcd893978064cbdaf6 1 parent 0a44ae4
@matiasrege matiasrege authored
View
19 .classpath
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="newrelic/src"/>
+ <classpathentry kind="lib" path="newrelic/lib/commons-lang-2.6.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/commons-logging-1.0.3.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/guava-r05.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/newrelic.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/slf4j-api-1.6.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-core-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-filter-compression-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-integration-beans-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-integration-jmx-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-integration-ognl-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-integration-xbean-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-statemachine-2.0.4.jar"/>
+ <classpathentry kind="lib" path="newrelic/lib/mina-transport-apr-2.0.4.jar"/>
+ <classpathentry kind="output" path="newrelic/bin"/>
+</classpath>
View
17 .project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>newrelic-node</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
7 newrelic/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
View
92 node_modules/mocha/lib/reporters/markdown.js
@@ -0,0 +1,92 @@
+/**
+ * Module dependencies.
+ */
+
+var Base = require('./base')
+ , utils = require('../utils');
+
+/**
+ * Expose `Markdown`.
+ */
+
+exports = module.exports = Markdown;
+
+/**
+ * Initialize a new `Markdown` reporter.
+ *
+ * @param {Runner} runner
+ * @api public
+ */
+
+function Markdown(runner) {
+ Base.call(this, runner);
+
+ var self = this
+ , stats = this.stats
+ , total = runner.total
+ , level = 0
+ , buf = '';
+
+ function title(str) {
+ return Array(level).join('#') + ' ' + str;
+ }
+
+ function indent() {
+ return Array(level).join(' ');
+ }
+
+ function mapTOC(suite, obj) {
+ var ret = obj;
+ obj = obj[suite.title] = obj[suite.title] || { suite: suite };
+ suite.suites.forEach(function(suite){
+ mapTOC(suite, obj);
+ });
+ return ret;
+ }
+
+ function stringifyTOC(obj, level) {
+ ++level;
+ var buf = '';
+ var link;
+ for (var key in obj) {
+ if ('suite' == key) continue;
+ if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n';
+ if (key) buf += Array(level).join(' ') + link;
+ buf += stringifyTOC(obj[key], level);
+ }
+ --level;
+ return buf;
+ }
+
+ function generateTOC(suite) {
+ var obj = mapTOC(suite, {});
+ return stringifyTOC(obj, 0);
+ }
+
+ generateTOC(runner.suite);
+
+ runner.on('suite', function(suite){
+ ++level;
+ var slug = utils.slug(suite.fullTitle());
+ buf += '<a name="' + slug + '" />' + '\n';
+ buf += title(suite.title) + '\n';
+ });
+
+ runner.on('suite end', function(suite){
+ --level;
+ });
+
+ runner.on('pass', function(test){
+ var code = utils.clean(test.fn.toString());
+ buf += test.title + '.\n';
+ buf += '\n```js\n';
+ buf += code + '\n';
+ buf += '```\n\n';
+ });
+
+ runner.on('end', function(){
+ process.stdout.write('# TOC\n');
+ process.stdout.write(generateTOC(runner.suite));
+ process.stdout.write(buf);
+ });
+}
View
38 node_modules/mocha/lib/reporters/min.js
@@ -0,0 +1,38 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Base = require('./base');
+
+/**
+ * Expose `Min`.
+ */
+
+exports = module.exports = Min;
+
+/**
+ * Initialize a new `Min` minimal test reporter (best used with --watch).
+ *
+ * @param {Runner} runner
+ * @api public
+ */
+
+function Min(runner) {
+ Base.call(this, runner);
+
+ runner.on('start', function(){
+ // clear screen
+ process.stdout.write('\u001b[2J');
+ // set cursor position
+ process.stdout.write('\u001b[1;3H');
+ });
+
+ runner.on('end', this.epilogue.bind(this));
+}
+
+/**
+ * Inherit from `Base.prototype`.
+ */
+
+Min.prototype.__proto__ = Base.prototype;
View
259 node_modules/mocha/lib/reporters/nyan.js
@@ -0,0 +1,259 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Base = require('./base')
+ , color = Base.color;
+
+/**
+ * Expose `Dot`.
+ */
+
+exports = module.exports = NyanCat;
+
+/**
+ * Initialize a new `Dot` matrix test reporter.
+ *
+ * @param {Runner} runner
+ * @api public
+ */
+
+function NyanCat(runner) {
+ Base.call(this, runner);
+
+ var self = this
+ , stats = this.stats
+ , width = Base.window.width * .75 | 0
+ , rainbowColors = this.rainbowColors = self.generateColors()
+ , colorIndex = this.colorIndex = 0
+ , numerOfLines = this.numberOfLines = 4
+ , trajectories = this.trajectories = [[], [], [], []]
+ , nyanCatWidth = this.nyanCatWidth = 11
+ , trajectoryWidthMax = this.trajectoryWidthMax = (width - nyanCatWidth)
+ , scoreboardWidth = this.scoreboardWidth = 5
+ , tick = this.tick = 0
+ , n = 0;
+
+ runner.on('start', function(){
+ Base.cursor.hide();
+ self.draw('start');
+ });
+
+ runner.on('pending', function(test){
+ self.draw('pending');
+ });
+
+ runner.on('pass', function(test){
+ self.draw('pass');
+ });
+
+ runner.on('fail', function(test, err){
+ self.draw('fail');
+ });
+
+ runner.on('end', function(){
+ Base.cursor.show();
+ for (var i = 0; i < self.numberOfLines; i++) write('\n');
+ self.epilogue();
+ });
+}
+
+/**
+ * Draw the nyan cat with runner `status`.
+ *
+ * @param {String} status
+ * @api private
+ */
+
+NyanCat.prototype.draw = function(status){
+ this.appendRainbow();
+ this.drawScoreboard();
+ this.drawRainbow();
+ this.drawNyanCat(status);
+ this.tick = !this.tick;
+};
+
+/**
+ * Draw the "scoreboard" showing the number
+ * of passes, failures and pending tests.
+ *
+ * @api private
+ */
+
+NyanCat.prototype.drawScoreboard = function(){
+ var stats = this.stats;
+ var colors = Base.colors;
+
+ function draw(color, n) {
+ write(' ');
+ write('\u001b[' + color + 'm' + n + '\u001b[0m');
+ write('\n');
+ }
+
+ draw(colors.green, stats.passes);
+ draw(colors.fail, stats.failures);
+ draw(colors.pending, stats.pending);
+ write('\n');
+
+ this.cursorUp(this.numberOfLines);
+};
+
+/**
+ * Append the rainbow.
+ *
+ * @api private
+ */
+
+NyanCat.prototype.appendRainbow = function(){
+ var segment = this.tick ? '_' : '-';
+ var rainbowified = this.rainbowify(segment);
+
+ for (var index = 0; index < this.numberOfLines; index++) {
+ var trajectory = this.trajectories[index];
+ if (trajectory.length >= this.trajectoryWidthMax) trajectory.shift();
+ trajectory.push(rainbowified);
+ }
+};
+
+/**
+ * Draw the rainbow.
+ *
+ * @api private
+ */
+
+NyanCat.prototype.drawRainbow = function(){
+ var self = this;
+
+ this.trajectories.forEach(function(line, index) {
+ write('\u001b[' + self.scoreboardWidth + 'C');
+ write(line.join(''));
+ write('\n');
+ });
+
+ this.cursorUp(this.numberOfLines);
+};
+
+/**
+ * Draw the nyan cat with `status`.
+ *
+ * @param {String} status
+ * @api private
+ */
+
+NyanCat.prototype.drawNyanCat = function(status) {
+ var self = this;
+ var startWidth = this.scoreboardWidth + this.trajectories[0].length;
+
+ [0, 1, 2, 3].forEach(function(index) {
+ write('\u001b[' + startWidth + 'C');
+
+ switch (index) {
+ case 0:
+ write('_,------,');
+ write('\n');
+ break;
+ case 1:
+ var padding = self.tick ? ' ' : ' ';
+ write('_|' + padding + '/\\_/\\ ');
+ write('\n');
+ break;
+ case 2:
+ var padding = self.tick ? '_' : '__';
+ var tail = self.tick ? '~' : '^';
+ var face;
+ switch (status) {
+ case 'pass':
+ face = '( ^ .^)';
+ break;
+ case 'fail':
+ face = '( o .o)';
+ break;
+ default:
+ face = '( - .-)';
+ }
+ write(tail + '|' + padding + face + ' ');
+ write('\n');
+ break;
+ case 3:
+ var padding = self.tick ? ' ' : ' ';
+ write(padding + '"" "" ');
+ write('\n');
+ break;
+ }
+ });
+
+ this.cursorUp(this.numberOfLines);
+};
+
+/**
+ * Move cursor up `n`.
+ *
+ * @param {Number} n
+ * @api private
+ */
+
+NyanCat.prototype.cursorUp = function(n) {
+ write('\u001b[' + n + 'A');
+};
+
+/**
+ * Move cursor down `n`.
+ *
+ * @param {Number} n
+ * @api private
+ */
+
+NyanCat.prototype.cursorDown = function(n) {
+ write('\u001b[' + n + 'B');
+};
+
+/**
+ * Generate rainbow colors.
+ *
+ * @return {Array}
+ * @api private
+ */
+
+NyanCat.prototype.generateColors = function(){
+ var colors = [];
+
+ for (var i = 0; i < (6 * 7); i++) {
+ var pi3 = Math.floor(Math.PI / 3);
+ var n = (i * (1.0 / 6));
+ var r = Math.floor(3 * Math.sin(n) + 3);
+ var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3);
+ var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3);
+ colors.push(36 * r + 6 * g + b + 16);
+ }
+
+ return colors;
+};
+
+/**
+ * Apply rainbow to the given `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+NyanCat.prototype.rainbowify = function(str){
+ var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length];
+ this.colorIndex += 1;
+ return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m';
+};
+
+/**
+ * Stdout helper.
+ */
+
+function write(string) {
+ process.stdout.write(string);
+}
+
+/**
+ * Inherit from `Base.prototype`.
+ */
+
+NyanCat.prototype.__proto__ = Base.prototype;
View
23 node_modules/mocha/my-reporter.js
@@ -0,0 +1,23 @@
+
+exports = module.exports = MyReporter;
+
+function MyReporter(runner) {
+ var passes = 0;
+ var failures = 0;
+ var total = 0;
+
+ runner.on('pass', function(test){
+ passes++;
+ console.log('pass: %s', test.fullTitle());
+ });
+
+ runner.on('fail', function(test, err){
+ failures++;
+ console.log('fail: %s -- error: %s', test.fullTitle(), err.message);
+ });
+
+ runner.on('end', function(){
+ console.log('end: %d/%d', passes, passes + failures);
+ process.exit(failures);
+ });
+}
View
510 node_modules/mocha/node_modules/jade/jade.md
@@ -0,0 +1,510 @@
+
+# Jade
+
+ The jade template engine for node.js
+
+## Synopsis
+
+ jade [-h|--help] [-v|--version] [-o|--obj STR]
+ [-O|--out DIR] [-p|--path PATH] [-P|--pretty]
+ [-c|--client] [-D|--no-debug]
+
+## Examples
+
+ translate jade the templates dir
+
+ $ jade templates
+
+ create {foo,bar}.html
+
+ $ jade {foo,bar}.jade
+
+ jade over stdio
+
+ $ jade < my.jade > my.html
+
+ jade over s
+
+ $ echo "h1 Jade!" | jade
+
+ foo, bar dirs rendering to /tmp
+
+ $ jade foo bar --out /tmp
+
+ compile client-side templates without debugging
+ instrumentation, making the output javascript
+ very light-weight. This requires runtime.js
+ in your projects.
+
+ $ jade --client --no-debug < my.jade
+
+## Tags
+
+ Tags are simply nested via whitespace, closing
+ tags defined for you. These indents are called "blocks".
+
+ ul
+ li
+ a Foo
+ li
+ a Bar
+
+ You may have several tags in one "block":
+
+ ul
+ li
+ a Foo
+ a Bar
+ a Baz
+
+## Self-closing Tags
+
+ Some tags are flagged as self-closing by default, such
+ as `meta`, `link`, and so on. To explicitly self-close
+ a tag simply append the `/` character:
+
+ foo/
+ foo(bar='baz')/
+
+ Would yield:
+
+ <foo/>
+ <foo bar="baz"/>
+
+## Attributes
+
+ Tag attributes look similar to HTML, however
+ the values are regular JavaScript, here are
+ some examples:
+
+ a(href='google.com') Google
+ a(class='button', href='google.com') Google
+
+ As mentioned the attribute values are just JavaScript,
+ this means ternary operations and other JavaScript expressions
+ work just fine:
+
+ body(class=user.authenticated ? 'authenticated' : 'anonymous')
+ a(href=user.website || 'http://google.com')
+
+ Multiple lines work too:
+
+ input(type='checkbox',
+ name='agreement',
+ checked)
+
+ Multiple lines without the comma work fine:
+
+ input(type='checkbox'
+ name='agreement'
+ checked)
+
+ Funky whitespace? fine:
+
+ input(
+ type='checkbox'
+ name='agreement'
+ checked)
+
+## Boolean attributes
+
+ Boolean attributes are mirrored by Jade, and accept
+ bools, aka _true_ or _false_. When no value is specified
+ _true_ is assumed. For example:
+
+ input(type="checkbox", checked)
+ // => "<input type="checkbox" checked="checked" />"
+
+ For example if the checkbox was for an agreement, perhaps `user.agreed`
+ was _true_ the following would also output 'checked="checked"':
+
+ input(type="checkbox", checked=user.agreed)
+
+## Class attributes
+
+ The _class_ attribute accepts an array of classes,
+ this can be handy when generated from a javascript
+ function etc:
+
+ classes = ['foo', 'bar', 'baz']
+ a(class=classes)
+ // => "<a class="foo bar baz"></a>"
+
+## Class literal
+
+ Classes may be defined using a ".CLASSNAME" syntax:
+
+ .button
+ // => "<div class="button"></div>"
+
+ Or chained:
+
+ .large.button
+ // => "<div class="large button"></div>"
+
+ The previous defaulted to divs, however you
+ may also specify the tag type:
+
+ h1.title My Title
+ // => "<h1 class="title">My Title</h1>"
+
+## Id literal
+
+ Much like the class literal there's an id literal:
+
+ #user-1
+ // => "<div id="user-1"></div>"
+
+ Again we may specify the tag as well:
+
+ ul#menu
+ li: a(href='/home') Home
+ li: a(href='/store') Store
+ li: a(href='/contact') Contact
+
+ Finally all of these may be used in any combination,
+ the following are all valid tags:
+
+ a.button#contact(style: 'color: red') Contact
+ a.button(style: 'color: red')#contact Contact
+ a(style: 'color: red').button#contact Contact
+
+## Block expansion
+
+ Jade supports the concept of "block expansion", in which
+ using a trailing ":" after a tag will inject a block:
+
+ ul
+ li: a Foo
+ li: a Bar
+ li: a Baz
+
+## Text
+
+ Arbitrary text may follow tags:
+
+ p Welcome to my site
+
+ yields:
+
+ <p>Welcome to my site</p>
+
+## Pipe text
+
+ Another form of text is "pipe" text. Pipes act
+ as the text margin for large bodies of text.
+
+ p
+ | This is a large
+ | body of text for
+ | this tag.
+ |
+ | Nothing too
+ | exciting.
+
+ yields:
+
+ <p>This is a large
+ body of text for
+ this tag.
+
+ Nothing too
+ exciting.
+ </p>
+
+ Using pipes we can also specify regular Jade tags
+ within the text:
+
+ p
+ | Click to visit
+ a(href='http://google.com') Google
+ | if you want.
+
+## Text only tags
+
+ As an alternative to pipe text you may add
+ a trailing "." to indicate that the block
+ contains nothing but plain-text, no tags:
+
+ p.
+ This is a large
+ body of text for
+ this tag.
+
+ Nothing too
+ exciting.
+
+ Some tags are text-only by default, for example
+ _script_, _textarea_, and _style_ tags do not
+ contain nested HTML so Jade implies the trailing ".":
+
+ script
+ if (foo) {
+ bar();
+ }
+
+ style
+ body {
+ padding: 50px;
+ font: 14px Helvetica;
+ }
+
+## Template script tags
+
+ Sometimes it's useful to define HTML in script
+ tags using Jade, typically for client-side templates.
+
+ To do this simply give the _script_ tag an arbitrary
+ _type_ attribute such as _text/x-template_:
+
+ script(type='text/template')
+ h1 Look!
+ p Jade still works in here!
+
+## Interpolation
+
+ Both plain-text and piped-text support interpolation,
+ which comes in two forms, escapes and non-escaped. The
+ following will output the _user.name_ in the paragraph
+ but HTML within it will be escaped to prevent XSS attacks:
+
+ p Welcome #{user.name}
+
+ The following syntax is identical however it will _not_ escape
+ HTML, and should only be used with strings that you trust:
+
+ p Welcome !{user.name}
+
+## Inline HTML
+
+ Sometimes constructing small inline snippets of HTML
+ in Jade can be annoying, luckily we can add plain
+ HTML as well:
+
+ p Welcome <em>#{user.name}</em>
+
+## Code
+
+ To buffer output with Jade simply use _=_ at the beginning
+ of a line or after a tag. This method escapes any HTML
+ present in the string.
+
+ p= user.description
+
+ To buffer output unescaped use the _!=_ variant, but again
+ be careful of XSS.
+
+ p!= user.description
+
+ The final way to mess with JavaScript code in Jade is the unbuffered
+ _-_, which can be used for conditionals, defining variables etc:
+
+ - var user = { description: 'foo bar baz' }
+ #user
+ - if (user.description) {
+ h2 Description
+ p.description= user.description
+ - }
+
+ When compiled blocks are wrapped in anonymous functions, so the
+ following is also valid, without braces:
+
+ - var user = { description: 'foo bar baz' }
+ #user
+ - if (user.description)
+ h2 Description
+ p.description= user.description
+
+ If you really want you could even use `.forEach()` and others:
+
+ - users.forEach(function(user){
+ .user
+ h2= user.name
+ p User #{user.name} is #{user.age} years old
+ - })
+
+ Taking this further Jade provides some syntax for conditionals,
+ iteration, switch statements etc. Let's look at those next!
+
+## Assignment
+
+ Jade's first-class assignment is simple, simply use the _=_
+ operator and Jade will _var_ it for you. The following are equivalent:
+
+ - var user = { name: 'tobi' }
+ user = { name: 'tobi' }
+
+## Conditionals
+
+ Jade's first-class conditional syntax allows for optional
+ parenthesis, and you may now omit the leading _-_ otherwise
+ it's identical, still just regular javascript:
+
+ user = { description: 'foo bar baz' }
+ #user
+ if user.description
+ h2 Description
+ p.description= user.description
+
+ Jade provides the negated version, _unless_ as well, the following
+ are equivalent:
+
+ - if (!(user.isAnonymous))
+ p You're logged in as #{user.name}
+
+ unless user.isAnonymous
+ p You're logged in as #{user.name}
+
+## Iteration
+
+ JavaScript's _for_ loops don't look very declarative, so Jade
+ also provides its own _for_ loop construct, aliased as _each_:
+
+ for user in users
+ .user
+ h2= user.name
+ p user #{user.name} is #{user.age} year old
+
+ As mentioned _each_ is identical:
+
+ each user in users
+ .user
+ h2= user.name
+
+ If necessary the index is available as well:
+
+ for user, i in users
+ .user(class='user-#{i}')
+ h2= user.name
+
+ Remember, it's just JavaScript:
+
+ ul#letters
+ for letter in ['a', 'b', 'c']
+ li= letter
+
+## Mixins
+
+ Mixins provide a way to define jade "functions" which "mix in"
+ their contents when called. This is useful for abstracting
+ out large fragments of Jade.
+
+ The simplest possible mixin which accepts no arguments might
+ look like this:
+
+ mixin hello
+ p Hello
+
+ You use a mixin by placing `+` before the name:
+
+ +hello
+
+ For something a little more dynamic, mixins can take
+ arguments, the mixin itself is converted to a javascript
+ function internally:
+
+ mixin hello(user)
+ p Hello #{user}
+
+ +hello('Tobi')
+
+ Yields:
+
+ <p>Hello Tobi</p>
+
+ Mixins may optionally take blocks, when a block is passed
+ its contents becomes the implicit `block` argument. For
+ example here is a mixin passed a block, and also invoked
+ without passing a block:
+
+ mixin article(title)
+ .article
+ .article-wrapper
+ h1= title
+ if block
+ block
+ else
+ p No content provided
+
+ +article('Hello world')
+
+ +article('Hello world')
+ p This is my
+ p Amazing article
+
+ yields:
+
+ <div class="article">
+ <div class="article-wrapper">
+ <h1>Hello world</h1>
+ <p>No content provided</p>
+ </div>
+ </div>
+
+ <div class="article">
+ <div class="article-wrapper">
+ <h1>Hello world</h1>
+ <p>This is my</p>
+ <p>Amazing article</p>
+ </div>
+ </div>
+
+ Mixins can even take attributes, just like a tag. When
+ attributes are passed they become the implicit `attributes`
+ argument. Individual attributes can be accessed just like
+ normal object properties:
+
+ mixin centered
+ .centered(class=attributes.class)
+ block
+
+ +centered.bold Hello world
+
+ +centered.red
+ p This is my
+ p Amazing article
+
+ yields:
+
+ <div class="centered bold">Hello world</div>
+ <div class="centered red">
+ <p>This is my</p>
+ <p>Amazing article</p>
+ </div>
+
+ If you use `attributes` directly, *all* passed attributes
+ get used:
+
+ mixin link
+ a.menu(attributes)
+ block
+
+ +link.highlight(href='#top') Top
+ +link#sec1.plain(href='#section1') Section 1
+ +link#sec2.plain(href='#section2') Section 2
+
+ yields:
+
+ <a href="#top" class="highlight menu">Top</a>
+ <a id="sec1" href="#section1" class="plain menu">Section 1</a>
+ <a id="sec2" href="#section2" class="plain menu">Section 2</a>
+
+ If you pass arguments, they must directly follow the mixin:
+
+ mixin list(arr)
+ if block
+ .title
+ block
+ ul(attributes)
+ each item in arr
+ li= item
+
+ +list(['foo', 'bar', 'baz'])(id='myList', class='bold')
+
+ yields:
+
+ <ul id="myList" class="bold">
+ <li>foo</li>
+ <li>bar</li>
+ <li>baz</li>
+ </ul>
View
77 node_modules/mocha/node_modules/jade/lib/nodes/attrs.js
@@ -0,0 +1,77 @@
+
+/*!
+ * Jade - nodes - Attrs
+ * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node'),
+ Block = require('./block');
+
+/**
+ * Initialize a `Attrs` node.
+ *
+ * @api public
+ */
+
+var Attrs = module.exports = function Attrs() {
+ this.attrs = [];
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Attrs.prototype.__proto__ = Node.prototype;
+
+/**
+ * Set attribute `name` to `val`, keep in mind these become
+ * part of a raw js object literal, so to quote a value you must
+ * '"quote me"', otherwise or example 'user.name' is literal JavaScript.
+ *
+ * @param {String} name
+ * @param {String} val
+ * @param {Boolean} escaped
+ * @return {Tag} for chaining
+ * @api public
+ */
+
+Attrs.prototype.setAttribute = function(name, val, escaped){
+ this.attrs.push({ name: name, val: val, escaped: escaped });
+ return this;
+};
+
+/**
+ * Remove attribute `name` when present.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+Attrs.prototype.removeAttribute = function(name){
+ for (var i = 0, len = this.attrs.length; i < len; ++i) {
+ if (this.attrs[i] && this.attrs[i].name == name) {
+ delete this.attrs[i];
+ }
+ }
+};
+
+/**
+ * Get attribute value by `name`.
+ *
+ * @param {String} name
+ * @return {String}
+ * @api public
+ */
+
+Attrs.prototype.getAttribute = function(name){
+ for (var i = 0, len = this.attrs.length; i < len; ++i) {
+ if (this.attrs[i] && this.attrs[i].name == name) {
+ return this.attrs[i].val;
+ }
+ }
+};
View
7 node_modules/mocha/node_modules/jade/test.jade
@@ -0,0 +1,7 @@
+p.
+ This is a large
+ body of text for
+ this tag.
+
+ Nothing too
+ exciting.
View
5 node_modules/mocha/node_modules/jade/testing/head.jade
@@ -0,0 +1,5 @@
+head
+ script(src='/jquery.js')
+ yield
+ if false
+ script(src='/jquery.ui.js')
View
22 node_modules/mocha/node_modules/jade/testing/index.jade
@@ -0,0 +1,22 @@
+
+tag = 'p'
+foo = 'bar'
+
+#{tag} value
+#{tag}(foo='bar') value
+#{foo ? 'a' : 'li'}(something) here
+
+mixin item(icon)
+ li
+ if attributes.href
+ a(attributes)
+ img.icon(src=icon)
+ block
+ else
+ span(attributes)
+ img.icon(src=icon)
+ block
+
+ul
+ +item('contact') Contact
+ +item(href='/contact') Contact
View
11 node_modules/mocha/node_modules/jade/testing/index.js
@@ -0,0 +1,11 @@
+
+/**
+ * Module dependencies.
+ */
+
+var jade = require('../');
+
+jade.renderFile('testing/index.jade', { pretty: true, debug: true, compileDebug: false }, function(err, str){
+ if (err) throw err;
+ console.log(str);
+});
View
6 node_modules/mocha/node_modules/jade/testing/layout.jade
@@ -0,0 +1,6 @@
+html
+ include head
+ script(src='/caustic.js')
+ script(src='/app.js')
+ body
+ block content
View
7 node_modules/mocha/node_modules/jade/testing/user.jade
@@ -0,0 +1,7 @@
+h1 Tobi
+p Is a ferret
+
+ul
+ li: a foo
+ li: a bar
+ li: a baz
View
27 node_modules/mocha/node_modules/jade/testing/user.js
@@ -0,0 +1,27 @@
+function anonymous(locals, attrs, escape, rethrow) {
+var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;
+var __jade = [{ lineno: 1, filename: "testing/user.jade" }];
+try {
+var buf = [];
+with (locals || {}) {
+var interp;
+__jade.unshift({ lineno: 1, filename: __jade[0].filename });
+__jade.unshift({ lineno: 1, filename: __jade[0].filename });
+buf.push('<h1>Tobi');
+__jade.unshift({ lineno: undefined, filename: __jade[0].filename });
+__jade.shift();
+buf.push('</h1>');
+__jade.shift();
+__jade.unshift({ lineno: 2, filename: __jade[0].filename });
+buf.push('<p>Is a ferret');
+__jade.unshift({ lineno: undefined, filename: __jade[0].filename });
+__jade.shift();
+buf.push('</p>');
+__jade.shift();
+__jade.shift();
+}
+return buf.join("");
+} catch (err) {
+ rethrow(err, __jade[0].filename, __jade[0].lineno);
+}
+}
View
8 node_modules/mocha/test.js
@@ -0,0 +1,8 @@
+
+describe('foo', function(){
+ it('should bar', function(){
+ var obj = { name: 'tobi', age: 2, species: 'ferret', friends: [] };
+ var other = { name: 'tobi', age: 3, species: 'ferret', friends: ['loki', 'jane'] };
+ obj.should.eql(other);
+ })
+})
Please sign in to comment.
Something went wrong with that request. Please try again.