Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

willf's changes hadn't been compiled

  • Loading branch information...
commit c6808e68762ead7c5f637fb909447d9bce2a9210 1 parent b440630
@zeke zeke authored
Showing with 15 additions and 26 deletions.
  1. +0 −1  lib/swagger-spec.js
  2. +15 −25 lib/swagger.js
View
1  lib/swagger-spec.js
@@ -1,4 +1,3 @@
-// Generated by CoffeeScript 1.2.1-pre
(function() {
window.api_key = 'a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5';
View
40 lib/swagger.js
@@ -1,12 +1,9 @@
-// Generated by CoffeeScript 1.2.1-pre
(function() {
var SwaggerApi, SwaggerOperation, SwaggerRequest, SwaggerResource,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
SwaggerApi = (function() {
- SwaggerApi.name = 'SwaggerApi';
-
SwaggerApi.prototype.discoveryUrl = "http://api.wordnik.com/v4/resources.json";
SwaggerApi.prototype.debug = false;
@@ -62,18 +59,18 @@
};
SwaggerApi.prototype.help = function() {
- var operation, operation_name, parameter, resource, resource_name, _i, _len, _ref, _ref1, _ref2;
+ var operation, operation_name, parameter, resource, resource_name, _i, _len, _ref, _ref2, _ref3;
_ref = this.resources;
for (resource_name in _ref) {
resource = _ref[resource_name];
console.log(resource_name);
- _ref1 = resource.operations;
- for (operation_name in _ref1) {
- operation = _ref1[operation_name];
+ _ref2 = resource.operations;
+ for (operation_name in _ref2) {
+ operation = _ref2[operation_name];
console.log(" " + operation.nickname);
- _ref2 = operation.parameters;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- parameter = _ref2[_i];
+ _ref3 = operation.parameters;
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ parameter = _ref3[_i];
console.log(" " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
}
}
@@ -87,8 +84,6 @@
SwaggerResource = (function() {
- SwaggerResource.name = 'SwaggerResource';
-
function SwaggerResource(path, description, api) {
var parts,
_this = this;
@@ -101,7 +96,7 @@
parts = this.path.split("/");
this.name = parts[parts.length - 1].replace('.{format}', '');
$.getJSON(this.url, function(response) {
- var endpoint, o, op, _i, _j, _len, _len1, _ref, _ref1;
+ var endpoint, o, op, _i, _j, _len, _len2, _ref, _ref2;
_this.basePath = response.basePath;
_this.basePath = _this.basePath.replace(/\/$/, '');
if (response.apis) {
@@ -109,9 +104,9 @@
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
endpoint = _ref[_i];
if (endpoint.operations) {
- _ref1 = endpoint.operations;
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- o = _ref1[_j];
+ _ref2 = endpoint.operations;
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ o = _ref2[_j];
op = new SwaggerOperation(o.nickname, endpoint.path, o.httpMethod, o.parameters, o.summary, _this);
_this.operations[op.nickname] = op;
}
@@ -125,14 +120,14 @@
}
SwaggerResource.prototype.help = function() {
- var operation, operation_name, parameter, _i, _len, _ref, _ref1;
+ var operation, operation_name, parameter, _i, _len, _ref, _ref2;
_ref = this.operations;
for (operation_name in _ref) {
operation = _ref[operation_name];
console.log(" " + operation.nickname);
- _ref1 = operation.parameters;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- parameter = _ref1[_i];
+ _ref2 = operation.parameters;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ parameter = _ref2[_i];
console.log(" " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
}
}
@@ -145,8 +140,6 @@
SwaggerOperation = (function() {
- SwaggerOperation.name = 'SwaggerOperation';
-
function SwaggerOperation(nickname, path, httpMethod, parameters, summary, resource) {
var _this = this;
this.nickname = nickname;
@@ -156,7 +149,6 @@
this.summary = summary;
this.resource = resource;
this["do"] = __bind(this["do"], this);
-
if (this.nickname == null) throw "SwaggerOperations must have a nickname.";
if (this.path == null) {
throw "SwaggerOperation " + nickname + " is missing path.";
@@ -238,8 +230,6 @@
SwaggerRequest = (function() {
- SwaggerRequest.name = 'SwaggerRequest';
-
function SwaggerRequest(type, url, headers, body, callback, error, operation) {
var obj,
_this = this;
Please sign in to comment.
Something went wrong with that request. Please try again.