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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.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/directives/directives.editor.view.hash.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.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 ... | $scope.$watch 'model', (model) ->
$scope.hashItems = [] unless model?
$scope.addHashValue = ->
$scope.model = {} unless $scope.model?
$scope.hashItems.push { key: '', value: '', _key: ''}
$scope.updateHashKey = (hashItem) ->
# Set... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'tag-dropdown'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
tags: T.instanceOf(Immutable.List)
_messageId: T.string.isRequired
_teamId: T.string.isRequired
getInitialState: ->
tags: @getTeamTags()
index: -1
componentDidMou... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 27 | 76 | ||
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'tag-dropdown'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
tags: T.instanceOf(Immutable.List)
_messageId: T.string.isRequired
_teamId: T.string.isRequired
getInitialState: ->
... | module.exports = React.createClass({
displayName: 'tag-dropdown',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
tags: T.instanceOf(Immutable.List),
_messageId: T.string.isRequired,
_teamId: T.string.isRequired
},
getInitialState: function() {
return {
tags: this.getTeamTags(),
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'tag-dropdown',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
tags: T.instanceOf(Immutable.List),
_messageId: T.string.isRequired,
_teamId: T.string.isRequired
},
getInitialState: fun... | module.exports = React.createClass
displayName: 'tag-dropdown'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
tags: T.instanceOf(Immutable.List)
_messageId: T.string.isRequired
_teamId: T.string.isRequired
getInitialState: ->
tags: @getTeamTags()
index: -1
componentDidMou... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'tag-dropdown'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
tags: T.instanceOf(Immutable.List)
_messageId: T.string.isRequired
_teamId: T.string.isRequired
getInitialState: ->
tags: @getTeamTags()
index: -1
componentDidMou... | unless @refs.scroll?
return
each = 34
scrollEl = @refs.scroll
totalHeight = scrollEl.clientHeight
top = scrollEl.scrollTop
current = @state.index
startY = current * each
if ((startY - top) < 0) or ((startY + each) - top > totalHeight)
y = startY - totalHeight / 2
dom.sm... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:2:raw_corpus | raw_corpus | onTagAdd: ->
# TODO, bad idea to read value from DOM, use state instead
value = @_inputEl.value
teamTags = @getTeamTags()
tags = @props.tags or Immutable.List()
if @state.index isnt -1
_tagId = @state.tags.get(@state.index).get('_id')
@onTagClick _tagId, @state.index
else if value.r... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 77 | 126 | ||
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:2:completion | completion | onTagAdd: ->
# TODO, bad idea to read value from DOM, use state instead
value = @_inputEl.value
teamTags = @getTeamTags()
tags = @props.tags or Immutable.List()
if @state.index isnt -1
_tagId = @state.tags.get(@state.index).get('_id')
@onTagClick _tagId, @state.index
else if value.r... | data = {_tagIds}
messageActions.messageUpdate @props._messageId, data
@_inputEl.value = ''
onInputChange: (event) ->
filterTags = search.forTags @getTeamTags(), event.target.value
@setState tags: filterTags, index: -1
onTagClick: (_tagId, index) ->
tags = @props.tags or Immutable.List(... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 77 | 126 |
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:3:raw_corpus | raw_corpus | when keyboard.enter then @onTagAdd()
when keyboard.up then @selectPrev()
when keyboard.down then @selectNext()
renderHeader: ->
div className: 'header line',
input
ref: 'input', type: 'text', autoFocus: true
className: 'input form-control', placeholder: l('enter-tag-name')
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 127 | 161 | ||
jianliaoim/talk-os:talk-web/client/app/tag-dropdown.coffee:3:completion | completion | when keyboard.enter then @onTagAdd()
when keyboard.up then @selectPrev()
when keyboard.down then @selectNext()
renderHeader: ->
div className: 'header line',
input
ref: 'input', type: 'text', autoFocus: true
className: 'input form-control', placeholder: l('enter-tag-name')
... | @state.tags
.sort (a, b) ->
orders.isTagActive a, b, tagIds
.map (tag, index) =>
onTagClick = => @onTagClick tag.get('_id'), index
className = cx 'flex-horiz', 'item', 'rich-line', 'is-selected': index is @state.index
tagClassName = cx 'ti', 'ti-tick',
'is-active': ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/tag-dropdown.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/tag-dropdown.coffee | 127 | 161 |
jashkenas/coffeescript:test/interpolation.coffee:1:raw_corpus | raw_corpus | stash = (str) -> result = str
stash "a #{ ('aa').replace /a/g, 'b' } c"
ok result is 'a bb c'
foo = "hello"
ok "#{foo.replace("\"", "")}" is 'hello'
val = 10
a = """
basic heredoc #{val}
on two lines
"""
b = '''
basic heredoc #{val}
on two lines
'''
ok a is "basic heredoc 10\non two lines"
ok ... | CoffeeScript | jashkenas/coffeescript | test/interpolation.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/interpolation.coffee | 114 | 156 | ||
jashkenas/coffeescript:test/interpolation.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
stash = (str) -> result = str
stash "a #{ ('aa').replace /a/g, 'b' } c"
ok result is 'a bb c'
foo = "hello"
ok "#{foo.replace("\"", "")}" is 'hello'
val = 10
a = """
basic heredoc #{val}
on two lines
"""
b = '''
basic heredoc #{val}
on two l... | var a, b, foo, stash, val,
modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
stash = function(str) {
var result;
return result = str;
};
stash(`a ${'aa'.replace(/a/g, 'b')} c`);
ok(result === 'a bb c');
foo = "hello";
ok(`${foo.replace("\"", "")}` === 'hello');
val = 10;
a = `basic heredoc ${val... | CoffeeScript | JavaScript | jashkenas/coffeescript | test/interpolation.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/interpolation.coffee | 114 | 156 |
jashkenas/coffeescript:test/interpolation.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, b, foo, stash, val,
modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
stash = function(str) {
var result;
return result = str;
};
stash(`a ${'aa'.replace(/a/g, 'b')} c`);
ok(result === 'a bb c');
foo = "hello";
ok(`${foo.replace("\"", "... | stash = (str) -> result = str
stash "a #{ ('aa').replace /a/g, 'b' } c"
ok result is 'a bb c'
foo = "hello"
ok "#{foo.replace("\"", "")}" is 'hello'
val = 10
a = """
basic heredoc #{val}
on two lines
"""
b = '''
basic heredoc #{val}
on two lines
'''
ok a is "basic heredoc 10\non two lines"
ok ... | JavaScript | CoffeeScript | jashkenas/coffeescript | test/interpolation.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/interpolation.coffee | 114 | 156 |
jashkenas/coffeescript:test/interpolation.coffee:1:completion | completion | stash = (str) -> result = str
stash "a #{ ('aa').replace /a/g, 'b' } c"
ok result is 'a bb c'
foo = "hello"
ok "#{foo.replace("\"", "")}" is 'hello'
val = 10
a = """
basic heredoc #{val}
on two lines
"""
b = '''
basic heredoc #{val}
on two lines
'''
ok a is "basic heredoc 10\non two lines"
ok ... | ok yes
"\"interpolations\""
)()}"
} work"""
eq 'function(){}', "#{->}".replace /\s/g, ''
ok /^a[\s\S]+b$/.test "a#{=>}b"
ok /^a[\s\S]+b$/.test "a#{ (x) -> x %% 2 }b"
# Regular Expression Interpolation
# TODO: improve heregex interpolation tests
test "heregex interpolation", ->
eq /\\#{}\\"/ + '', ///
#{
... | CoffeeScript | CoffeeScript | jashkenas/coffeescript | test/interpolation.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/test/interpolation.coffee | 114 | 156 |
mauricemach/zappa:tests/tests.coffee:1:raw_corpus | raw_corpus | module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tester ->
post '/': 'post'
put '/': -> 'put'
... | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 3 | 52 | ||
mauricemach/zappa:tests/tests.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tes... | module.exports = {
hello: function() {
var t;
t = new Tester(function() {
get({
'/string': 'string'
});
get({
'/return': function() {
return 'return';
}
});
return get({
'/send': function() {
return send('send');
}
... | CoffeeScript | JavaScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 3 | 52 |
mauricemach/zappa:tests/tests.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
hello: function() {
var t;
t = new Tester(function() {
get({
'/string': 'string'
});
get({
'/return': function() {
return 'return';
}
});
return get({
'/send': func... | module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tester ->
post '/': 'post'
put '/': -> 'put'
... | JavaScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 3 | 52 |
mauricemach/zappa:tests/tests.coffee:1:completion | completion | module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tester ->
post '/': 'post'
put '/': -> 'put'
... | t.response {url: '/'}, {status: 302, headers: {Location: /\/foo$/}}
params: ->
t = new Tester ->
use 'bodyParser'
get '/:foo': -> @foo + @ping
post '/:foo': -> @foo + @ping + @zig
t.get '/bar?ping=pong', 'barpong'
headers = 'Content-Type': 'application/x-www-form-urlencoded'
t.resp... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 3 | 52 |
mauricemach/zappa:tests/tests.coffee:2:raw_corpus | raw_corpus | t.get '/', '<h2>CoffeeKup inline template: bar</h2>'
'view (inline, inline layout)': ->
t = new Tester ->
get '/': ->
@foo = 'bar'
render 'index'
view index: -> h2 "CoffeeKup inline template: #{@foo}"
view layout: ->
doctype 5
html ->
head ->
... | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 53 | 102 | ||
mauricemach/zappa:tests/tests.coffee:2:completion | completion | t.get '/', '<h2>CoffeeKup inline template: bar</h2>'
'view (inline, inline layout)': ->
t = new Tester ->
get '/': ->
@foo = 'bar'
render 'index'
view index: -> h2 "CoffeeKup inline template: #{@foo}"
view layout: ->
doctype 5
html ->
head ->
... | 'view (file, file layout)': ->
t = new Tester ->
get '/': ->
@foo = 'bar'
render 'index'
t.get '/', '<!DOCTYPE html><html><head><title>CoffeeKup file layout</title></head><body><h2>CoffeeKup file template: bar</h2></body></html>'
'view (response.render)': ->
t = new Tester ->
... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 53 | 102 |
mauricemach/zappa:tests/tests.coffee:3:raw_corpus | raw_corpus | alert('hi');
'''
headers = 'Content-Type': 'application/javascript'
body = ';var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) { for (var key in... | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 103 | 146 | ||
mauricemach/zappa:tests/tests.coffee:3:completion | completion | alert('hi');
'''
headers = 'Content-Type': 'application/javascript'
body = ';var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) { for (var key in... | -moz-border-radius arguments
border-radius arguments
body
font 12px Helvetica, Arial, sans-serif
a.button
border-radius 5px
'''
headers = 'Content-Type': 'text/css'
body = '''
body {
font: 12px Helvetica, Arial, sans-serif;
}
a.butt... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 92284d73af0eb953742050438e9c6c6487df684b | 943 | https://github.com/mauricemach/zappa/blob/92284d73af0eb953742050438e9c6c6487df684b/tests/tests.coffee | 103 | 146 |
mauricemach/zappa:tests/tests.coffee:1:raw_corpus | raw_corpus | module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tester ->
post '/': 'post'
put '/': -> 'put'
... | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 69d5e9b7198aff7406539aa36c7a5a0e11c5aca4 | 943 | https://github.com/mauricemach/zappa/blob/69d5e9b7198aff7406539aa36c7a5a0e11c5aca4/tests/tests.coffee | 3 | 52 | ||
mauricemach/zappa:tests/tests.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tes... | module.exports = {
hello: function() {
var t;
t = new Tester(function() {
get({
'/string': 'string'
});
get({
'/return': function() {
return 'return';
}
});
return get({
'/send': function() {
return send('send');
}
... | CoffeeScript | JavaScript | mauricemach/zappa | tests/tests.coffee | MIT | 69d5e9b7198aff7406539aa36c7a5a0e11c5aca4 | 943 | https://github.com/mauricemach/zappa/blob/69d5e9b7198aff7406539aa36c7a5a0e11c5aca4/tests/tests.coffee | 3 | 52 |
mauricemach/zappa:tests/tests.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
hello: function() {
var t;
t = new Tester(function() {
get({
'/string': 'string'
});
get({
'/return': function() {
return 'return';
}
});
return get({
'/send': func... | module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tester ->
post '/': 'post'
put '/': -> 'put'
... | JavaScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 69d5e9b7198aff7406539aa36c7a5a0e11c5aca4 | 943 | https://github.com/mauricemach/zappa/blob/69d5e9b7198aff7406539aa36c7a5a0e11c5aca4/tests/tests.coffee | 3 | 52 |
mauricemach/zappa:tests/tests.coffee:1:completion | completion | module.exports =
hello: ->
t = new Tester ->
get '/string': 'string'
get '/return': -> 'return'
get '/send': -> send 'send'
t.get '/string', 'string'
t.get '/return', 'return'
t.get '/send', 'send'
verbs: ->
t = new Tester ->
post '/': 'post'
put '/': -> 'put'
... | t.response {url: '/'}, {status: 302, headers: {Location: /\/foo$/}}
params: ->
t = new Tester ->
use 'bodyParser'
get '/:foo': -> @foo + @ping
post '/:foo': -> @foo + @ping + @zig
t.get '/bar?ping=pong', 'barpong'
headers = 'Content-Type': 'application/x-www-form-urlencoded'
t.resp... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 69d5e9b7198aff7406539aa36c7a5a0e11c5aca4 | 943 | https://github.com/mauricemach/zappa/blob/69d5e9b7198aff7406539aa36c7a5a0e11c5aca4/tests/tests.coffee | 3 | 52 |
mauricemach/zappa:tests/tests.coffee:2:raw_corpus | raw_corpus | 'view (file)': ->
t = new Tester ->
get '/': -> render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'view (response.render)': ->
t = new Tester ->
get '/': -> response.render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'coffee and js': ->
... | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 69d5e9b7198aff7406539aa36c7a5a0e11c5aca4 | 943 | https://github.com/mauricemach/zappa/blob/69d5e9b7198aff7406539aa36c7a5a0e11c5aca4/tests/tests.coffee | 53 | 102 | ||
mauricemach/zappa:tests/tests.coffee:2:completion | completion | 'view (file)': ->
t = new Tester ->
get '/': -> render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'view (response.render)': ->
t = new Tester ->
get '/': -> response.render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'coffee and js': ->
... | css: ->
t = new Tester ->
css '/index.css': '''
font-family: sans-serif;
'''
headers = 'Content-Type': 'text/css'
body = 'font-family: sans-serif;'
t.response {url: '/index.css'}, {headers, body}
stylus: ->
t = new Tester ->
stylus '/index.css': '''
border-radius... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | 69d5e9b7198aff7406539aa36c7a5a0e11c5aca4 | 943 | https://github.com/mauricemach/zappa/blob/69d5e9b7198aff7406539aa36c7a5a0e11c5aca4/tests/tests.coffee | 53 | 102 |
mauricemach/zappa:tests/tests.coffee:2:raw_corpus | raw_corpus | 'view (file)': ->
t = new Tester ->
get '/': -> render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'view (response.render)': ->
t = new Tester ->
get '/': -> response.render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'coffee and js': ->
... | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | d7af6f562abfd693c1cea14d84cdd1b972639791 | 943 | https://github.com/mauricemach/zappa/blob/d7af6f562abfd693c1cea14d84cdd1b972639791/tests/tests.coffee | 53 | 85 | ||
mauricemach/zappa:tests/tests.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'view (file)': ->
t = new Tester ->
get '/': -> render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'view (response.render)': ->
t = new Tester ->
get '/': -> response.render 'index', layout: no
t.get '/', '<h... | ({
'view (file)': function() {
var t;
t = new Tester(function() {
return get({
'/': function() {
return render('index', {
layout: false
});
}
});
});
return t.get('/', '<h2>CoffeeKup file template</h2>');
},
'view (response.render)': func... | CoffeeScript | JavaScript | mauricemach/zappa | tests/tests.coffee | MIT | d7af6f562abfd693c1cea14d84cdd1b972639791 | 943 | https://github.com/mauricemach/zappa/blob/d7af6f562abfd693c1cea14d84cdd1b972639791/tests/tests.coffee | 53 | 85 |
mauricemach/zappa:tests/tests.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'view (file)': function() {
var t;
t = new Tester(function() {
return get({
'/': function() {
return render('index', {
layout: false
});
}
});
});
return t.get('/', '<h2>CoffeeKup file... | 'view (file)': ->
t = new Tester ->
get '/': -> render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'view (response.render)': ->
t = new Tester ->
get '/': -> response.render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'coffee and js': ->
... | JavaScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | d7af6f562abfd693c1cea14d84cdd1b972639791 | 943 | https://github.com/mauricemach/zappa/blob/d7af6f562abfd693c1cea14d84cdd1b972639791/tests/tests.coffee | 53 | 85 |
mauricemach/zappa:tests/tests.coffee:2:completion | completion | 'view (file)': ->
t = new Tester ->
get '/': -> render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'view (response.render)': ->
t = new Tester ->
get '/': -> response.render 'index', layout: no
t.get '/', '<h2>CoffeeKup file template</h2>'
'coffee and js': ->
... | js '/js.js': '''
alert('hi');
'''
headers = 'Content-Type': 'application/javascript'
body = ';var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, p... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/tests.coffee | MIT | d7af6f562abfd693c1cea14d84cdd1b972639791 | 943 | https://github.com/mauricemach/zappa/blob/d7af6f562abfd693c1cea14d84cdd1b972639791/tests/tests.coffee | 53 | 85 |
mojotech/pioneer:test/unit/persist_browser.coffee:1:raw_corpus | raw_corpus | assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) ->
this.timeout(20000);
p = path.resolve(path.join(__dirname, "../", "../", "bin/pioneer"))
featurePath = path.resolve(path.join(__dirna... | CoffeeScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | a8a41d33ca938e73bf736a42591381c04a188cf6 | 523 | https://github.com/mojotech/pioneer/blob/a8a41d33ca938e73bf736a42591381c04a188cf6/test/unit/persist_browser.coffee | 1 | 12 | ||
mojotech/pioneer:test/unit/persist_browser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) ->
this.timeout(20000);
p = path.resolve(path.join(__dirname, "../", "../", "bin/pi... | var assert, exec, path;
assert = require("assert");
exec = require("exec");
path = require("path");
describe("Option to persist browser across tests", function() {
return it("should run without failing", function(done) {
var featurePath, p;
this.timeout(20000);
p = path.resolve(path.join(__dirname, ".... | CoffeeScript | JavaScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | a8a41d33ca938e73bf736a42591381c04a188cf6 | 523 | https://github.com/mojotech/pioneer/blob/a8a41d33ca938e73bf736a42591381c04a188cf6/test/unit/persist_browser.coffee | 1 | 12 |
mojotech/pioneer:test/unit/persist_browser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, exec, path;
assert = require("assert");
exec = require("exec");
path = require("path");
describe("Option to persist browser across tests", function() {
return it("should run without failing", function(done) {
var featurePath, p;
this.timeo... | assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) ->
this.timeout(20000);
p = path.resolve(path.join(__dirname, "../", "../", "bin/pioneer"))
featurePath = path.resolve(path.join(__dirna... | JavaScript | CoffeeScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | a8a41d33ca938e73bf736a42591381c04a188cf6 | 523 | https://github.com/mojotech/pioneer/blob/a8a41d33ca938e73bf736a42591381c04a188cf6/test/unit/persist_browser.coffee | 1 | 12 |
mojotech/pioneer:test/unit/persist_browser.coffee:1:completion | completion | assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) -> | this.timeout(20000);
p = path.resolve(path.join(__dirname, "../", "../", "bin/pioneer"))
featurePath = path.resolve(path.join(__dirname, "../", "integration/features/form.feature"))
exec [p, featurePath, "--driver=phantomjs", "--prevent-browser-reload"], (err, out, code) ->
assert.equal(code, 0, "Erro... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | a8a41d33ca938e73bf736a42591381c04a188cf6 | 523 | https://github.com/mojotech/pioneer/blob/a8a41d33ca938e73bf736a42591381c04a188cf6/test/unit/persist_browser.coffee | 1 | 12 |
mojotech/pioneer:test/unit/persist_browser.coffee:1:raw_corpus | raw_corpus | assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) ->
this.timeout(20000);
dillPath = path.resolve(path.join(__dirname, "../", "../", "bin/dill"))
featurePath = path.resolve(path.join(__d... | CoffeeScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/test/unit/persist_browser.coffee | 1 | 12 | ||
mojotech/pioneer:test/unit/persist_browser.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) ->
this.timeout(20000);
dillPath = path.resolve(path.join(__dirname, "../", "../", ... | var assert, exec, path;
assert = require("assert");
exec = require("exec");
path = require("path");
describe("Option to persist browser across tests", function() {
return it("should run without failing", function(done) {
var dillPath, featurePath;
this.timeout(20000);
dillPath = path.resolve(path.join... | CoffeeScript | JavaScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/test/unit/persist_browser.coffee | 1 | 12 |
mojotech/pioneer:test/unit/persist_browser.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assert, exec, path;
assert = require("assert");
exec = require("exec");
path = require("path");
describe("Option to persist browser across tests", function() {
return it("should run without failing", function(done) {
var dillPath, featurePath;
thi... | assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) ->
this.timeout(20000);
dillPath = path.resolve(path.join(__dirname, "../", "../", "bin/dill"))
featurePath = path.resolve(path.join(__d... | JavaScript | CoffeeScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/test/unit/persist_browser.coffee | 1 | 12 |
mojotech/pioneer:test/unit/persist_browser.coffee:1:completion | completion | assert = require("assert")
exec = require("exec");
path = require("path")
describe "Option to persist browser across tests", ->
it "should run without failing", (done) -> | this.timeout(20000);
dillPath = path.resolve(path.join(__dirname, "../", "../", "bin/dill"))
featurePath = path.resolve(path.join(__dirname, "../", "integration/features/form.feature"))
exec [dillPath, featurePath, "--driver=phantomjs", "--prevent-browser-reload"], (err, out, code) ->
assert.equal(cod... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/unit/persist_browser.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/test/unit/persist_browser.coffee | 1 | 12 |
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:raw_corpus | raw_corpus | module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@channels()]
@decodeRLEChannel()
@lineIndex += @hei... | CoffeeScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_formats/rle.coffee | 1 | 37 | ||
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@chann... | module.exports = {
parseRLE: function() {
this.byteCounts = this.parseByteCounts();
return this.parseChannelData();
},
parseByteCounts: function() {
var i, k, ref, results;
results = [];
for (i = k = 0, ref = this.channels() * this.height(); (0 <= ref ? k < ref : k > ref); i = 0 <= ref ? ++k :... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_formats/rle.coffee | 1 | 37 |
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
parseRLE: function() {
this.byteCounts = this.parseByteCounts();
return this.parseChannelData();
},
parseByteCounts: function() {
var i, k, ref, results;
results = [];
for (i = k = 0, ref = this.channels() * this.height(... | module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@channels()]
@decodeRLEChannel()
@lineIndex += @hei... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_formats/rle.coffee | 1 | 37 |
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:completion | completion | module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@channels()]
@decodeRLEChannel()
@lineIndex += @hei... | finish = @file.tell() + byteCount
while @file.tell() < finish
len = @file.read(1)[0]
if len < 128
len += 1
#@channelData.splice @chanPos, 0, @file.read(len)...
data = @file.read(len)
@channelData.set data, @chanPos
@chanPos += len
else if... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/image_formats/rle.coffee | 1 | 37 |
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:raw_corpus | raw_corpus | module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@channels()]
@decodeRLEChannel()
@lineIndex += @he... | CoffeeScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 4c8ab8d623693821bd73a31de24010c21bae7577 | 2,846 | https://github.com/meltingice/psd.js/blob/4c8ab8d623693821bd73a31de24010c21bae7577/lib/psd/image_formats/rle.coffee | 1 | 34 | ||
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@chan... | module.exports = {
parseRLE: function() {
this.byteCounts = this.parseByteCounts();
return this.parseChannelData();
},
parseByteCounts: function() {
var i, k, ref, results;
results = [];
for (i = k = 0, ref = this.channels() * this.height(); (0 <= ref ? k < ref : k > ref); i = 0 <= ref ? ++k :... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 4c8ab8d623693821bd73a31de24010c21bae7577 | 2,846 | https://github.com/meltingice/psd.js/blob/4c8ab8d623693821bd73a31de24010c21bae7577/lib/psd/image_formats/rle.coffee | 1 | 34 |
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
parseRLE: function() {
this.byteCounts = this.parseByteCounts();
return this.parseChannelData();
},
parseByteCounts: function() {
var i, k, ref, results;
results = [];
for (i = k = 0, ref = this.channels() * this.height(... | module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@channels()]
@decodeRLEChannel()
@lineIndex += @he... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 4c8ab8d623693821bd73a31de24010c21bae7577 | 2,846 | https://github.com/meltingice/psd.js/blob/4c8ab8d623693821bd73a31de24010c21bae7577/lib/psd/image_formats/rle.coffee | 1 | 34 |
meltingice/psd.js:lib/psd/image_formats/rle.coffee:1:completion | completion | module.exports =
parseRLE: ->
@byteCounts = @parseByteCounts()
@parseChannelData()
parseByteCounts: ->
@file.readShort() for i in [0...(@channels() * @height())]
parseChannelData: ->
@chanPos = 0
@lineIndex = 0
for i in [0...@channels()]
@decodeRLEChannel()
@lineIndex += @he... | for j in [0...@height()]
byteCount = @byteCounts[@lineIndex + j]
finish = @file.tell() + byteCount
while @file.tell() < finish
len = @file.read(1)[0]
if len < 128
len += 1
@channelData.splice @chanPos, 0, @file.read(len)...
@chanPos += len
else i... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/image_formats/rle.coffee | MIT | 4c8ab8d623693821bd73a31de24010c21bae7577 | 2,846 | https://github.com/meltingice/psd.js/blob/4c8ab8d623693821bd73a31de24010c21bae7577/lib/psd/image_formats/rle.coffee | 1 | 34 |
mojotech/pioneer:src/support/index.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Driver = Driver
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 8 | 57 | ||
mojotech/pioneer:src/support/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Driver = Driver
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
... | var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
this.Driver = Driver;
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.execute(() => {
return code.call(this);
});
... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
this.Driver = Driver;
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.execute... | module.exports = ->
@Driver = Driver
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:completion | completion | module.exports = ->
@Driver = Driver
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@... | @AfterAll = (code) ->
unless @_ranAfterAll
@_ranAfterAll = true
@After code
flowStep = (code, args, pending, successCallback, errCallback) =>
@Pending = (reason) -> successCallback = _.partial pending, reason
$
.createFlow (flow) =>
flow.execute =>
code.apply(@, args)
.... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@SetDriver = ->
... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 58 | 107 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
... | var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback.pending, callback, (error) => {
if (new Date() - start > timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function() {
return callforth();
});
... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 58 | 107 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback.pending, callback, (error) => {
if (new Date() - start > timeout) {
return callback(error);
} else {
return $.delayed(1000).t... | callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@SetDriver = ->
... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 58 | 107 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@SetDriver = ->
... | ))
@driver.wait(
(()->
return keyPress
), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@SetDriver()
@driver.visit = @driver.get
@After ->
terminateDriver() unless shouldPreventBrowserReload()
... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 58 | 107 |
mojotech/pioneer:src/support/index.coffee:3:raw_corpus | raw_corpus | @driver.close()
@driver.quit()
@When /^I Freeze$/, @Freeze | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 108 | 111 | ||
mojotech/pioneer:src/support/index.coffee:3:completion | completion | @driver.close()
@driver.quit() | @When /^I Freeze$/, @Freeze | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/support/index.coffee | 108 | 111 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
ke... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | fb5b870061fef29ecc7b69c67b9fb10a5afb3b26 | 523 | https://github.com/mojotech/pioneer/blob/fb5b870061fef29ecc7b69c67b9fb10a5afb3b26/src/support/index.coffee | 58 | 107 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
... | var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback.pending, callback, (error) => {
if (new Date() - start > timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function() {
return callforth();
});
... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | fb5b870061fef29ecc7b69c67b9fb10a5afb3b26 | 523 | https://github.com/mojotech/pioneer/blob/fb5b870061fef29ecc7b69c67b9fb10a5afb3b26/src/support/index.coffee | 58 | 107 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback.pending, callback, (error) => {
if (new Date() - start > timeout) {
return callback(error);
} else {
return $.delayed(1000).t... | callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
ke... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | fb5b870061fef29ecc7b69c67b9fb10a5afb3b26 | 523 | https://github.com/mojotech/pioneer/blob/fb5b870061fef29ecc7b69c67b9fb10a5afb3b26/src/support/index.coffee | 58 | 107 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | callforth = =>
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
ke... | return keyPress
), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@driver.visit = @driver.get
@After ->
termi... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | fb5b870061fef29ecc7b69c67b9fb10a5afb3b26 | 523 | https://github.com/mojotech/pioneer/blob/fb5b870061fef29ecc7b69c67b9fb10a5afb3b26/src/support/index.coffee | 58 | 107 |
mojotech/pioneer:src/support/index.coffee:1:raw_corpus | raw_corpus | module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@After = (code) ->
... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 8 | 57 | ||
mojotech/pioneer:src/support/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) ... | var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.execute(() => {
return code.call(this);
});
}).then(_.partial(callba... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.execute(() => {
return ... | module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@After = (code) ->
... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:completion | completion | module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@After = (code) ->
... | @_ranAfterAll = true
@After code
flowStep = (code, args, pending, successCallback, errCallback) =>
@Pending = (reason) -> successCallback = _.partial pending, reason
$
.createFlow (flow) =>
flow.execute =>
code.apply(@, args)
.then (result) ->
successCallback null, result
... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdi... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 58 | 106 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pat... | var shouldPreventBrowserReload, terminateDriver;
flowStep(code, args, callback.pending, callback, (error) => {
if (new Date() - start > timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function() {
return callforth();
});
}
});
callforth();
this.And = (pattern, code) =>... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 58 | 106 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var shouldPreventBrowserReload, terminateDriver;
flowStep(code, args, callback.pending, callback, (error) => {
if (new Date() - start > timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function() {
return callforth();
}... | flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdi... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 58 | 106 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | flowStep code, args, callback.pending, callback, (error) =>
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdi... | ), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@driver.visit = @driver.get
@After ->
terminateDriver() unless ... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | a55bfbd97345de79ef29a24e51b5ec693a858e91 | 523 | https://github.com/mojotech/pioneer/blob/a55bfbd97345de79ef29a24e51b5ec693a858e91/src/support/index.coffee | 58 | 106 |
mojotech/pioneer:src/support/index.coffee:1:raw_corpus | raw_corpus | module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@After = (code) ->
... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 033b17dce9d8d2ffea418d55f96ba1090400b527 | 523 | https://github.com/mojotech/pioneer/blob/033b17dce9d8d2ffea418d55f96ba1090400b527/src/support/index.coffee | 8 | 57 | ||
mojotech/pioneer:src/support/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) ... | var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.execute(() => {
return code.call(this);
});
}).then(_.partial(callba... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 033b17dce9d8d2ffea418d55f96ba1090400b527 | 523 | https://github.com/mojotech/pioneer/blob/033b17dce9d8d2ffea418d55f96ba1090400b527/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.execute(() => {
return ... | module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@After = (code) ->
... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 033b17dce9d8d2ffea418d55f96ba1090400b527 | 523 | https://github.com/mojotech/pioneer/blob/033b17dce9d8d2ffea418d55f96ba1090400b527/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:completion | completion | module.exports = ->
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =>
@_inFlow code, callback
@After = (code) ->
... | @_ranAfterAll = true
@After code
flowStep = (code, args, successCallback, errCallback) =>
$
.createFlow (flow) =>
flow.execute =>
code.apply(@, args)
.then _.partial(successCallback, null), errCallback
@Given = @When = (pattern, code) =>
@defineStep pattern, (args..., callback)... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 033b17dce9d8d2ffea418d55f96ba1090400b527 | 523 | https://github.com/mojotech/pioneer/blob/033b17dce9d8d2ffea418d55f96ba1090400b527/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | $.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
stdin.setEncoding('utf8')
console.log('Press any key to continue...'.yellow.inverse... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 033b17dce9d8d2ffea418d55f96ba1090400b527 | 523 | https://github.com/mojotech/pioneer/blob/033b17dce9d8d2ffea418d55f96ba1090400b527/src/support/index.coffee | 58 | 102 | ||
mojotech/pioneer:src/support/index.coffee:2:completion | completion | $.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
stdin.setEncoding('utf8')
console.log('Press any key to continue...'.yellow.inverse... | @Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@driver.visit = @driver.get
@After ->
terminateDriver() unless shouldPreventBrowserReload()
@registerHandl... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 033b17dce9d8d2ffea418d55f96ba1090400b527 | 523 | https://github.com/mojotech/pioneer/blob/033b17dce9d8d2ffea418d55f96ba1090400b527/src/support/index.coffee | 58 | 102 |
mojotech/pioneer:src/support/index.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 8 | 57 | ||
mojotech/pioneer:src/support/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> ... | var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
this.visit = (path) => {
return this.driver.get(`${this.host}${path}`);
};
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => {
return flow.exe... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
this.visit = (path) => {
return this.driver.get(`${this.host}${path}`);
};
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
... | module.exports = ->
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:1:completion | completion | module.exports = ->
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_Before (callback) =... | @AfterAll = (code) ->
unless @_ranAfterAll
@_ranAfterAll = true
@After code
flowStep = (code, args, successCallback, errCallback) =>
$
.createFlow (flow) =>
flow.execute =>
code.apply(@, args)
.then _.partial(successCallback, null), errCallback
@Given = @When = (pattern, ... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 8 | 57 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
st... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 58 | 104 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.s... | var shouldPreventBrowserReload, terminateDriver;
if (new Date() - start > timeout) {
callback(error);
} else {
$.delayed(1000).then(function() {
return callforth();
});
}
callforth();
this.And = (pattern, code) => {
return this[this.lastStepType](pattern, code);
};
this.Freeze = function() {
var keyPr... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 58 | 104 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var shouldPreventBrowserReload, terminateDriver;
if (new Date() - start > timeout) {
callback(error);
} else {
$.delayed(1000).then(function() {
return callforth();
});
}
callforth();
this.And = (pattern, code) => {
return this[this.lastStepType](pat... | if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
st... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 58 | 104 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
st... | ), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@After ->
terminateDriver() unless shouldPreventBrowserReload()
@r... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 6f337b825bb86eae2ecf139690e9eca684a6295c | 523 | https://github.com/mojotech/pioneer/blob/6f337b825bb86eae2ecf139690e9eca684a6295c/src/support/index.coffee | 58 | 104 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
st... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 59a47ab738c3e64f3fb28e9942acefefa3f776b7 | 523 | https://github.com/mojotech/pioneer/blob/59a47ab738c3e64f3fb28e9942acefefa3f776b7/src/support/index.coffee | 58 | 101 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.s... | var shouldPreventBrowserReload, terminateDriver;
if (new Date() - start > timeout) {
callback(error);
} else {
$.delayed(1000).then(function() {
return callforth();
});
}
callforth();
this.And = (pattern, code) => {
return this[this.lastStepType](pattern, code);
};
this.Freeze = function() {
var keyPr... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 59a47ab738c3e64f3fb28e9942acefefa3f776b7 | 523 | https://github.com/mojotech/pioneer/blob/59a47ab738c3e64f3fb28e9942acefefa3f776b7/src/support/index.coffee | 58 | 101 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var shouldPreventBrowserReload, terminateDriver;
if (new Date() - start > timeout) {
callback(error);
} else {
$.delayed(1000).then(function() {
return callforth();
});
}
callforth();
this.And = (pattern, code) => {
return this[this.lastStepType](pat... | if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
st... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 59a47ab738c3e64f3fb28e9942acefefa3f776b7 | 523 | https://github.com/mojotech/pioneer/blob/59a47ab738c3e64f3fb28e9942acefefa3f776b7/src/support/index.coffee | 58 | 101 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | if new Date - start > timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
stdin = process.stdin
stdin.setRawMode(true)
stdin.resume()
st... | return keyPress
), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@After ->
terminateDriver() unless shouldPreventB... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 59a47ab738c3e64f3fb28e9942acefefa3f776b7 | 523 | https://github.com/mojotech/pioneer/blob/59a47ab738c3e64f3fb28e9942acefefa3f776b7/src/support/index.coffee | 58 | 101 |
mojotech/pioneer:src/support/index.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@timeout = 5000
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 6 | 55 | ||
mojotech/pioneer:src/support/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@timeout = 5000
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, nul... | var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
this.timeout = 5000;
this.visit = (path) => {
return this.driver.get(`${this.host}${path}`);
};
_Before = this.Before;
_After = this.After;
this._inFlow = function(code, callback) {
return $.createFlow((flow) => ... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 6 | 55 |
mojotech/pioneer:src/support/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var splice = [].splice;
module.exports = function() {
var _After, _Before, flowStep;
this.timeout = 5000;
this.visit = (path) => {
return this.driver.get(`${this.host}${path}`);
};
_Before = this.Before;
_After = this.After;
this._inFlow = functi... | module.exports = ->
@timeout = 5000
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 6 | 55 |
mojotech/pioneer:src/support/index.coffee:1:completion | completion | module.exports = ->
@timeout = 5000
@visit = (path) =>
@driver.get "#{@host}#{path}"
_Before = @Before
_After = @After
@_inFlow = (code, callback) ->
$.createFlow (flow) =>
flow.execute => code.call(@)
.then _.partial(callback, null),
(err) -> throw err
@Before = (code) ->
_... | unless @_ranBeforeAll
@_ranBeforeAll = true
@Before code
@AfterAll = (code) ->
unless @_ranAfterAll
@_ranAfterAll = true
@After code
flowStep = (code, args, successCallback, errCallback) =>
$
.createFlow (flow) =>
flow.execute =>
code.apply(@, args)
.then _.pa... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 6 | 55 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 56 | 101 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepTyp... | var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback, (error) => {
if (new Date() - start > this.timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function() {
return callforth();
});
}
});
}... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 56 | 101 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback, (error) => {
if (new Date() - start > this.timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function(... | callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 56 | 101 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
... | (()->
return keyPress
), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@After ->
terminateDriver() unless ... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/src/support/index.coffee | 56 | 101 |
mojotech/pioneer:src/support/index.coffee:2:raw_corpus | raw_corpus | callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
... | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/src/support/index.coffee | 52 | 97 | ||
mojotech/pioneer:src/support/index.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepTyp... | var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback, (error) => {
if (new Date() - start > this.timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function() {
return callforth();
});
}
});
}... | CoffeeScript | JavaScript | mojotech/pioneer | src/support/index.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/src/support/index.coffee | 52 | 97 |
mojotech/pioneer:src/support/index.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var callforth, shouldPreventBrowserReload, terminateDriver;
callforth = () => {
return flowStep(code, args, callback, (error) => {
if (new Date() - start > this.timeout) {
return callback(error);
} else {
return $.delayed(1000).then(function(... | callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
... | JavaScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/src/support/index.coffee | 52 | 97 |
mojotech/pioneer:src/support/index.coffee:2:completion | completion | callforth = =>
flowStep code, args, callback, (error) =>
if new Date - start > @timeout
callback(error)
else
$.delayed(1000).then -> callforth()
callforth()
@And = (pattern, code) =>
@[@lastStepType](pattern, code)
@Freeze = ->
keyPress = false
... | (()->
return keyPress
), Infinity).then -> process.stdin.pause()
@Before ->
@lastStepType = 'Given'
if !@driver || !shouldPreventBrowserReload()
@driver = new Driver.Builder().withCapabilities(Driver.Capabilities[argv.driver || 'chrome']()).build()
@After ->
terminateDriver() unless ... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/support/index.coffee | MIT | 84854573ca1d222bb113fd5c106575e31f37b268 | 523 | https://github.com/mojotech/pioneer/blob/84854573ca1d222bb113fd5c106575e31f37b268/src/support/index.coffee | 52 | 97 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.