id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('when using a crazy scheme to get meshblu credentials forwarded', function() {
beforeEach(function() {
this.request.yields(null, {
statusCode: 200
}, 'nothing wrong');
this.hook = {
url: 'http://facebook.com',
generateAndFor... | describe 'when using a crazy scheme to get meshblu credentials forwarded', ->
beforeEach ->
@request.yields null, statusCode: 200, 'nothing wrong'
@hook = url: 'http://facebook.com', generateAndForwardMeshbluCredentials: true
@deviceRecord = uuid: 'test'
@sut = new Messag... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/test/lib/MessageWebhook-spec.coffee | 84 | 125 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:3:completion | completion | describe 'when using a crazy scheme to get meshblu credentials forwarded', ->
beforeEach ->
@request.yields null, statusCode: 200, 'nothing wrong'
@hook = url: 'http://facebook.com', generateAndForwardMeshbluCredentials: true
@deviceRecord = uuid: 'test'
@sut = new Messag... | @sut.send czar: 'foo', (@error) =>
it 'should get not error', ->
expect(@error).not.to.exist
it 'should call generateAndForwardMeshbluCredentials', ->
expect(@sut.generateAndForwardMeshbluCredentials).to.have.been.called
it 'should not override my auth', ->
expec... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/test/lib/MessageWebhook-spec.coffee | 84 | 125 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:raw_corpus | raw_corpus | it 'should get not error', ->
expect(@error).not.to.exist
it 'should yield a token', ->
expect(@token).to.deep.equal 'gobbledegook'
describe '->removeToken', ->
describe 'when using a crazy scheme to get meshblu credentials forwarded', ->
beforeEach ->
@hook = url: 'http://fa... | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/test/lib/MessageWebhook-spec.coffee | 127 | 146 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should get not error', ->
expect(@error).not.to.exist
it 'should yield a token', ->
expect(@token).to.deep.equal 'gobbledegook'
describe '->removeToken', ->
describe 'when using a crazy scheme to get meshblu credentials forwarded... | it('should get not error', function() {
return expect(this.error).not.to.exist;
});
it('should yield a token', function() {
return expect(this.token).to.deep.equal('gobbledegook');
});
describe('->removeToken', function() {
return describe('when using a crazy scheme to get meshblu credentials forwarded', functi... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/test/lib/MessageWebhook-spec.coffee | 127 | 146 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should get not error', function() {
return expect(this.error).not.to.exist;
});
it('should yield a token', function() {
return expect(this.token).to.deep.equal('gobbledegook');
});
describe('->removeToken', function() {
return describe('when using a cra... | it 'should get not error', ->
expect(@error).not.to.exist
it 'should yield a token', ->
expect(@token).to.deep.equal 'gobbledegook'
describe '->removeToken', ->
describe 'when using a crazy scheme to get meshblu credentials forwarded', ->
beforeEach ->
@hook = url: 'http://fa... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/test/lib/MessageWebhook-spec.coffee | 127 | 146 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:completion | completion | it 'should get not error', ->
expect(@error).not.to.exist
it 'should yield a token', ->
expect(@token).to.deep.equal 'gobbledegook'
describe '->removeToken', ->
describe 'when using a crazy scheme to get meshblu credentials forwarded', ->
beforeEach ->
@hook = url: 'http://fa... | @deviceRecord = uuid: 'test'
@sut = new MessageWebhook @deviceRecord.uuid, @hook, @dependencies
@revokeToken.yields null
@sut.removeToken 'test', (@error) =>
it 'should get not error', ->
expect(@error).not.to.exist
it 'should call revokeToken', ->
expect(@device.re... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/test/lib/MessageWebhook-spec.coffee | 127 | 146 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:raw_corpus | raw_corpus | MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@device = {}
@request = sinon.stub()
@generateAndStoreToken = sinon.stub()
@revokeToken = sinon.stub()
@dependencies = request: @request, generateAndStoreToken: @generateAndStoreToken, revokeToken: @re... | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 1 | 42 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@device = {}
@request = sinon.stub()
@generateAndStoreToken = sinon.stub()
@revokeToken = sinon.stub()
@dependencies = request: @request, genera... | var MessageWebhook;
MessageWebhook = require('../../lib/MessageWebhook');
describe('MessageWebhook', function() {
beforeEach(function() {
this.device = {};
this.request = sinon.stub();
this.generateAndStoreToken = sinon.stub();
this.revokeToken = sinon.stub();
return this.dependencies = {
... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 1 | 42 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageWebhook;
MessageWebhook = require('../../lib/MessageWebhook');
describe('MessageWebhook', function() {
beforeEach(function() {
this.device = {};
this.request = sinon.stub();
this.generateAndStoreToken = sinon.stub();
this.revokeToken ... | MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@device = {}
@request = sinon.stub()
@generateAndStoreToken = sinon.stub()
@revokeToken = sinon.stub()
@dependencies = request: @request, generateAndStoreToken: @generateAndStoreToken, revokeToken: @re... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 1 | 42 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:completion | completion | MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@device = {}
@request = sinon.stub()
@generateAndStoreToken = sinon.stub()
@revokeToken = sinon.stub()
@dependencies = request: @request, generateAndStoreToken: @generateAndStoreToken, revokeToken: @re... | it 'should get error', ->
expect(@error).to.exist
describe 'when request do not fails, but returns error that shouldnt happen', ->
beforeEach ->
@request.yields null, {statusCode: 103}, 'dont PUT that there'
@sut = new MessageWebhook @device, url: 'http://google.com', @depen... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 1 | 42 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:2:raw_corpus | raw_corpus | it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@error).to.exist
expect(@error.message).to.deep.equal 'HTTP Status: 429'
describe 'when request do fails ... | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 44 | 87 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@error).to.exist
expect(@error.message).to.deep.equal '... | it('should call request with whatever I want', function() {
return expect(this.request).to.have.been.calledWith({
url: 'http://google.com',
json: {
foo: 'bar'
}
});
});
it('should get error', function() {
expect(this.error).to.exist;
return expect(this.error.message).to.deep.equal('HTTP Statu... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 44 | 87 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should call request with whatever I want', function() {
return expect(this.request).to.have.been.calledWith({
url: 'http://google.com',
json: {
foo: 'bar'
}
});
});
it('should get error', function() {
expect(this.error).to.exist;
retu... | it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@error).to.exist
expect(@error.message).to.deep.equal 'HTTP Status: 429'
describe 'when request do fails ... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 44 | 87 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:2:completion | completion | it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@error).to.exist
expect(@error.message).to.deep.equal 'HTTP Status: 429'
describe 'when request do fails ... | @request.yields null, statusCode: 200, 'nothing wrong'
@hook = url: 'http://facebook.com'
@sut = new MessageWebhook @device, @hook, @dependencies
@sut.send czar: 'foo', (@error) =>
it 'should get not error', ->
expect(@error).not.to.exist
it 'should call request... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 44 | 87 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:3:raw_corpus | raw_corpus | it 'should get not error', ->
expect(@error).not.to.exist
it 'should call request and add my auth', ->
expect(@request).to.have.been.calledWith url: 'http://facebook.com', json: {czar: 'foo'}, auth: {bearer: 'dGVzdDpnb2JibGVkZWdvb2s='}
describe 'when using a crazy scheme to get meshb... | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 89 | 135 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should get not error', ->
expect(@error).not.to.exist
it 'should call request and add my auth', ->
expect(@request).to.have.been.calledWith url: 'http://facebook.com', json: {czar: 'foo'}, auth: {bearer: 'dGVzdDpnb2JibGVkZWdvb2s='... | it('should get not error', function() {
return expect(this.error).not.to.exist;
});
it('should call request and add my auth', function() {
return expect(this.request).to.have.been.calledWith({
url: 'http://facebook.com',
json: {
czar: 'foo'
},
auth: {
bearer: 'dGVzdDpnb2JibGVkZWdvb2s='
... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 89 | 135 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should get not error', function() {
return expect(this.error).not.to.exist;
});
it('should call request and add my auth', function() {
return expect(this.request).to.have.been.calledWith({
url: 'http://facebook.com',
json: {
czar: 'foo'
}... | it 'should get not error', ->
expect(@error).not.to.exist
it 'should call request and add my auth', ->
expect(@request).to.have.been.calledWith url: 'http://facebook.com', json: {czar: 'foo'}, auth: {bearer: 'dGVzdDpnb2JibGVkZWdvb2s='}
describe 'when using a crazy scheme to get meshb... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 89 | 135 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:3:completion | completion | it 'should get not error', ->
expect(@error).not.to.exist
it 'should call request and add my auth', ->
expect(@request).to.have.been.calledWith url: 'http://facebook.com', json: {czar: 'foo'}, auth: {bearer: 'dGVzdDpnb2JibGVkZWdvb2s='}
describe 'when using a crazy scheme to get meshb... | describe '->generateAndForwardMeshbluCredentials', ->
describe 'when using a crazy scheme to get meshblu credentials forwarded', ->
beforeEach ->
@request.yields null, statusCode: 200, 'nothing wrong'
@hook = url: 'http://facebook.com', generateAndForwardMeshbluCredentials: true
@devic... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 89 | 135 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:raw_corpus | raw_corpus | it 'should get not error', ->
expect(@error).not.to.exist
it 'should call revokeToken', ->
expect(@revokeToken).to.have.been.calledWith @device, @device.uuid, 'test' | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 137 | 141 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should get not error', ->
expect(@error).not.to.exist
it 'should call revokeToken', ->
expect(@revokeToken).to.have.been.calledWith @device, @device.uuid, 'test'
``` | it('should get not error', function() {
return expect(this.error).not.to.exist;
});
it('should call revokeToken', function() {
return expect(this.revokeToken).to.have.been.calledWith(this.device, this.device.uuid, 'test');
}); | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 137 | 141 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should get not error', function() {
return expect(this.error).not.to.exist;
});
it('should call revokeToken', function() {
return expect(this.revokeToken).to.have.been.calledWith(this.device, this.device.uuid, 'test');
});
``` | it 'should get not error', ->
expect(@error).not.to.exist
it 'should call revokeToken', ->
expect(@revokeToken).to.have.been.calledWith @device, @device.uuid, 'test' | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 137 | 141 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:4:completion | completion | it 'should get not error', ->
expect(@error).not.to.exist | it 'should call revokeToken', ->
expect(@revokeToken).to.have.been.calledWith @device, @device.uuid, 'test' | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/test/lib/MessageWebhook-spec.coffee | 137 | 141 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:raw_corpus | raw_corpus | MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@request = sinon.stub()
@dependencies = request: @request
describe '->send', ->
describe 'when instantiated with a url', ->
describe 'when request fails', ->
beforeEach ->
@request.y... | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/test/lib/MessageWebhook-spec.coffee | 1 | 50 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@request = sinon.stub()
@dependencies = request: @request
describe '->send', ->
describe 'when instantiated with a url', ->
describe 'when requ... | var MessageWebhook;
MessageWebhook = require('../../lib/MessageWebhook');
describe('MessageWebhook', function() {
beforeEach(function() {
this.request = sinon.stub();
return this.dependencies = {
request: this.request
};
});
return describe('->send', function() {
return describe('when inst... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/test/lib/MessageWebhook-spec.coffee | 1 | 50 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageWebhook;
MessageWebhook = require('../../lib/MessageWebhook');
describe('MessageWebhook', function() {
beforeEach(function() {
this.request = sinon.stub();
return this.dependencies = {
request: this.request
};
});
return describ... | MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@request = sinon.stub()
@dependencies = request: @request
describe '->send', ->
describe 'when instantiated with a url', ->
describe 'when request fails', ->
beforeEach ->
@request.y... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/test/lib/MessageWebhook-spec.coffee | 1 | 50 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:1:completion | completion | MessageWebhook = require '../../lib/MessageWebhook'
describe 'MessageWebhook', ->
beforeEach ->
@request = sinon.stub()
@dependencies = request: @request
describe '->send', ->
describe 'when instantiated with a url', ->
describe 'when request fails', ->
beforeEach ->
@request.y... | @sut.send foo: 'bar', (@error) =>
it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@error).to.exist
expect(@error.message).to.deep.equal 'HTTP Status: 1... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/test/lib/MessageWebhook-spec.coffee | 1 | 50 |
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:2:raw_corpus | raw_corpus | @sut = new MessageWebhook url: 'http://google.com', @dependencies
@sut.send foo: 'bar', (@error) =>
it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@er... | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/test/lib/MessageWebhook-spec.coffee | 51 | 75 | ||
octoblu/meshblu:test/lib/MessageWebhook-spec.coffee:2:completion | completion | @sut = new MessageWebhook url: 'http://google.com', @dependencies
@sut.send foo: 'bar', (@error) =>
it 'should call request with whatever I want', ->
expect(@request).to.have.been.calledWith url: 'http://google.com', json: {foo: 'bar'}
it 'should get error', ->
expect(@er... | @request.yields null, statusCode: 200, 'nothing wrong'
@hook = url: 'http://facebook.com'
@sut = new MessageWebhook @hook, @dependencies
@sut.send czar: 'foo', (@error) =>
it 'should get not error', ->
expect(@error).not.to.exist
it 'should call request with wha... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MessageWebhook-spec.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/test/lib/MessageWebhook-spec.coffee | 51 | 75 |
oozcitak/xmlbuilder-js:test/issues/122.coffee:1:raw_corpus | raw_corpus | suite 'Tests specific to issues:', ->
test 'Get node elements by name. Issue 122', ->
doc = xml('clients')
.ele('client').att('city', '').up()
.ele('client').att('city', 'CA').up()
.ele('client').att('city', 'FL').up()
.ele('client').up()
.doc()
nodes = xpath.select('//client',... | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/122.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/122.coffee | 1 | 18 | ||
oozcitak/xmlbuilder-js:test/issues/122.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Tests specific to issues:', ->
test 'Get node elements by name. Issue 122', ->
doc = xml('clients')
.ele('client').att('city', '').up()
.ele('client').att('city', 'CA').up()
.ele('client').att('city', 'FL').up()
.ele('client'... | suite('Tests specific to issues:', function() {
return test('Get node elements by name. Issue 122', function() {
var doc, nodes;
doc = xml('clients').ele('client').att('city', '').up().ele('client').att('city', 'CA').up().ele('client').att('city', 'FL').up().ele('client').up().doc();
nodes = xpath.select(... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/issues/122.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/122.coffee | 1 | 18 |
oozcitak/xmlbuilder-js:test/issues/122.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Tests specific to issues:', function() {
return test('Get node elements by name. Issue 122', function() {
var doc, nodes;
doc = xml('clients').ele('client').att('city', '').up().ele('client').att('city', 'CA').up().ele('client').att('city', 'FL').u... | suite 'Tests specific to issues:', ->
test 'Get node elements by name. Issue 122', ->
doc = xml('clients')
.ele('client').att('city', '').up()
.ele('client').att('city', 'CA').up()
.ele('client').att('city', 'FL').up()
.ele('client').up()
.doc()
nodes = xpath.select('//client',... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/122.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/122.coffee | 1 | 18 |
oozcitak/xmlbuilder-js:test/issues/122.coffee:1:completion | completion | suite 'Tests specific to issues:', ->
test 'Get node elements by name. Issue 122', ->
doc = xml('clients')
.ele('client').att('city', '').up()
.ele('client').att('city', 'CA').up()
.ele('client').att('city', 'FL').up()
.ele('client').up()
.doc() | nodes = xpath.select('//client', doc)
nodes.forEach (node) ->
node.att("city","NY")
eq(nodes[0].attributes.item(0).value, "NY")
eq(nodes[1].attributes.item(0).value, "NY")
eq(nodes[2].attributes.item(0).value, "NY")
eq(nodes[3].attributes.item(0).value, "NY") | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/122.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/122.coffee | 1 | 18 |
CaryLandholt/AngularFun:scripts/controllers/searchHistory.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['controllers/controllers', 'services/message'], (controllers) ->
'use strict'
controllers.controller 'searchHistory', ['$scope', 'message', ($scope, service) ->
$scope.searchHistory = []
service.subscribe 'search', (name, parameters) ->
$scope.searchHistory.push parameters
] | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/searchHistory.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/searchHistory.coffee | 1 | 11 | ||
CaryLandholt/AngularFun:scripts/controllers/searchHistory.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['controllers/controllers', 'services/message'], (controllers) ->
'use strict'
controllers.controller 'searchHistory', ['$scope', 'message', ($scope, service) ->
$scope.searchHistory = []
service.subscribe 'search', (name, para... | /*global define*/
define(['controllers/controllers', 'services/message'], function(controllers) {
'use strict';
return controllers.controller('searchHistory', [
'$scope',
'message',
function($scope,
service) {
$scope.searchHistory = [];
return service.subscribe('search',
function(nam... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/searchHistory.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/searchHistory.coffee | 1 | 11 |
CaryLandholt/AngularFun:scripts/controllers/searchHistory.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['controllers/controllers', 'services/message'], function(controllers) {
'use strict';
return controllers.controller('searchHistory', [
'$scope',
'message',
function($scope,
service) {
$scope.searchHistory = [];
... | ###global define###
define ['controllers/controllers', 'services/message'], (controllers) ->
'use strict'
controllers.controller 'searchHistory', ['$scope', 'message', ($scope, service) ->
$scope.searchHistory = []
service.subscribe 'search', (name, parameters) ->
$scope.searchHistory.push parameters
] | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/searchHistory.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/searchHistory.coffee | 1 | 11 |
CaryLandholt/AngularFun:scripts/controllers/searchHistory.coffee:1:completion | completion | ###global define###
define ['controllers/controllers', 'services/message'], (controllers) ->
'use strict' | controllers.controller 'searchHistory', ['$scope', 'message', ($scope, service) ->
$scope.searchHistory = []
service.subscribe 'search', (name, parameters) ->
$scope.searchHistory.push parameters
] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/searchHistory.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/searchHistory.coffee | 1 | 11 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0
export: ->
_.merge super(),
type: 'layer'
mask: @layer.mask.export()
text: @get('typeTool')?.export()
image: {} | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/nodes/layer.coffee | 1 | 14 | ||
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0
export: ->
_.merge super(),
type: 'layer'
mask: @layer.mask.export()
text: @get(... | var Layer, Node, _;
_ = require('lodash');
Node = require('../node.coffee');
module.exports = Layer = (function() {
class Layer extends Node {
isEmpty() {
return this.width === 0 || this.height === 0;
}
export() {
var ref;
return _.merge(super.export(), {
type: 'layer',
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/nodes/layer.coffee | 1 | 14 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Layer, Node, _;
_ = require('lodash');
Node = require('../node.coffee');
module.exports = Layer = (function() {
class Layer extends Node {
isEmpty() {
return this.width === 0 || this.height === 0;
}
export() {
var ref;
return... | _ = require 'lodash'
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0
export: ->
_.merge super(),
type: 'layer'
mask: @layer.mask.export()
text: @get('typeTool')?.export()
image: {} | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/nodes/layer.coffee | 1 | 14 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:completion | completion | _ = require 'lodash'
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0 | export: ->
_.merge super(),
type: 'layer'
mask: @layer.mask.export()
text: @get('typeTool')?.export()
image: {} | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/nodes/layer.coffee | 1 | 14 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0
export: ->
_.merge super,
type: 'layer'
mask: @layer.mask.export()
image: {} | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/nodes/layer.coffee | 1 | 13 | ||
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:completion | completion | _ = require 'lodash'
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer' | isEmpty: -> @width is 0 or @height is 0
export: ->
_.merge super,
type: 'layer'
mask: @layer.mask.export()
image: {} | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | f92d255ce85a63a336aedf83424ffa13f756cbec | 2,846 | https://github.com/meltingice/psd.js/blob/f92d255ce85a63a336aedf83424ffa13f756cbec/lib/psd/nodes/layer.coffee | 1 | 13 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:raw_corpus | raw_corpus | Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0 | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | aabb6de133eab9ae0a16981d0706fb83ce69fdba | 2,846 | https://github.com/meltingice/psd.js/blob/aabb6de133eab9ae0a16981d0706fb83ce69fdba/lib/psd/nodes/layer.coffee | 1 | 6 | ||
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0
``` | var Layer, Node;
Node = require('../node.coffee');
module.exports = Layer = (function() {
class Layer extends Node {
isEmpty() {
return this.width === 0 || this.height === 0;
}
};
Layer.prototype.type = 'layer';
return Layer;
}).call(this); | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | aabb6de133eab9ae0a16981d0706fb83ce69fdba | 2,846 | https://github.com/meltingice/psd.js/blob/aabb6de133eab9ae0a16981d0706fb83ce69fdba/lib/psd/nodes/layer.coffee | 1 | 6 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Layer, Node;
Node = require('../node.coffee');
module.exports = Layer = (function() {
class Layer extends Node {
isEmpty() {
return this.width === 0 || this.height === 0;
}
};
Layer.prototype.type = 'layer';
return Layer;
}).call(thi... | Node = require '../node.coffee'
module.exports = class Layer extends Node
type: 'layer'
isEmpty: -> @width is 0 or @height is 0 | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | aabb6de133eab9ae0a16981d0706fb83ce69fdba | 2,846 | https://github.com/meltingice/psd.js/blob/aabb6de133eab9ae0a16981d0706fb83ce69fdba/lib/psd/nodes/layer.coffee | 1 | 6 |
meltingice/psd.js:lib/psd/nodes/layer.coffee:1:completion | completion | Node = require '../node.coffee'
module.exports = class Layer extends Node | type: 'layer'
isEmpty: -> @width is 0 or @height is 0 | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/nodes/layer.coffee | MIT | aabb6de133eab9ae0a16981d0706fb83ce69fdba | 2,846 | https://github.com/meltingice/psd.js/blob/aabb6de133eab9ae0a16981d0706fb83ce69fdba/lib/psd/nodes/layer.coffee | 1 | 6 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_expressions.coffee:1:raw_corpus | raw_corpus | # Ensure that we don't wrap Nodes that are "pure_statement" in a closure.
items: [1, 2, 3, "bacon", 4, 5]
for item in items
break if item is "bacon"
findit: (items) ->
for item in items
return item if item is "bacon"
ok findit(items) is "bacon"
# When when a closure wrapper is generated for expression conv... | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_expressions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_expressions.coffee | 1 | 28 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_expressions.coffee:1:completion | completion | # Ensure that we don't wrap Nodes that are "pure_statement" in a closure.
items: [1, 2, 3, "bacon", 4, 5]
for item in items
break if item is "bacon"
findit: (items) ->
for item in items
return item if item is "bacon"
ok findit(items) is "bacon"
# When when a closure wrapper is generated for expression conv... | # that references to "this" within the wrapper are safely converted as well.
obj: {
num: 5
func: ->
this.result: if false
10
else
"a"
"b"
this.num
}
ok obj.num is obj.func()
ok obj.num is obj.result | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_expressions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_expressions.coffee | 1 | 28 |
octoblu/meshblu:lib/findCachedDevice.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return
cachedKey = redis.CACHE_KEY + uuid
debug 'checking redis cache', cached... | CoffeeScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | 61ea7665c022f8a8c2b6c90c769163e3471e237e | 815 | https://github.com/octoblu/meshblu/blob/61ea7665c022f8a8c2b6c90c769163e3471e237e/lib/findCachedDevice.coffee | 1 | 20 | ||
octoblu/meshblu:lib/findCachedDevice.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return
cachedKey = redis... | var _, config, debug, findCachedDevice, redis;
_ = require('lodash');
config = require('./../config');
redis = require('./redis');
debug = require('debug')('meshblu:findCachedDevice');
findCachedDevice = function(uuid, callback) {
var cachedKey;
if (!(config.redis && config.redis.host)) {
callback(null);
... | CoffeeScript | JavaScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | 61ea7665c022f8a8c2b6c90c769163e3471e237e | 815 | https://github.com/octoblu/meshblu/blob/61ea7665c022f8a8c2b6c90c769163e3471e237e/lib/findCachedDevice.coffee | 1 | 20 |
octoblu/meshblu:lib/findCachedDevice.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, config, debug, findCachedDevice, redis;
_ = require('lodash');
config = require('./../config');
redis = require('./redis');
debug = require('debug')('meshblu:findCachedDevice');
findCachedDevice = function(uuid, callback) {
var cachedKey;
if (!(conf... | _ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return
cachedKey = redis.CACHE_KEY + uuid
debug 'checking redis cache', cached... | JavaScript | CoffeeScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | 61ea7665c022f8a8c2b6c90c769163e3471e237e | 815 | https://github.com/octoblu/meshblu/blob/61ea7665c022f8a8c2b6c90c769163e3471e237e/lib/findCachedDevice.coffee | 1 | 20 |
octoblu/meshblu:lib/findCachedDevice.coffee:1:completion | completion | _ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return | cachedKey = redis.CACHE_KEY + uuid
debug 'checking redis cache', cachedKey
redis.get cachedKey, (error, data) ->
return callback null if error? # do not send the redis error forward
data = JSON.parse data if data
debug 'cache results', data?.uuid
callback null, data
module.exports = findCachedDevi... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | 61ea7665c022f8a8c2b6c90c769163e3471e237e | 815 | https://github.com/octoblu/meshblu/blob/61ea7665c022f8a8c2b6c90c769163e3471e237e/lib/findCachedDevice.coffee | 1 | 20 |
octoblu/meshblu:lib/findCachedDevice.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return
cachedKey = redis.CACHE_KEY + uuid
debug 'checking redis cache', cached... | CoffeeScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | c31608a2b2be0682b020d570f36f3d5021fcb5c7 | 815 | https://github.com/octoblu/meshblu/blob/c31608a2b2be0682b020d570f36f3d5021fcb5c7/lib/findCachedDevice.coffee | 1 | 20 | ||
octoblu/meshblu:lib/findCachedDevice.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return
cachedKey = redis... | var _, config, debug, findCachedDevice, redis;
_ = require('lodash');
config = require('./../config');
redis = require('./redis');
debug = require('debug')('meshblu:findCachedDevice');
findCachedDevice = function(uuid, callback) {
var cachedKey;
if (!(config.redis && config.redis.host)) {
callback(null);
... | CoffeeScript | JavaScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | c31608a2b2be0682b020d570f36f3d5021fcb5c7 | 815 | https://github.com/octoblu/meshblu/blob/c31608a2b2be0682b020d570f36f3d5021fcb5c7/lib/findCachedDevice.coffee | 1 | 20 |
octoblu/meshblu:lib/findCachedDevice.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, config, debug, findCachedDevice, redis;
_ = require('lodash');
config = require('./../config');
redis = require('./redis');
debug = require('debug')('meshblu:findCachedDevice');
findCachedDevice = function(uuid, callback) {
var cachedKey;
if (!(conf... | _ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return
cachedKey = redis.CACHE_KEY + uuid
debug 'checking redis cache', cached... | JavaScript | CoffeeScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | c31608a2b2be0682b020d570f36f3d5021fcb5c7 | 815 | https://github.com/octoblu/meshblu/blob/c31608a2b2be0682b020d570f36f3d5021fcb5c7/lib/findCachedDevice.coffee | 1 | 20 |
octoblu/meshblu:lib/findCachedDevice.coffee:1:completion | completion | _ = require 'lodash'
config = require './../config'
redis = require './redis'
debug = require('debug')('meshblu:findCachedDevice')
findCachedDevice = (uuid, callback) ->
unless config.redis && config.redis.host
callback null
return | cachedKey = redis.CACHE_KEY + uuid
debug 'checking redis cache', cachedKey
redis.get cachedKey, (error, data) ->
return callback error if error?
data = JSON.parse data if data
debug 'cache results', data?.uuid
callback null, data
module.exports = findCachedDevice | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/findCachedDevice.coffee | MIT | c31608a2b2be0682b020d570f36f3d5021fcb5c7 | 815 | https://github.com/octoblu/meshblu/blob/c31608a2b2be0682b020d570f36f3d5021fcb5c7/lib/findCachedDevice.coffee | 1 | 20 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | 1 | 33 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | 1 | 33 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | 1 | 33 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | cyclotronServices.factory 'cryptoService', ($http, $q, configService) ->
{
# Encrypt a string and return the encrypted form
encrypt: (value) ->
deferred = $q.defer()
q = $http.post(configService.restServiceUrl + '/crypto/encrypt', { value: value })
q.success (re... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/services/services.cryptoService.coffee | 1 | 33 |
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:raw_corpus | raw_corpus | eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@example.com", password: "bob", ->
Houston._call 'make... | CoffeeScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 29 | ||
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@ex... | var eventually, setup;
eventually = function(condition, cb) {
var poll;
return poll = setInterval(function() {
if (condition()) {
clearInterval(poll);
return cb();
}
}, 200);
};
setup = function(run_actual_test) {
return Meteor.call("test/clear_users", function(err) {
expect(err).toBeU... | CoffeeScript | JavaScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 29 |
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var eventually, setup;
eventually = function(condition, cb) {
var poll;
return poll = setInterval(function() {
if (condition()) {
clearInterval(poll);
return cb();
}
}, 200);
};
setup = function(run_actual_test) {
return Meteor.call("t... | eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@example.com", password: "bob", ->
Houston._call 'make... | JavaScript | CoffeeScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 29 |
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:completion | completion | eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@example.com", password: "bob", ->
Houston._call 'make... | describe "Custom Template", ->
it "should display a a menu link", ->
setup ->
Houston._go "home"
$menu_link = $('a:contains("MyTmplMenuText")')
expect($menu_link.length).toEqual(1)
expect($menu_link.attr('href')).toEqual("/admin/actions/MyTmpl")
it "should display content of the templat... | CoffeeScript | CoffeeScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 29 |
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:raw_corpus | raw_corpus | eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@example.com", password: "bob", ->
console.log("create... | CoffeeScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 71acf8e3ec0c42ce59c8110dd1581dc48af3a039 | 802 | https://github.com/gterrono/houston/blob/71acf8e3ec0c42ce59c8110dd1581dc48af3a039/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 30 | ||
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@ex... | var eventually, setup;
eventually = function(condition, cb) {
var poll;
return poll = setInterval(function() {
if (condition()) {
clearInterval(poll);
return cb();
}
}, 200);
};
setup = function(run_actual_test) {
return Meteor.call("test/clear_users", function(err) {
expect(err).toBeU... | CoffeeScript | JavaScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 71acf8e3ec0c42ce59c8110dd1581dc48af3a039 | 802 | https://github.com/gterrono/houston/blob/71acf8e3ec0c42ce59c8110dd1581dc48af3a039/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 30 |
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var eventually, setup;
eventually = function(condition, cb) {
var poll;
return poll = setInterval(function() {
if (condition()) {
clearInterval(poll);
return cb();
}
}, 200);
};
setup = function(run_actual_test) {
return Meteor.call("t... | eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@example.com", password: "bob", ->
console.log("create... | JavaScript | CoffeeScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 71acf8e3ec0c42ce59c8110dd1581dc48af3a039 | 802 | https://github.com/gterrono/houston/blob/71acf8e3ec0c42ce59c8110dd1581dc48af3a039/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 30 |
gterrono/houston:test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee:1:completion | completion | eventually = (condition, cb) ->
poll = setInterval(->
if condition()
clearInterval poll
cb()
, 200)
setup = (run_actual_test) ->
Meteor.call "test/clear_users", (err) ->
expect(err).toBeUndefined()
Accounts.createUser email: "you@example.com", password: "bob", ->
console.log("create... | describe "Custom Template", ->
it "should display a a menu link", ->
setup ->
Houston._go "home"
$menu_link = $('a:contains("MyTmplMenuText")')
expect($menu_link.length).toEqual(1)
expect($menu_link.attr('href')).toEqual("/admin/custom/MyTmpl")
it "should display content of the template... | CoffeeScript | CoffeeScript | gterrono/houston | test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | MIT | 71acf8e3ec0c42ce59c8110dd1581dc48af3a039 | 802 | https://github.com/gterrono/houston/blob/71acf8e3ec0c42ce59c8110dd1581dc48af3a039/test/test_app/tests/jasmine/client/integration/CustomTemplate.coffee | 1 | 30 |
oozcitak/xmlbuilder-js:test/basic/import.coffee:1:raw_corpus | raw_corpus | suite 'Edit:', ->
test 'Import', ->
test13imported = xml('test13imported', { headless: true })
.ele('node', 'imported')
eq(
xml('test13', { headless: true })
.importDocument(test13imported.doc())
.end()
'<test13><test13imported><node>imported</node></test13imported></test13>... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/import.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/import.coffee | 1 | 29 | ||
oozcitak/xmlbuilder-js:test/basic/import.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Edit:', ->
test 'Import', ->
test13imported = xml('test13imported', { headless: true })
.ele('node', 'imported')
eq(
xml('test13', { headless: true })
.importDocument(test13imported.doc())
.end()
'<test13><test1... | suite('Edit:', function() {
test('Import', function() {
var test13imported;
test13imported = xml('test13imported', {
headless: true
}).ele('node', 'imported');
eq(xml('test13', {
headless: true
}).importDocument(test13imported.doc()).end(), '<test13><test13imported><node>imported</node... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/import.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/import.coffee | 1 | 29 |
oozcitak/xmlbuilder-js:test/basic/import.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Edit:', function() {
test('Import', function() {
var test13imported;
test13imported = xml('test13imported', {
headless: true
}).ele('node', 'imported');
eq(xml('test13', {
headless: true
}).importDocument(test13imported.doc(... | suite 'Edit:', ->
test 'Import', ->
test13imported = xml('test13imported', { headless: true })
.ele('node', 'imported')
eq(
xml('test13', { headless: true })
.importDocument(test13imported.doc())
.end()
'<test13><test13imported><node>imported</node></test13imported></test13>... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/import.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/import.coffee | 1 | 29 |
oozcitak/xmlbuilder-js:test/basic/import.coffee:1:completion | completion | suite 'Edit:', ->
test 'Import', ->
test13imported = xml('test13imported', { headless: true })
.ele('node', 'imported')
eq(
xml('test13', { headless: true })
.importDocument(test13imported.doc())
.end()
'<test13><test13imported><node>imported</node></test13imported></test13>... | .importXMLBuilder(test13imported.doc())
.end()
'<test13><test13imported><node>imported</node></test13imported></test13>'
)
test 'Import in to empty document', ->
importedDoc = xml('imported', { headless: true })
.ele('node', 'imported node')
eq(
doc({ headless: true })
... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/import.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/import.coffee | 1 | 29 |
oozcitak/xmlbuilder-js:test/basic/headless.coffee:1:raw_corpus | raw_corpus | suite 'Creating XML', ->
test 'Headless', ->
eq(
xml('root', {}, {}, { headless: true })
.ele('xmlbuilder', { 'for': 'node-js' })
.ele('repo', { 'type': 'git' }, 'git://github.com/oozcitak/xmlbuilder-js.git')
.end()
'<root>' +
'<xmlbuilder for="node-js">' +
... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/headless.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/headless.coffee | 1 | 14 | ||
oozcitak/xmlbuilder-js:test/basic/headless.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Creating XML', ->
test 'Headless', ->
eq(
xml('root', {}, {}, { headless: true })
.ele('xmlbuilder', { 'for': 'node-js' })
.ele('repo', { 'type': 'git' }, 'git://github.com/oozcitak/xmlbuilder-js.git')
.end()
'<... | suite('Creating XML', function() {
return test('Headless', function() {
return eq(xml('root', {}, {}, {
headless: true
}).ele('xmlbuilder', {
'for': 'node-js'
}).ele('repo', {
'type': 'git'
}, 'git://github.com/oozcitak/xmlbuilder-js.git').end(), '<root>' + '<xmlbuilder for="node-js"... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/headless.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/headless.coffee | 1 | 14 |
oozcitak/xmlbuilder-js:test/basic/headless.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Creating XML', function() {
return test('Headless', function() {
return eq(xml('root', {}, {}, {
headless: true
}).ele('xmlbuilder', {
'for': 'node-js'
}).ele('repo', {
'type': 'git'
}, 'git://github.com/oozcitak/xmlbuilde... | suite 'Creating XML', ->
test 'Headless', ->
eq(
xml('root', {}, {}, { headless: true })
.ele('xmlbuilder', { 'for': 'node-js' })
.ele('repo', { 'type': 'git' }, 'git://github.com/oozcitak/xmlbuilder-js.git')
.end()
'<root>' +
'<xmlbuilder for="node-js">' +
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/headless.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/headless.coffee | 1 | 14 |
oozcitak/xmlbuilder-js:test/basic/headless.coffee:1:completion | completion | suite 'Creating XML', ->
test 'Headless', ->
eq(
xml('root', {}, {}, { headless: true })
.ele('xmlbuilder', { 'for': 'node-js' })
.ele('repo', { 'type': 'git' }, 'git://github.com/oozcitak/xmlbuilder-js.git')
.end() | '<root>' +
'<xmlbuilder for="node-js">' +
'<repo type="git">git://github.com/oozcitak/xmlbuilder-js.git</repo>' +
'</xmlbuilder>' +
'</root>'
) | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/headless.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/headless.coffee | 1 | 14 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:raw_corpus | raw_corpus | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 1 | 43 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" ... | suite('Attributes:', function() {
test('Add attribute (single with object argument)', function() {
return eq(xml('test4', {
headless: true
}).ele('node', 'element', {
"first": "1",
"second": "2"
}).att("third", "3").end(), '<test4><node first="1" second="2" third="3">element</node></test... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 1 | 43 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Attributes:', function() {
test('Add attribute (single with object argument)', function() {
return eq(xml('test4', {
headless: true
}).ele('node', 'element', {
"first": "1",
"second": "2"
}).att("third", "3").end(), '<test4><n... | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 1 | 43 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:completion | completion | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | .ele('node', 'element', {"first":"1", "second":"2", "third":"3"})
.removeAttribute("second")
.end()
'<test4><node first="1" third="3">element</node></test4>'
)
test 'Remove multiple attributes', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1"... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 1 | 43 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:raw_corpus | raw_corpus | test 'Skip if null attribute (ele)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first": null, "second": '2'})
.end()
'<test4><node second="2">element</node></test4>'
)
test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 45 | 83 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test 'Skip if null attribute (ele)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first": null, "second": '2'})
.end()
'<test4><node second="2">element</node></test4>'
)
test 'Skip if null attribute (att... | test('Skip if null attribute (ele)', function() {
return eq(xml('test4', {
headless: true
}).ele('node', 'element', {
"first": null,
"second": '2'
}).end(), '<test4><node second="2">element</node></test4>');
});
test('Skip if null attribute (att)', function() {
return eq(xml('test4', {
headless... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 45 | 83 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test('Skip if null attribute (ele)', function() {
return eq(xml('test4', {
headless: true
}).ele('node', 'element', {
"first": null,
"second": '2'
}).end(), '<test4><node second="2">element</node></test4>');
});
test('Skip if null attribute (att)... | test 'Skip if null attribute (ele)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first": null, "second": '2'})
.end()
'<test4><node second="2">element</node></test4>'
)
test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 45 | 83 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:completion | completion | test 'Skip if null attribute (ele)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first": null, "second": '2'})
.end()
'<test4><node second="2">element</node></test4>'
)
test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
... | .ele({'@first': null, '@second': '2'})
.end()
'<test4 second="2"/>'
)
test 'Keep null attribute (ele)', ->
eq(
xml('test4', { headless: true, keepNullAttributes: true })
.ele('node', 'element', {"first": null, "second": '2'})
.end()
'<test4><node first="" second="2">... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 45 | 83 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:3:raw_corpus | raw_corpus | test 'Keep null attribute (JSON)', ->
eq(
xml('test4', { headless: true, keepNullAttributes: true })
.ele({'@first': null, '@second': '2'})
.end()
'<test4 first="" second="2"/>'
) | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 85 | 91 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test 'Keep null attribute (JSON)', ->
eq(
xml('test4', { headless: true, keepNullAttributes: true })
.ele({'@first': null, '@second': '2'})
.end()
'<test4 first="" second="2"/>'
)
``` | test('Keep null attribute (JSON)', function() {
return eq(xml('test4', {
headless: true,
keepNullAttributes: true
}).ele({
'@first': null,
'@second': '2'
}).end(), '<test4 first="" second="2"/>');
}); | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 85 | 91 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test('Keep null attribute (JSON)', function() {
return eq(xml('test4', {
headless: true,
keepNullAttributes: true
}).ele({
'@first': null,
'@second': '2'
}).end(), '<test4 first="" second="2"/>');
});
``` | test 'Keep null attribute (JSON)', ->
eq(
xml('test4', { headless: true, keepNullAttributes: true })
.ele({'@first': null, '@second': '2'})
.end()
'<test4 first="" second="2"/>'
) | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 85 | 91 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:3:completion | completion | test 'Keep null attribute (JSON)', ->
eq(
xml('test4', { headless: true, keepNullAttributes: true }) | .ele({'@first': null, '@second': '2'})
.end()
'<test4 first="" second="2"/>'
) | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/attributes.coffee | 85 | 91 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:raw_corpus | raw_corpus | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 1 | 43 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" ... | suite('Attributes:', function() {
test('Add attribute (single with object argument)', function() {
return eq(xml('test4', {
headless: true
}).ele('node', 'element', {
"first": "1",
"second": "2"
}).att("third", "3").end(), '<test4><node first="1" second="2" third="3">element</node></test... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 1 | 43 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Attributes:', function() {
test('Add attribute (single with object argument)', function() {
return eq(xml('test4', {
headless: true
}).ele('node', 'element', {
"first": "1",
"second": "2"
}).att("third", "3").end(), '<test4><n... | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 1 | 43 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:completion | completion | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | .ele('node', 'element', {"first":"1", "second":"2", "third":"3"})
.removeAttribute("second")
.end()
'<test4><node first="1" third="3">element</node></test4>'
)
test 'Remove multiple attributes', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1"... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 1 | 43 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:raw_corpus | raw_corpus | test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
.ele('node').att("first")
.end()
'<test4><node/></test4>'
)
test 'Skip if null attribute (JSON)', ->
eq(
xml('test4', { headless: true })
.ele({'@first': null, '@second': '2'})
.... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 45 | 83 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
.ele('node').att("first")
.end()
'<test4><node/></test4>'
)
test 'Skip if null attribute (JSON)', ->
eq(
xml('test4', { headless: true })... | test('Skip if null attribute (att)', function() {
return eq(xml('test4', {
headless: true
}).ele('node').att("first").end(), '<test4><node/></test4>');
});
test('Skip if null attribute (JSON)', function() {
return eq(xml('test4', {
headless: true
}).ele({
'@first': null,
'@second': '2'
}).end... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 45 | 83 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test('Skip if null attribute (att)', function() {
return eq(xml('test4', {
headless: true
}).ele('node').att("first").end(), '<test4><node/></test4>');
});
test('Skip if null attribute (JSON)', function() {
return eq(xml('test4', {
headless: true
}... | test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
.ele('node').att("first")
.end()
'<test4><node/></test4>'
)
test 'Skip if null attribute (JSON)', ->
eq(
xml('test4', { headless: true })
.ele({'@first': null, '@second': '2'})
.... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 45 | 83 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:completion | completion | test 'Skip if null attribute (att)', ->
eq(
xml('test4', { headless: true })
.ele('node').att("first")
.end()
'<test4><node/></test4>'
)
test 'Skip if null attribute (JSON)', ->
eq(
xml('test4', { headless: true })
.ele({'@first': null, '@second': '2'})
.... | .ele('node', 'element', {"first": null, "second": '2'})
.end()
'<test4><node first="" second="2">element</node></test4>'
)
test 'Keep null attribute (att)', ->
eq(
xml('test4', { headless: true, keepNullAttributes: true })
.ele('node').att("first")
.end()
'<test4><no... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | 782540c408a8fdbe1a425f16f67644fbd9b60492 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/782540c408a8fdbe1a425f16f67644fbd9b60492/test/basic/attributes.coffee | 45 | 83 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:raw_corpus | raw_corpus | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/test/basic/attributes.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:1:completion | completion | suite 'Attributes:', ->
test 'Add attribute (single with object argument)', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2"})
.att("third", "3")
.end()
'<test4><node first="1" second="2" third="3">element</node></test4>'
)
tes... | )
test 'Remove multiple attributes', ->
eq(
xml('test4', { headless: true })
.ele('node', 'element', {"first":"1", "second":"2", "third":"3"})
.removeAttribute(["second", "third"])
.end()
'<test4><node first="1">element</node></test4>'
)
test 'Skip if null attribute (... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/test/basic/attributes.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:raw_corpus | raw_corpus | )
test 'Skip if null attribute (JSON)', ->
eq(
xml('test4', { headless: true, skipNullAttributes: true })
.ele({'@first': null, '@second': '2'})
.end()
'<test4 second="2"/>'
) | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/test/basic/attributes.coffee | 51 | 59 | ||
oozcitak/xmlbuilder-js:test/basic/attributes.coffee:2:completion | completion | )
test 'Skip if null attribute (JSON)', ->
eq( | xml('test4', { headless: true, skipNullAttributes: true })
.ele({'@first': null, '@second': '2'})
.end()
'<test4 second="2"/>'
) | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/attributes.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/test/basic/attributes.coffee | 51 | 59 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.