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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:raw_corpus | raw_corpus | })
.invoke({
method: "read",
arguments: [{
transformer: (val) -> return val.toUpperCase()
selector: "p"
}]
}).should.eventually.eql(["ORC", "HUMAN", "PROTOSS"])
@Given /^I can check the visibility on a list's items$/, ->
new @Widgets.List({
root: ".nested",
i... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 60080e556c0f1977ab77addd185b3fc2df81dc79 | 523 | https://github.com/mojotech/pioneer/blob/60080e556c0f1977ab77addd185b3fc2df81dc79/test/integration/steps/list_steps.coffee | 154 | 171 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:completion | completion | })
.invoke({
method: "read",
arguments: [{
transformer: (val) -> return val.toUpperCase()
selector: "p"
}]
}).should.eventually.eql(["ORC", "HUMAN", "PROTOSS"]) | @Given /^I can check the visibility on a list's items$/, ->
new @Widgets.List({
root: ".nested",
itemSelector: "span"
})
.map (w) ->
w.isVisible()
.should.eventually
.eql([true, true, true]) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 60080e556c0f1977ab77addd185b3fc2df81dc79 | 523 | https://github.com/mojotech/pioneer/blob/60080e556c0f1977ab77addd185b3fc2df81dc79/test/integration/steps/list_steps.coffee | 154 | 171 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 4 | 53 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @W... | module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/, function(content, position) {
return new this.Wid... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 4 | 53 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/... | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 4 | 53 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | new @Widgets.List().toHtml()
@When /^I find with "([^"]*)" I should see "([^"]*)"$/, (string, content) ->
new @Widgets.List().findBy(string)
.then (item) -> item.getHtml()
.should.eventually.eql(content)
@When /^I call at with a string I should get an error$/, ->
expect( =>
new @Widgets.List... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 4 | 53 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:raw_corpus | raw_corpus | .then (child) ->
child.read(childSelector).should.eventually.eql(value)
@When /^I read at the "([^"]*)" index of ul I should see "([^"]*)"$/, (index, expected) ->
new @Widgets.List()
.readAt(+index-1)
.should.eventually.eql(expected)
@When /^I read at the "([^"]*)" child "([^"]*)" within "([^"]*... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 54 | 103 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:completion | completion | .then (child) ->
child.read(childSelector).should.eventually.eql(value)
@When /^I read at the "([^"]*)" index of ul I should see "([^"]*)"$/, (index, expected) ->
new @Widgets.List()
.readAt(+index-1)
.should.eventually.eql(expected)
@When /^I read at the "([^"]*)" child "([^"]*)" within "([^"]*... | .then (item) ->
item.click()
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@When /^I click at the "([^"]*)" index of "([^"]*)" I should read "([^"]*)"$/, (index, selector, expected) ->
_this = this
new @Widgets.... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 54 | 103 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | .clickAt({
index: index - 1,
selector: selector
})
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
in... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 104 | 153 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | .clickAt({
index: index - 1,
selector: selector
})
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
in... | })
.should.eventually.eql("JOHN CRICHTON")
@When /^I click on each item in the list$/, ->
new @Widgets.List({root: "ul.click-list"}).clickEach()
@Then /^I should see that each list item was clicked$/, ->
new @Widgets.List({root: "ul.click-list"}).map((item) ->
item.read()
).should.eventually... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 104 | 153 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:raw_corpus | raw_corpus | transformer: (val) -> return val.toUpperCase()
selector: "p"
}]
}).should.eventually.eql(["ORC", "HUMAN", "PROTOSS"])
@Given /^I can check the visibility on a list's items$/, ->
new @Widgets.List({
root: ".nested",
itemSelector: "span"
})
.map (w) ->
w.isVisible()
... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 154 | 167 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:completion | completion | transformer: (val) -> return val.toUpperCase()
selector: "p"
}]
}).should.eventually.eql(["ORC", "HUMAN", "PROTOSS"])
@Given /^I can check the visibility on a list's items$/, ->
new @Widgets.List({ | root: ".nested",
itemSelector: "span"
})
.map (w) ->
w.isVisible()
.should.eventually
.eql([true, true, true]) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 88e8e6be888224a2ad31716f54308e97cb39400c | 523 | https://github.com/mojotech/pioneer/blob/88e8e6be888224a2ad31716f54308e97cb39400c/test/integration/steps/list_steps.coffee | 154 | 167 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 3 | 52 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @W... | module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/, function(content, position) {
return new this.Wid... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/... | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | new @Widgets.List().toHtml()
@When /^I find with "([^"]*)" I should see "([^"]*)"$/, (string, content) ->
new @Widgets.List().findBy(string)
.then (item) -> item.getHtml()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" within "([^"]*)" I should see (\d+) items$/, (itemSelector, root, cou... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:raw_corpus | raw_corpus | .should.eventually.eql(expected)
@When /^I read at the "([^"]*)" child "([^"]*)" within "([^"]*)" inside "([^"]*)" I should see "([^"]*)"$/, (index, itemSelector, root, childSelector, expected) ->
new @Widgets.List({
root: root
itemSelector: itemSelector
})
.readAt({
index: +index-1,
... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 53 | 102 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:completion | completion | .should.eventually.eql(expected)
@When /^I read at the "([^"]*)" child "([^"]*)" within "([^"]*)" inside "([^"]*)" I should see "([^"]*)"$/, (index, itemSelector, root, childSelector, expected) ->
new @Widgets.List({
root: root
itemSelector: itemSelector
})
.readAt({
index: +index-1,
... | .read()
.should.eventually.eql(expected)
@When /^I click at the "([^"]*)" index of "([^"]*)" I should read "([^"]*)"$/, (index, selector, expected) ->
_this = this
new @Widgets.List({
root: selector
})
.clickAt(index - 1)
.then ->
new _this.Widget({
root: '#onSubmit'
... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 53 | 102 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
index: 4,
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@Give... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 103 | 152 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
index: 4,
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@Give... | @Then /^I should see that each list item was clicked$/, ->
new @Widgets.List({root: "ul.click-list"}).map((item) ->
item.read()
).should.eventually.eql(["clicked", "clicked", "clicked"])
@Given /^I can invoke click on each widget in the list$/, ->
new @Widgets.List({root: "ul.click-list"}).invoke('... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 103 | 152 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:raw_corpus | raw_corpus | new @Widgets.List({
root: ".nested",
itemSelector: "span"
})
.map (w) ->
w.isVisible()
.should.eventually
.eql([true, true, true]) | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 153 | 160 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
new @Widgets.List({
root: ".nested",
itemSelector: "span"
})
.map (w) ->
w.isVisible()
.should.eventually
.eql([true, true, true])
``` | new this.Widgets.List({
root: ".nested",
itemSelector: "span"
}).map(function(w) {
return w.isVisible();
}).should.eventually.eql([true, true, true]); | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 153 | 160 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
new this.Widgets.List({
root: ".nested",
itemSelector: "span"
}).map(function(w) {
return w.isVisible();
}).should.eventually.eql([true, true, true]);
``` | new @Widgets.List({
root: ".nested",
itemSelector: "span"
})
.map (w) ->
w.isVisible()
.should.eventually
.eql([true, true, true]) | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 153 | 160 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:4:completion | completion | new @Widgets.List({
root: ".nested",
itemSelector: "span"
}) | .map (w) ->
w.isVisible()
.should.eventually
.eql([true, true, true]) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 2975fcbbc8a9de303364729c24454a63c0aa0c49 | 523 | https://github.com/mojotech/pioneer/blob/2975fcbbc8a9de303364729c24454a63c0aa0c49/test/integration/steps/list_steps.coffee | 153 | 160 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
index: 4,
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@Give... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 9fac11c88b8833b75947ad342fdfa74e1ebbaf7b | 523 | https://github.com/mojotech/pioneer/blob/9fac11c88b8833b75947ad342fdfa74e1ebbaf7b/test/integration/steps/list_steps.coffee | 103 | 150 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
index: 4,
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@Give... | @Then /^I should see that each list item was clicked$/, ->
new @Widgets.List({root: "ul.click-list"}).map((item) ->
item.read()
).should.eventually.eql(["clicked", "clicked", "clicked"])
@Given /^I can invoke click on each widget in the list$/, ->
new @Widgets.List({root: "ul.click-list"}).invoke('... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 9fac11c88b8833b75947ad342fdfa74e1ebbaf7b | 523 | https://github.com/mojotech/pioneer/blob/9fac11c88b8833b75947ad342fdfa74e1ebbaf7b/test/integration/steps/list_steps.coffee | 103 | 150 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
index: 4,
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@Give... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/test/integration/steps/list_steps.coffee | 103 | 137 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@Given /^I should be able to read and transform a list item at an index$/, ->
new @Widgets.List()
.readAt({
index: 4,
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@Give... | selector: "p",
transformer: (val) -> val.toUpperCase()
})
.should.eventually.eql("JOHN CRICHTON")
@When /^I click on each item in the list$/, ->
new @Widgets.List({root: "ul.click-list"}).clickEach()
@Then /^I should see that each list item was clicked$/, ->
new @Widgets.List({root: "ul.clic... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/test/integration/steps/list_steps.coffee | 103 | 137 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:raw_corpus | raw_corpus | .should.eventually.eql(expected)
@When /^I read at the "([^"]*)" child "([^"]*)" within "([^"]*)" inside "([^"]*)" I should see "([^"]*)"$/, (index, itemSelector, root, childSelector, expected) ->
new @Widgets.List({
root: root
itemSelector: itemSelector
})
.readAt(+index-1, childSelector)
... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/list_steps.coffee | 53 | 102 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:completion | completion | .should.eventually.eql(expected)
@When /^I read at the "([^"]*)" child "([^"]*)" within "([^"]*)" inside "([^"]*)" I should see "([^"]*)"$/, (index, itemSelector, root, childSelector, expected) ->
new @Widgets.List({
root: root
itemSelector: itemSelector
})
.readAt(+index-1, childSelector)
... | @When /^I click at the "([^"]*)" index of "([^"]*)" I should read "([^"]*)"$/, (index, selector, expected) ->
_this = this
new @Widgets.List({
root: selector
})
.clickAt(index - 1)
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(e... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/list_steps.coffee | 53 | 102 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | new @Widgets.List()
.readAt(4, (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
@Given /^I should be able to read with a subselector and transform an item at an index$/, ->
new @Widgets.List()
.readAt(4, "p", (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/list_steps.coffee | 103 | 124 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | new @Widgets.List()
.readAt(4, (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
@Given /^I should be able to read with a subselector and transform an item at an index$/, ->
new @Widgets.List()
.readAt(4, "p", (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
... | @Then /^I should see that each list item was clicked$/, ->
new @Widgets.List({root: "ul.click-list"}).map((item) ->
item.read()
).should.eventually.eql(["clicked", "clicked", "clicked"])
@Given /^I can invoke click on each widget in the list$/, ->
new @Widgets.List({root: "ul.click-list"}).invoke('... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 057253586504292edd1dbdfd39bf2c79f434a459 | 523 | https://github.com/mojotech/pioneer/blob/057253586504292edd1dbdfd39bf2c79f434a459/test/integration/steps/list_steps.coffee | 103 | 124 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | new @Widgets.List()
.readAt(4, (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
@Given /^I should be able to read with a subselector and transform an item at an index$/, ->
new @Widgets.List()
.readAt(4, "p", (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | dece8918637eb70738123e43e1f968d01129ecc3 | 523 | https://github.com/mojotech/pioneer/blob/dece8918637eb70738123e43e1f968d01129ecc3/test/integration/steps/list_steps.coffee | 101 | 116 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | new @Widgets.List()
.readAt(4, (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
@Given /^I should be able to read with a subselector and transform an item at an index$/, ->
new @Widgets.List()
.readAt(4, "p", (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON") | @When /^I click on each item in the list$/, ->
new @Widgets.List({root: "ul.click-list"}).clickEach()
@Then /^I should see that each list item was clicked$/, ->
new @Widgets.List({root: "ul.click-list"}).map((item) ->
item.read()
).should.eventually.eql(["clicked", "clicked", "clicked"]) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | dece8918637eb70738123e43e1f968d01129ecc3 | 523 | https://github.com/mojotech/pioneer/blob/dece8918637eb70738123e43e1f968d01129ecc3/test/integration/steps/list_steps.coffee | 101 | 116 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:raw_corpus | raw_corpus | new @Widgets.List()
.readAt(4, (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON")
@Given /^I should be able to read with a subselector and transform an item at an index$/, ->
new @Widgets.List()
.readAt(4, "p", (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON") | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | e2e2fc4f69421acece4718735a4a054c39d1c8e1 | 523 | https://github.com/mojotech/pioneer/blob/e2e2fc4f69421acece4718735a4a054c39d1c8e1/test/integration/steps/list_steps.coffee | 101 | 108 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:3:completion | completion | new @Widgets.List()
.readAt(4, (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON") | @Given /^I should be able to read with a subselector and transform an item at an index$/, ->
new @Widgets.List()
.readAt(4, "p", (val) -> val.toUpperCase())
.should.eventually.eql("JOHN CRICHTON") | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | e2e2fc4f69421acece4718735a4a054c39d1c8e1 | 523 | https://github.com/mojotech/pioneer/blob/e2e2fc4f69421acece4718735a4a054c39d1c8e1/test/integration/steps/list_steps.coffee | 101 | 108 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | db403007ddffb40c8664b86f6cf618149ef5bb48 | 523 | https://github.com/mojotech/pioneer/blob/db403007ddffb40c8664b86f6cf618149ef5bb48/test/integration/steps/list_steps.coffee | 1 | 50 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | new @Widgets.List().toHtml()
@When /^I find with "([^"]*)" I should see "([^"]*)"$/, (string, content) ->
new @Widgets.List().findBy(string)
.then (item) -> item.getHtml()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" within "([^"]*)" I should see (\d+) items$/, (itemSelector, root, cou... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | db403007ddffb40c8664b86f6cf618149ef5bb48 | 523 | https://github.com/mojotech/pioneer/blob/db403007ddffb40c8664b86f6cf618149ef5bb48/test/integration/steps/list_steps.coffee | 1 | 50 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:raw_corpus | raw_corpus | root: rootSelector
})
.at(index - 1)
.then (item) ->
item.click()
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@When /^I click at the "([^"]*)" index of "([^"]*)" I should read "([^"]*)"$/, (index, selector... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | db403007ddffb40c8664b86f6cf618149ef5bb48 | 523 | https://github.com/mojotech/pioneer/blob/db403007ddffb40c8664b86f6cf618149ef5bb48/test/integration/steps/list_steps.coffee | 51 | 85 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:completion | completion | root: rootSelector
})
.at(index - 1)
.then (item) ->
item.click()
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@When /^I click at the "([^"]*)" index of "([^"]*)" I should read "([^"]*)"$/, (index, selector... | .clickAt(index - 1)
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected)
@When /^I click at the "([^"]*)" index with selector "([^"]*)" I should read "([^"]*)"$/, (index, selector, expected) ->
_this = this
new @widgets.List()
.clic... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | db403007ddffb40c8664b86f6cf618149ef5bb48 | 523 | https://github.com/mojotech/pioneer/blob/db403007ddffb40c8664b86f6cf618149ef5bb48/test/integration/steps/list_steps.coffee | 51 | 85 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:raw_corpus | raw_corpus | root: rootSelector
})
.at(index - 1)
.then (item) ->
item.click()
.then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected) | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 9ff71e055b84572250c3a8ceadb718b923845433 | 523 | https://github.com/mojotech/pioneer/blob/9ff71e055b84572250c3a8ceadb718b923845433/test/integration/steps/list_steps.coffee | 51 | 61 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:2:completion | completion | root: rootSelector
})
.at(index - 1)
.then (item) ->
item.click() | .then ->
new _this.Widget({
root: '#onSubmit'
})
.read()
.should.eventually.eql(expected) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 9ff71e055b84572250c3a8ceadb718b923845433 | 523 | https://github.com/mojotech/pioneer/blob/9ff71e055b84572250c3a8ceadb718b923845433/test/integration/steps/list_steps.coffee | 51 | 61 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/test/integration/steps/list_steps.coffee | 1 | 46 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @W... | module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/, function(content, position) {
return new this.Wid... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/test/integration/steps/list_steps.coffee | 1 | 46 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/... | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/test/integration/steps/list_steps.coffee | 1 | 46 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | @Then /^I should see stuff$/, (table) ->
new @Widgets.List().toHtml()
@When /^I find with "([^"]*)" I should see "([^"]*)"$/, (string, content) ->
new @Widgets.List().findBy(string)
.then (item) -> item.getHtml()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" within "([^"]*)" I shoul... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | c3429e8a05273df6ec4fb109e5e734e05fa1f93b | 523 | https://github.com/mojotech/pioneer/blob/c3429e8a05273df6ec4fb109e5e734e05fa1f93b/test/integration/steps/list_steps.coffee | 1 | 46 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/test/integration/steps/list_steps.coffee | 1 | 31 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @W... | module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/, function(content, position) {
return new this.Wid... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/test/integration/steps/list_steps.coffee | 1 | 31 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/... | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/test/integration/steps/list_steps.coffee | 1 | 31 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | @When /^I filter by "([^"]*)" I should see "([^"]*)" element$/, (string, count) ->
new @Widgets.List().filterBy(string)
.should.eventually.have.length(count)
@Then /^I should see the following list:$/, (table) ->
new @Widgets.List().toArray()
.should.eventually.eql(_.flatten(table.raw()))
@Then /^... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 03faf4e776410540453003ebcfe77db5f5347774 | 523 | https://github.com/mojotech/pioneer/blob/03faf4e776410540453003ebcfe77db5f5347774/test/integration/steps/list_steps.coffee | 1 | 31 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 7910326f39f4a7fc35757d8cd22a929255638771 | 523 | https://github.com/mojotech/pioneer/blob/7910326f39f4a7fc35757d8cd22a929255638771/test/integration/steps/list_steps.coffee | 1 | 26 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @W... | module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/, function(content, position) {
return new this.Wid... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 7910326f39f4a7fc35757d8cd22a929255638771 | 523 | https://github.com/mojotech/pioneer/blob/7910326f39f4a7fc35757d8cd22a929255638771/test/integration/steps/list_steps.coffee | 1 | 26 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/... | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 7910326f39f4a7fc35757d8cd22a929255638771 | 523 | https://github.com/mojotech/pioneer/blob/7910326f39f4a7fc35757d8cd22a929255638771/test/integration/steps/list_steps.coffee | 1 | 26 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().at(+position-1)
.then (item) -> item.fi... | .then (item) -> item.getHtml()
.should.eventually.equal(content)
@When /^I filter by "([^"]*)" I should see "([^"]*)" element$/, (string, count) ->
new @Widgets.List().filterBy(string)
.should.eventually.have.length(count)
@Then /^I should see the following list:$/, (table) ->
new @Widgets.List().... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | 7910326f39f4a7fc35757d8cd22a929255638771 | 523 | https://github.com/mojotech/pioneer/blob/7910326f39f4a7fc35757d8cd22a929255638771/test/integration/steps/list_steps.coffee | 1 | 26 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().items()
.then (items) -> items[+positio... | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | a571d736532744849c01011d25ce1fadbb5b27cf | 523 | https://github.com/mojotech/pioneer/blob/a571d736532744849c01011d25ce1fadbb5b27cf/test/integration/steps/list_steps.coffee | 1 | 26 | ||
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @W... | module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/, function(content, position) {
return new this.Wid... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | a571d736532744849c01011d25ce1fadbb5b27cf | 523 | https://github.com/mojotech/pioneer/blob/a571d736532744849c01011d25ce1fadbb5b27cf/test/integration/steps/list_steps.coffee | 1 | 26 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Given(/^I should see "([^"]*)" items in a list$/, function(count) {
return new this.Widgets.List().items().should.eventually.have.length(count);
});
this.Given(/^I should see "([^"]*)" in position "([^"]*)" of the list$/... | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().items()
.then (items) -> items[+positio... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | a571d736532744849c01011d25ce1fadbb5b27cf | 523 | https://github.com/mojotech/pioneer/blob/a571d736532744849c01011d25ce1fadbb5b27cf/test/integration/steps/list_steps.coffee | 1 | 26 |
mojotech/pioneer:test/integration/steps/list_steps.coffee:1:completion | completion | module.exports = ->
@Given /^I should see "([^"]*)" items in a list$/, (count) ->
new @Widgets.List().items()
.should.eventually.have.length(count)
@Given /^I should see "([^"]*)" in position "([^"]*)" of the list$/, (content, position) ->
new @Widgets.List().items()
.then (items) -> items[+positio... | .then (items) -> items[+position-1].getHtml()
.should.eventually.equal(content)
@When /^I filter by "([^"]*)" I should see "([^"]*)" element$/, (string, count) ->
new @Widgets.List().filterBy(string)
.should.eventually.have.length(count)
@Then /^I should see the following list:$/, (table) ->
new @... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/list_steps.coffee | MIT | a571d736532744849c01011d25ce1fadbb5b27cf | 523 | https://github.com/mojotech/pioneer/blob/a571d736532744849c01011d25ce1fadbb5b27cf/test/integration/steps/list_steps.coffee | 1 | 26 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:raw_corpus | raw_corpus | module.exports = class Descriptor
# Creates a new Descriptor.
constructor: (@file) ->
# The object that will store the resulting data.
@data = {}
# Parses the Descriptor at the current location in the file.
parse: ->
@data.class = @parseClass()
# The descriptor defines the number of items it c... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 6 | 55 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class Descriptor
# Creates a new Descriptor.
constructor: (@file) ->
# The object that will store the resulting data.
@data = {}
# Parses the Descriptor at the current location in the file.
parse: ->
@data.class = @parseClass... | var Descriptor;
module.exports = Descriptor = class Descriptor {
// Creates a new Descriptor.
constructor(file) {
this.file = file;
// The object that will store the resulting data.
this.data = {};
}
// Parses the Descriptor at the current location in the file.
parse() {
var i, id, j, numIte... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 6 | 55 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Descriptor;
module.exports = Descriptor = class Descriptor {
// Creates a new Descriptor.
constructor(file) {
this.file = file;
// The object that will store the resulting data.
this.data = {};
}
// Parses the Descriptor at the current loc... | module.exports = class Descriptor
# Creates a new Descriptor.
constructor: (@file) ->
# The object that will store the resulting data.
@data = {}
# Parses the Descriptor at the current location in the file.
parse: ->
@data.class = @parseClass()
# The descriptor defines the number of items it c... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 6 | 55 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:completion | completion | module.exports = class Descriptor
# Creates a new Descriptor.
constructor: (@file) ->
# The object that will store the resulting data.
@data = {}
# Parses the Descriptor at the current location in the file.
parse: ->
@data.class = @parseClass()
# The descriptor defines the number of items it c... | # Parses a class representation, which consists of a name and a unique ID.
parseClass: ->
name: @file.readUnicodeString()
id: @parseId()
# Parses an ID, which is a unique String.
parseId: ->
len = @file.readInt()
if len is 0 then @file.readString(4) else @file.readString(len)
# Parses a key/it... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 6 | 55 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:raw_corpus | raw_corpus | when 'enum' then @parseEnum()
when 'alis' then @parseAlias()
when 'Pth' then @parseFilePath()
when 'long' then @parseInteger()
when 'comp' then @parseLargeInteger()
when 'VlLs' then @parseList()
when 'ObAr' then @parseObjectArr... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 56 | 105 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:2:completion | completion | when 'enum' then @parseEnum()
when 'alis' then @parseAlias()
when 'Pth' then @parseFilePath()
when 'long' then @parseInteger()
when 'comp' then @parseLargeInteger()
when 'VlLs' then @parseList()
when 'ObAr' then @parseObjectArr... | id: @parseId()
# Parses an enumerator, which consists of 2 IDs, one of which is
# the type, and the other is the value.
parseEnum: ->
type: @parseId()
value: @parseId()
# Parses an enumerator reference, which consists of a class and
# 2 IDs: a type and value.
parseEnumReference: ->
class: @par... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 56 | 105 |
meltingice/psd.js:lib/psd/descriptor.coffee:3:raw_corpus | raw_corpus | # Little endian. Who knows.
pathSize = @file.read('<i')
numChars = @file.read('<i')
path = @file.readUnicodeString(numChars)
sig: sig
path: path
# Parses a list/array of Items.
parseList: ->
count = @file.readInt()
items = []
for i in [0...count]
items.push @parseItem()
... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 106 | 155 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:3:completion | completion | # Little endian. Who knows.
pathSize = @file.read('<i')
numChars = @file.read('<i')
path = @file.readUnicodeString(numChars)
sig: sig
path: path
# Parses a list/array of Items.
parseList: ->
count = @file.readInt()
items = []
for i in [0...count]
items.push @parseItem()
... | # Parses raw byte data of arbitrary length.
parseRawData: ->
len = @file.readInt()
@file.read(len)
# Parses a Reference, which is an array of items of multiple types.
parseReference: ->
numItems = @file.readInt()
items = []
for i in [0...numItems]
type = @file.readString(4)
value... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 106 | 155 |
meltingice/psd.js:lib/psd/descriptor.coffee:4:raw_corpus | raw_corpus | # Parses a double with a unit, such as angle, percent, pixels, etc.
# Returns an object with an ID, a unit, and a value.
parseUnitDouble: ->
unitId = @file.readString(4)
unit = switch unitId
when '#Ang' then 'Angle'
when '#Rsl' then 'Density'
when '#Rlt' then 'Distance'
when '#Nne' t... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 156 | 188 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Parses a double with a unit, such as angle, percent, pixels, etc.
# Returns an object with an ID, a unit, and a value.
parseUnitDouble: ->
unitId = @file.readString(4)
unit = switch unitId
when '#Ang' then 'Angle'
when '#Rsl' then 'Densi... | // Parses a double with a unit, such as angle, percent, pixels, etc.
// Returns an object with an ID, a unit, and a value.
({
parseUnitDouble: function() {
var unit, unitId, value;
unitId = this.file.readString(4);
unit = (function() {
switch (unitId) {
case '#Ang':
return 'Angle';... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 156 | 188 |
meltingice/psd.js:lib/psd/descriptor.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Parses a double with a unit, such as angle, percent, pixels, etc.
// Returns an object with an ID, a unit, and a value.
({
parseUnitDouble: function() {
var unit, unitId, value;
unitId = this.file.readString(4);
unit = (function() {
switch (u... | # Parses a double with a unit, such as angle, percent, pixels, etc.
# Returns an object with an ID, a unit, and a value.
parseUnitDouble: ->
unitId = @file.readString(4)
unit = switch unitId
when '#Ang' then 'Angle'
when '#Rsl' then 'Density'
when '#Rlt' then 'Distance'
when '#Nne' t... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 156 | 188 |
meltingice/psd.js:lib/psd/descriptor.coffee:4:completion | completion | # Parses a double with a unit, such as angle, percent, pixels, etc.
# Returns an object with an ID, a unit, and a value.
parseUnitDouble: ->
unitId = @file.readString(4)
unit = switch unitId
when '#Ang' then 'Angle'
when '#Rsl' then 'Density'
when '#Rlt' then 'Distance'
when '#Nne' t... | # Parses a float with a unit, such as angle, percent, pixels, etc.
# Returns an object with an ID, a unit, and a value.
parseUnitFloat: ->
unitId = @file.readString(4)
unit = switch unitId
when '#Ang' then 'Angle'
when '#Rsl' then 'Density'
when '#Rlt' then 'Distance'
when '#Nne' the... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 7e8392d20fd5d66ad70ddda7309661b9a0ca67c8 | 2,846 | https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/descriptor.coffee | 156 | 188 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:raw_corpus | raw_corpus | module.exports = class Descriptor
constructor: (@file) ->
@data = {}
parse: ->
@data.class = @parseClass()
numItems = @file.readInt()
for i in [0...numItems]
[id, value] = @parseKeyItem()
@data[id] = value
@data
parseClass: ->
name: @file.readUnicodeString()
id: @parseI... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 1 | 50 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class Descriptor
constructor: (@file) ->
@data = {}
parse: ->
@data.class = @parseClass()
numItems = @file.readInt()
for i in [0...numItems]
[id, value] = @parseKeyItem()
@data[id] = value
@data
parseClas... | var Descriptor;
module.exports = Descriptor = class Descriptor {
constructor(file) {
this.file = file;
this.data = {};
}
parse() {
var i, id, j, numItems, ref, value;
this.data.class = this.parseClass();
numItems = this.file.readInt();
for (i = j = 0, ref = numItems; (0 <= ref ? j < ref ... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Descriptor;
module.exports = Descriptor = class Descriptor {
constructor(file) {
this.file = file;
this.data = {};
}
parse() {
var i, id, j, numItems, ref, value;
this.data.class = this.parseClass();
numItems = this.file.readInt();
... | module.exports = class Descriptor
constructor: (@file) ->
@data = {}
parse: ->
@data.class = @parseClass()
numItems = @file.readInt()
for i in [0...numItems]
[id, value] = @parseKeyItem()
@data[id] = value
@data
parseClass: ->
name: @file.readUnicodeString()
id: @parseI... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:completion | completion | module.exports = class Descriptor
constructor: (@file) ->
@data = {}
parse: ->
@data.class = @parseClass()
numItems = @file.readInt()
for i in [0...numItems]
[id, value] = @parseKeyItem()
@data[id] = value
@data
parseClass: ->
name: @file.readUnicodeString()
id: @parseI... | return [id, value]
parseItem: (type = null) ->
type = @file.readString(4) unless type?
switch type
when 'bool' then @parseBoolean()
when 'type', 'GlbC' then @parseClass()
when 'Objc', 'GlbO' then new Descriptor(@file).parse()
when 'doub' then @parseDouble()
when... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:raw_corpus | raw_corpus | parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: ->
type: @parseId()
value: @parseId()
parseEnum... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 51 | 100 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: -... | ({
parseInteger: function() {
return this.file.readInt()({
parseLargeInteger: function() {
return this.file.readLongLong();
},
parseIdentifier: function() {
return this.file.readInt();
},
parseIndex: function() {
return this.file.readInt();
},
pars... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 51 | 100 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
parseInteger: function() {
return this.file.readInt()({
parseLargeInteger: function() {
return this.file.readLongLong();
},
parseIdentifier: function() {
return this.file.readInt();
},
parseIndex: function() {
... | parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: ->
type: @parseId()
value: @parseId()
parseEnum... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 51 | 100 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:completion | completion | parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: ->
type: @parseId()
value: @parseId()
parseEnum... | sig = @file.readString(4)
# Little endian
pathSize = @file.read('<i')
numChars = @file.read('<i')
path = @file.readUnicodeString(numChars)
sig: sig
path: path
parseList: ->
count = @file.readInt()
items = []
for i in [0...count]
items.push @parseItem()
items
pars... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 51 | 100 |
meltingice/psd.js:lib/psd/descriptor.coffee:3:raw_corpus | raw_corpus | @file.read(len)
parseReference: ->
numItems = @file.readInt()
items = []
for i in [0...numItems]
type = @file.readString(4)
value = switch type
when 'prop' then @parseProperty()
when 'Clss' then @parseClass()
when 'Enmr' then @parseEnumReference()
when 'Idnt' ... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 101 | 150 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@file.read(len)
parseReference: ->
numItems = @file.readInt()
items = []
for i in [0...numItems]
type = @file.readString(4)
value = switch type
when 'prop' then @parseProperty()
when 'Clss' then @parseClass()
wh... | this.file.read(len)({
parseReference: function() {
var i, items, j, numItems, ref, type, value;
numItems = this.file.readInt();
items = [];
for (i = j = 0, ref = numItems; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {
type = this.file.readString(4);
value = (function() {
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 101 | 150 |
meltingice/psd.js:lib/psd/descriptor.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.file.read(len)({
parseReference: function() {
var i, items, j, numItems, ref, type, value;
numItems = this.file.readInt();
items = [];
for (i = j = 0, ref = numItems; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {
type = th... | @file.read(len)
parseReference: ->
numItems = @file.readInt()
items = []
for i in [0...numItems]
type = @file.readString(4)
value = switch type
when 'prop' then @parseProperty()
when 'Clss' then @parseClass()
when 'Enmr' then @parseEnumReference()
when 'Idnt' ... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 101 | 150 |
meltingice/psd.js:lib/psd/descriptor.coffee:3:completion | completion | @file.read(len)
parseReference: ->
numItems = @file.readInt()
items = []
for i in [0...numItems]
type = @file.readString(4)
value = switch type
when 'prop' then @parseProperty()
when 'Clss' then @parseClass()
when 'Enmr' then @parseEnumReference()
when 'Idnt' ... | when '#Rsl' then 'Density'
when '#Rlt' then 'Distance'
when '#Nne' then 'None'
when '#Prc' then 'Percent'
when '#Pxl' then 'Pixels'
when '#Mlm' then 'Millimeters'
when '#Pnt' then 'Points'
value = @file.readDouble()
id: unitId, unit: unit, value: value
parseUnitFloat: ->
... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12 | 2,846 | https://github.com/meltingice/psd.js/blob/fe58a3f6fa9a1e64285d4e2bd25dfb5767734e12/lib/psd/descriptor.coffee | 101 | 150 |
meltingice/psd.js:lib/psd/descriptor.coffee:1:raw_corpus | raw_corpus | module.exports = class Descriptor
constructor: (@file) ->
@data = {}
parse: ->
@data.class = @parseClass()
numItems = @file.readInt()
for i in [0...numItems]
id, value = @parseKeyItem()
@data[id] = value
@data
parseClass: ->
name: @file.readUnicodeString()
id: @parseId(... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 8e965273dce597723ea1d151740c53c4d9cde8e9 | 2,846 | https://github.com/meltingice/psd.js/blob/8e965273dce597723ea1d151740c53c4d9cde8e9/lib/psd/descriptor.coffee | 1 | 50 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:1:completion | completion | module.exports = class Descriptor
constructor: (@file) ->
@data = {}
parse: ->
@data.class = @parseClass()
numItems = @file.readInt()
for i in [0...numItems]
id, value = @parseKeyItem()
@data[id] = value
@data
parseClass: ->
name: @file.readUnicodeString()
id: @parseId(... | return id, value
parseItem: (type = null) ->
type = @file.readString(4) unless type?
switch type
when 'bool' then @parseBoolean()
when 'type', 'GlbC' then @parseClass()
when 'Objc', 'GlbO' then new Descriptor(@file).parse()
when 'doub' then @parseDouble()
when '... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 8e965273dce597723ea1d151740c53c4d9cde8e9 | 2,846 | https://github.com/meltingice/psd.js/blob/8e965273dce597723ea1d151740c53c4d9cde8e9/lib/psd/descriptor.coffee | 1 | 50 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:raw_corpus | raw_corpus | parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: ->
type: @parseId()
value: @parseId()
parseEnum... | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 8e965273dce597723ea1d151740c53c4d9cde8e9 | 2,846 | https://github.com/meltingice/psd.js/blob/8e965273dce597723ea1d151740c53c4d9cde8e9/lib/psd/descriptor.coffee | 51 | 96 | ||
meltingice/psd.js:lib/psd/descriptor.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: -... | ({
parseInteger: function() {
return this.file.readInt()({
parseLargeInteger: function() {
return this.file.readLongLong();
},
parseIdentifier: function() {
return this.file.readInt();
},
parseIndex: function() {
return this.file.readInt();
},
pars... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 8e965273dce597723ea1d151740c53c4d9cde8e9 | 2,846 | https://github.com/meltingice/psd.js/blob/8e965273dce597723ea1d151740c53c4d9cde8e9/lib/psd/descriptor.coffee | 51 | 96 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
parseInteger: function() {
return this.file.readInt()({
parseLargeInteger: function() {
return this.file.readLongLong();
},
parseIdentifier: function() {
return this.file.readInt();
},
parseIndex: function() {
... | parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: ->
type: @parseId()
value: @parseId()
parseEnum... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 8e965273dce597723ea1d151740c53c4d9cde8e9 | 2,846 | https://github.com/meltingice/psd.js/blob/8e965273dce597723ea1d151740c53c4d9cde8e9/lib/psd/descriptor.coffee | 51 | 96 |
meltingice/psd.js:lib/psd/descriptor.coffee:2:completion | completion | parseInteger: -> @file.readInt()
parseLargeInteger: -> @file.readLongLong()
parseIdentifier: -> @file.readInt()
parseIndex: -> @file.readInt()
parseOffset: -> @file.readInt()
parseProperty: ->
class: @parseClass()
id: @parseId()
parseEnum: ->
type: @parseId()
value: @parseId()
parseEnum... | parseFilePath: ->
len = @file.readInt()
sig = @file.readString(4)
# Little endian
pathSize = @file.read('<i')
numChars = @file.read('<i')
path = @file.readUnicodeString(numChars)
sig: sig
path: path
parseList: ->
count = @file.readInt()
items = []
for i in [0...count]
... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/descriptor.coffee | MIT | 8e965273dce597723ea1d151740c53c4d9cde8e9 | 2,846 | https://github.com/meltingice/psd.js/blob/8e965273dce597723ea1d151740c53c4d9cde8e9/lib/psd/descriptor.coffee | 51 | 96 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 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/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 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-2018 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/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2018 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-2018 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/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 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 ... | obj
# Logs any number of arguments prefixed with the time
writeLog = (args) ->
$window.console.log '[' + now() + '] ' + _.map(args, getString).join ' '
writeError = (args) ->
$window.console.error '[' + now() + '] ' + _.map(args, getString).join ' '
service = {
debug: ->
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:2:raw_corpus | raw_corpus | if configService.logging?.enableDebug == false
service.debug = -> return
return service | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 51 | 54 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if configService.logging?.enableDebug == false
service.debug = -> return
return service
``` | var ref;
if (((ref = configService.logging) != null ? ref.enableDebug : void 0) === false) {
service.debug = function() {};
}
return service; | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 51 | 54 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ref;
if (((ref = configService.logging) != null ? ref.enableDebug : void 0) === false) {
service.debug = function() {};
}
return service;
``` | if configService.logging?.enableDebug == false
service.debug = -> return
return service | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.logService.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.logService.coffee | 51 | 54 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.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/common/services/services.logService.coffee | MIT | 31207fc23b89c9a0e232c38d9cf4c24f9e247f4b | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/31207fc23b89c9a0e232c38d9cf4c24f9e247f4b/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.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/common/services/services.logService.coffee | MIT | 31207fc23b89c9a0e232c38d9cf4c24f9e247f4b | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/31207fc23b89c9a0e232c38d9cf4c24f9e247f4b/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.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/common/services/services.logService.coffee | MIT | 31207fc23b89c9a0e232c38d9cf4c24f9e247f4b | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/31207fc23b89c9a0e232c38d9cf4c24f9e247f4b/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.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 ... | obj
# Logs any number of arguments prefixed with the time
writeLog = (args) ->
$window.console.log '[' + now() + '] ' + _.map(args, getString).join ' '
writeError = (args) ->
$window.console.error '[' + now() + '] ' + _.map(args, getString).join ' '
service = {
debug: ->
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/common/services/services.logService.coffee | MIT | 31207fc23b89c9a0e232c38d9cf4c24f9e247f4b | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/31207fc23b89c9a0e232c38d9cf4c24f9e247f4b/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.logService.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/common/services/services.logService.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/scripts/common/services/services.logService.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.