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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus | raw_corpus | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-])*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
''... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 52 | 101 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-])*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: ... | if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' + val || '';
},
dtdSysID: function(val) {
return ... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' + ... | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-])*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
''... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion | completion | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-])*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
''... | convertCommentKey: '#comment'
convertRawKey: '#raw'
# Checks whether the given string contains legal characters
# Fails with an exception on error
#
# `str` the string to check
assertLegalChar: (str) =>
# Valid characters from https://www.w3.org/TR/xml11/#charsets
# any Unicode character, excludin... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus | raw_corpus | # `str` the string to escape
elEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 102 | 122 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# `str` the string to escape
elEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special ... | // `str` the string to escape
({
elEscape: function(str) {
var ampregex;
ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
return str.replace(ampregex, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\r/g, '
');
},
// Escapes special characters in attribute values
// See ht... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 102 | 122 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// `str` the string to escape
({
elEscape: function(str) {
var ampregex;
ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
return str.replace(ampregex, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\r/g, '
');
},
// Esca... | # `str` the string to escape
elEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 102 | 122 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion | completion | # `str` the string to escape
elEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
# | # See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
#
# `str` the string to escape
attEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/"/g, '"')
.replace(/\t/g, '	'... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | bbf929a8a54f0d012bdc44cbe622fdeda2509230 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee | 102 | 122 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus | raw_corpus | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 0cdd3f2382b6fdc5445474282b66ca3c901eda74 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/0cdd3f2382b6fdc5445474282b66ca3c901eda74/src/XMLStringifier.coffee | 52 | 101 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue... | if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' + val || '';
},
dtdSysID: function(val) {
retur... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 0cdd3f2382b6fdc5445474282b66ca3c901eda74 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/0cdd3f2382b6fdc5445474282b66ca3c901eda74/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' ... | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 0cdd3f2382b6fdc5445474282b66ca3c901eda74 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/0cdd3f2382b6fdc5445474282b66ca3c901eda74/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion | completion | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | convertCommentKey: '#comment'
convertRawKey: '#raw'
# Checks whether the given string contains legal characters
# Fails with an exception on error
#
# `str` the string to check
assertLegalChar: (str) =>
# Valid characters from https://www.w3.org/TR/xml11/#charsets
# any Unicode character, excludin... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 0cdd3f2382b6fdc5445474282b66ca3c901eda74 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/0cdd3f2382b6fdc5445474282b66ca3c901eda74/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus | raw_corpus | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 37731d9b6f29e7a2e12cb45679e9241055cd9af1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/37731d9b6f29e7a2e12cb45679e9241055cd9af1/src/XMLStringifier.coffee | 52 | 101 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue... | if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' + val || '';
},
dtdSysID: function(val) {
retur... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 37731d9b6f29e7a2e12cb45679e9241055cd9af1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/37731d9b6f29e7a2e12cb45679e9241055cd9af1/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' ... | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 37731d9b6f29e7a2e12cb45679e9241055cd9af1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/37731d9b6f29e7a2e12cb45679e9241055cd9af1/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion | completion | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | convertCommentKey: '#comment'
convertRawKey: '#raw'
# Checks whether the given string contains legal characters
# Fails with an exception on error
#
# `str` the string to check
assertLegalChar: (str) =>
# Valid characters from https://www.w3.org/TR/xml11/#charsets
# any Unicode character, excludin... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 37731d9b6f29e7a2e12cb45679e9241055cd9af1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/37731d9b6f29e7a2e12cb45679e9241055cd9af1/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus | raw_corpus | ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
#... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 37731d9b6f29e7a2e12cb45679e9241055cd9af1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/37731d9b6f29e7a2e12cb45679e9241055cd9af1/src/XMLStringifier.coffee | 102 | 120 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion | completion | ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping | #
# `str` the string to escape
attEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+;)&/g else /&/g
str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/"/g, '"')
.replace(/\t/g, '	')
.replace(/\n/g, '
')
.replace(/\r/g, '
') | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 37731d9b6f29e7a2e12cb45679e9241055cd9af1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/37731d9b6f29e7a2e12cb45679e9241055cd9af1/src/XMLStringifier.coffee | 102 | 120 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus | raw_corpus | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | b7da010f43dc58e32f0264943ee55c3fcf3e56bd | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b7da010f43dc58e32f0264943ee55c3fcf3e56bd/src/XMLStringifier.coffee | 52 | 101 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue... | if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' + val || '';
},
dtdSysID: function(val) {
retur... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | b7da010f43dc58e32f0264943ee55c3fcf3e56bd | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b7da010f43dc58e32f0264943ee55c3fcf3e56bd/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
val;
({
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID: function(val) {
return '' ... | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | b7da010f43dc58e32f0264943ee55c3fcf3e56bd | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b7da010f43dc58e32f0264943ee55c3fcf3e56bd/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion | completion | if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue: (val) ->
'' + val or ''
dtdAttType: (val) ->
... | convertCommentKey: '#comment'
convertRawKey: '#raw'
# Checks whether the given string contains legal characters
# Fails with an exception on error
#
# `str` the string to check
assertLegalChar: (str) =>
# Valid characters from https://www.w3.org/TR/xml11/#charsets
# any Unicode character, excludin... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | b7da010f43dc58e32f0264943ee55c3fcf3e56bd | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b7da010f43dc58e32f0264943ee55c3fcf3e56bd/src/XMLStringifier.coffee | 52 | 101 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus | raw_corpus | module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use for converting values to strings
constructor: (options) ->
options or= {}
@n... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 4 | 53 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use for converting values to stri... | var XMLStringifier,
hasProp = {}.hasOwnProperty;
module.exports = XMLStringifier = class XMLStringifier {
// Initializes a new instance of `XMLStringifier`
// `options.noDoubleEncoding` whether existing html entities are encoded: true or false
// `options.stringify` a set of functions to use for converting va... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 4 | 53 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLStringifier,
hasProp = {}.hasOwnProperty;
module.exports = XMLStringifier = class XMLStringifier {
// Initializes a new instance of `XMLStringifier`
// `options.noDoubleEncoding` whether existing html entities are encoded: true or false
// `options... | module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use for converting values to strings
constructor: (options) ->
options or= {}
@n... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 4 | 53 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion | completion | module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use for converting values to strings
constructor: (options) ->
options or= {}
@n... | @assertLegalChar val
comment: (val) ->
val = '' + val or ''
if val.match /--/
throw new Error "Comment text cannot contain double-hypen: " + val
@assertLegalChar val
raw: (val) ->
'' + val or ''
attName: (val) ->
val = '' + val or ''
val = @applyCase val
attValue: (val) ->
val ... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 4 | 53 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus | raw_corpus | val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 54 | 103 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
... | val({
xmlEncoding: function(val) {
val = '' + val || '';
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
return val;
},
xmlStandalone: function(val) {
if (val) {
return "yes";
} else {
return "no";
}
},
dtdPubID:... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 54 | 103 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
val({
xmlEncoding: function(val) {
val = '' + val || '';
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
return val;
},
xmlStandalone: function(val) {
if (val) {
return "yes";... | val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 54 | 103 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion | completion | val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubID: (val) ->
'' + val or ''
dtdSysID: (val) ->
'' + val or ''
dtdElementValue... | convertPIKey: '?'
convertTextKey: '#text'
convertCDataKey: '#cdata'
convertCommentKey: '#comment'
convertRawKey: '#raw'
# Checks whether the given string contains legal characters
# Fails with an exception on error
#
# `str` the string to check
assertLegalChar: (str) =>
# Valid characters from h... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 54 | 103 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus | raw_corpus | switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes special characters in element values
#
# See http://w... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 104 | 136 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes ... | switch (this.textCase) {
case "camel":
camelCase(str);
break;
case "title":
titleCase(str);
break;
case "kebab":
case "lower":
kebabCase(str);
break;
case "snake":
snakeCase(str);
break;
case "upper":
kebabCase(str).toUpperCase();
break;
default:
str;
}
({
//... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 104 | 136 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
switch (this.textCase) {
case "camel":
camelCase(str);
break;
case "title":
titleCase(str);
break;
case "kebab":
case "lower":
kebabCase(str);
break;
case "snake":
snakeCase(str);
break;
case "upper":
kebabCase(str).t... | switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes special characters in element values
#
# See http://w... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 104 | 136 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion | completion | switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes special characters in element values
#
# See http://w... | .replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
#
# `str` the string to escape
attEscape: (str) ->
ampregex = if @noDoubleEncoding then /(?!&\S+... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | 1f9b41a7ef5bd3f0f03d57439392d572f0adc189 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/1f9b41a7ef5bd3f0f03d57439392d572f0adc189/src/XMLStringifier.coffee | 104 | 136 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus | raw_corpus | module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.allowSurrogateChars` whether surrogates will be allowed: true or false
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use fo... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 4 | 53 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.allowSurrogateChars` whether surrogates will be allowed: true or false
# `options.noDoubleEncoding` whether existing html entities are encoded: true or f... | var XMLStringifier,
hasProp = {}.hasOwnProperty;
module.exports = XMLStringifier = class XMLStringifier {
// Initializes a new instance of `XMLStringifier`
// `options.allowSurrogateChars` whether surrogates will be allowed: true or false
// `options.noDoubleEncoding` whether existing html entities are encode... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 4 | 53 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLStringifier,
hasProp = {}.hasOwnProperty;
module.exports = XMLStringifier = class XMLStringifier {
// Initializes a new instance of `XMLStringifier`
// `options.allowSurrogateChars` whether surrogates will be allowed: true or false
// `options.noDo... | module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.allowSurrogateChars` whether surrogates will be allowed: true or false
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use fo... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 4 | 53 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion | completion | module.exports = class XMLStringifier
# Initializes a new instance of `XMLStringifier`
#
# `options.allowSurrogateChars` whether surrogates will be allowed: true or false
# `options.noDoubleEncoding` whether existing html entities are encoded: true or false
# `options.stringify` a set of functions to use fo... | val = '' + val or ''
val = val.replace(']]>', ']]]]><![CDATA[>')
@assertLegalChar val
comment: (val) ->
val = '' + val or ''
if val.match /--/
throw new Error "Comment text cannot contain double-hypen: " + val
@assertLegalChar val
raw: (val) ->
'' + val or ''
attName: (val) ->
va... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 4 | 53 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus | raw_corpus | if not val.match /1\.[0-9]+/
throw new Error "Invalid version number: " + val
val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubI... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 54 | 103 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if not val.match /1\.[0-9]+/
throw new Error "Invalid version number: " + val
val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStand... | if (!val.match(/1\.[0-9]+/)) {
throw new Error("Invalid version number: " + val);
}
val;
({
xmlEncoding: function(val) {
val = '' + val || '';
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
}
return val;
},
xmlStandalone: function(val) {... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 54 | 103 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (!val.match(/1\.[0-9]+/)) {
throw new Error("Invalid version number: " + val);
}
val;
({
xmlEncoding: function(val) {
val = '' + val || '';
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
throw new Error("Invalid encoding: " + val);
... | if not val.match /1\.[0-9]+/
throw new Error "Invalid version number: " + val
val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubI... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 54 | 103 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion | completion | if not val.match /1\.[0-9]+/
throw new Error "Invalid version number: " + val
val
xmlEncoding: (val) ->
val = '' + val or ''
if not val.match /^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/
throw new Error "Invalid encoding: " + val
val
xmlStandalone: (val) ->
if val then "yes" else "no"
dtdPubI... | # strings to match while converting from JS objects
convertAttKey: '@'
convertPIKey: '?'
convertTextKey: '#text'
convertCDataKey: '#cdata'
convertCommentKey: '#comment'
convertRawKey: '#raw'
# Checks whether the given string contains legal characters
# Fails with an exception on error
#
# `str` th... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 54 | 103 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus | raw_corpus | #
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escap... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 104 | 139 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" th... | // `str` the string to convert
({
applyCase: function(str) {
switch (this.textCase) {
case "camel":
return camelCase(str);
case "title":
return titleCase(str);
case "kebab":
case "lower":
return kebabCase(str);
case "snake":
return snakeCase(str);
... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 104 | 139 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// `str` the string to convert
({
applyCase: function(str) {
switch (this.textCase) {
case "camel":
return camelCase(str);
case "title":
return titleCase(str);
case "kebab":
case "lower":
return kebabCase(str);
... | #
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escap... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 104 | 139 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion | completion | #
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "title" then titleCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escap... | str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
#
# `str` the string to escape
attEscape: (str) ->
amprege... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | d8c2ad0658592b3fa6f04df1d21e24871ae156ea | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8c2ad0658592b3fa6f04df1d21e24871ae156ea/src/XMLStringifier.coffee | 104 | 139 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus | raw_corpus | #
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes special characters in element values... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLStringifier.coffee | 104 | 138 | ||
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
e... | // `str` the string to convert
({
applyCase: function(str) {
switch (this.textCase) {
case "camel":
return camelCase(str);
case "kebab":
case "lower":
return kebabCase(str);
case "snake":
return snakeCase(str);
case "upper":
return kebabCase(str).toUpp... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLStringifier.coffee | 104 | 138 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// `str` the string to convert
({
applyCase: function(str) {
switch (this.textCase) {
case "camel":
return camelCase(str);
case "kebab":
case "lower":
return kebabCase(str);
case "snake":
return snakeCase(str);
... | #
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes special characters in element values... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLStringifier.coffee | 104 | 138 |
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion | completion | #
# `str` the string to convert
applyCase: (str) ->
switch @textCase
when "camel" then camelCase(str)
when "kebab", "lower" then kebabCase(str)
when "snake" then snakeCase(str)
when "upper" then kebabCase(str).toUpperCase()
else str
# Escapes special characters in element values... | str.replace(ampregex, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\r/g, '
')
# Escapes special characters in attribute values
#
# See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
#
# `str` the string to escape
attEscape: (str) ->
amprege... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLStringifier.coffee | MIT | ab0c6d3649828decfdd0c4b0e16021a3f300cc47 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ab0c6d3649828decfdd0c4b0e16021a3f300cc47/src/XMLStringifier.coffee | 104 | 138 |
Nedomas/databound:spec/crud/where.coffee:1:raw_corpus | raw_corpus | describe '#where', ->
it 'should return zero initial records', ->
stubResponse success: true, records: [], ->
User.where().then (users) ->
expect(users).to.eql([])
it 'should return all records when they exist', ->
records = [
{ id: 1, name: 'Nikki' }
{ id: 2, name: 'John' }
]... | CoffeeScript | Nedomas/databound | spec/crud/where.coffee | MIT | a02f231f1c3964eb8584adf55d7709b656e7e4a4 | 452 | https://github.com/Nedomas/databound/blob/a02f231f1c3964eb8584adf55d7709b656e7e4a4/spec/crud/where.coffee | 1 | 15 | ||
Nedomas/databound:spec/crud/where.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe '#where', ->
it 'should return zero initial records', ->
stubResponse success: true, records: [], ->
User.where().then (users) ->
expect(users).to.eql([])
it 'should return all records when they exist', ->
records = [
{ i... | describe('#where', function() {
it('should return zero initial records', function() {
return stubResponse({
success: true,
records: []
}, function() {
return User.where().then(function(users) {
return expect(users).to.eql([]);
});
});
});
return it('should return all re... | CoffeeScript | JavaScript | Nedomas/databound | spec/crud/where.coffee | MIT | a02f231f1c3964eb8584adf55d7709b656e7e4a4 | 452 | https://github.com/Nedomas/databound/blob/a02f231f1c3964eb8584adf55d7709b656e7e4a4/spec/crud/where.coffee | 1 | 15 |
Nedomas/databound:spec/crud/where.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('#where', function() {
it('should return zero initial records', function() {
return stubResponse({
success: true,
records: []
}, function() {
return User.where().then(function(users) {
return expect(users).to.eql([]);
... | describe '#where', ->
it 'should return zero initial records', ->
stubResponse success: true, records: [], ->
User.where().then (users) ->
expect(users).to.eql([])
it 'should return all records when they exist', ->
records = [
{ id: 1, name: 'Nikki' }
{ id: 2, name: 'John' }
]... | JavaScript | CoffeeScript | Nedomas/databound | spec/crud/where.coffee | MIT | a02f231f1c3964eb8584adf55d7709b656e7e4a4 | 452 | https://github.com/Nedomas/databound/blob/a02f231f1c3964eb8584adf55d7709b656e7e4a4/spec/crud/where.coffee | 1 | 15 |
Nedomas/databound:spec/crud/where.coffee:1:completion | completion | describe '#where', ->
it 'should return zero initial records', ->
stubResponse success: true, records: [], ->
User.where().then (users) ->
expect(users).to.eql([])
it 'should return all records when they exist', -> | records = [
{ id: 1, name: 'Nikki' }
{ id: 2, name: 'John' }
]
stubResponse success: true, records: records, ->
User.where().then (users) ->
expect(users).to.eql(records) | CoffeeScript | CoffeeScript | Nedomas/databound | spec/crud/where.coffee | MIT | a02f231f1c3964eb8584adf55d7709b656e7e4a4 | 452 | https://github.com/Nedomas/databound/blob/a02f231f1c3964eb8584adf55d7709b656e7e4a4/spec/crud/where.coffee | 1 | 15 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pioneer
constructor: (libPath, args) ->
... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucu... | var Pioneer, color, configBuilder, cucumber, fs, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./scaffold_builder');
color = require('colors');
cucumber = require('cucumber');
Pioneer... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pioneer, color, configBuilder, cucumber, fs, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./scaffold_builder');
color = requi... | moment = require('moment')
fs = require('fs')
path = require('path')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pioneer
constructor: (libPath, args) ->
... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:completion | completion | moment = require('moment')
fs = require('fs')
path = require('path')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pioneer
constructor: (libPath, args) ->
... | this.getSpecifications(configPath, libPath, args)
getSpecifications: (path, libPath, args) ->
configObject = {}
if(path)
fs.readFile(path,
'utf8',
(err, data) =>
throw err if(err)
configObject = this.parseAndValidateJSON(data, path)
if @isVerbose(args, con... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:2:raw_corpus | raw_corpus | start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested: ... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 51 | 72 | ||
mojotech/pioneer:src/pioneer.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not... | ({
start: function(opts) {
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
return process.exit(success ? 0 : 1);
});
},
parseAndValidateJSON: function(config, path) {
var err;
try {
return JSON.parse(config);
} catch (error) {
err = error;
... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 51 | 72 |
mojotech/pioneer:src/pioneer.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
start: function(opts) {
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
return process.exit(success ? 0 : 1);
});
},
parseAndValidateJSON: function(config, path) {
var err;
try {
return JSON.par... | start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested: ... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 51 | 72 |
mojotech/pioneer:src/pioneer.coffee:2:completion | completion | start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n") | isVersionRequested: (args) ->
args.version || args.v
isVerbose: (args, config = {}) ->
if args.verbose?
return args.verbose and args.verbose isnt "false"
else
return !!config.verbose
module.exports = Pioneer | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/src/pioneer.coffee | 51 | 72 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('co... | var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./scaffold_builder');
color = require('colors')... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = re... | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:completion | completion | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | configPath = p
else
configPath = null
this.getSpecifications(configPath, libPath, args)
getSpecifications: (path, libPath, args) ->
configObject = {}
if(path)
fs.readFile(path,
'utf8',
(err, data) =>
throw err if(err)
configObject = this.parseAndVa... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:2:raw_corpus | raw_corpus | applySpecifications: (obj, libPath, args) ->
opts = configBuilder.generateOptions(args, obj, libPath)
this.start(opts) if opts
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
t... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 51 | 76 | ||
mojotech/pioneer:src/pioneer.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
applySpecifications: (obj, libPath, args) ->
opts = configBuilder.generateOptions(args, obj, libPath)
this.start(opts) if opts
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0... | ({
applySpecifications: function(obj, libPath, args) {
var opts;
opts = configBuilder.generateOptions(args, obj, libPath);
if (opts) {
return this.start(opts);
}
},
start: function(opts) {
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
return proc... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 51 | 76 |
mojotech/pioneer:src/pioneer.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
applySpecifications: function(obj, libPath, args) {
var opts;
opts = configBuilder.generateOptions(args, obj, libPath);
if (opts) {
return this.start(opts);
}
},
start: function(opts) {
require('./environment')();
return cucum... | applySpecifications: (obj, libPath, args) ->
opts = configBuilder.generateOptions(args, obj, libPath)
this.start(opts) if opts
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
t... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 51 | 76 |
mojotech/pioneer:src/pioneer.coffee:2:completion | completion | applySpecifications: (obj, libPath, args) ->
opts = configBuilder.generateOptions(args, obj, libPath)
this.start(opts) if opts
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
t... | catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested: (args) ->
args.version || args.v
isVerbose: (args, config = {}) ->
if args.verbose?
return args.verbose and args.verbose isnt "false"
else
return !!config.verbose
module.exports = Pionee... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 2bffe1befa6e9f3a9935283feb53fab08a99b4ec | 523 | https://github.com/mojotech/pioneer/blob/2bffe1befa6e9f3a9935283feb53fab08a99b4ec/src/pioneer.coffee | 51 | 76 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e | 523 | https://github.com/mojotech/pioneer/blob/276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('co... | var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./scaffold_builder');
color = require('colors')... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e | 523 | https://github.com/mojotech/pioneer/blob/276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = re... | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e | 523 | https://github.com/mojotech/pioneer/blob/276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:completion | completion | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | else
configPath = null
if args.verbose
if configPath
console.log ('Configuration loaded from ' + configPath).yellow.inverse
else
console.log ('No configuration path specified').yellow.inverse
this.getSpecifications(configPath, libPath, args)
getSpecifications: (path, lib... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e | 523 | https://github.com/mojotech/pioneer/blob/276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:2:raw_corpus | raw_corpus | opts = configBuilder.generateOptions(args, obj, libPath)
this.start(opts) if opts
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1)
parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
t... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e | 523 | https://github.com/mojotech/pioneer/blob/276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e/src/pioneer.coffee | 51 | 69 | ||
mojotech/pioneer:src/pioneer.coffee:2:completion | completion | opts = configBuilder.generateOptions(args, obj, libPath)
this.start(opts) if opts
start: (opts) ->
require('./environment')()
cucumber.Cli(opts).run (success) ->
process.exit(if success then 0 else 1) | parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested: (args) ->
args.version || args.v
module.exports = Pioneer | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e | 523 | https://github.com/mojotech/pioneer/blob/276e80b03b9d3bcf56d0ad47d116f7ccca50ce9e/src/pioneer.coffee | 51 | 69 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('co... | var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./scaffold_builder');
color = require('colors')... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = re... | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:completion | completion | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | configPath = p
else
configPath = null
if(configPath)
console.log ('Configuration loaded from ' + configPath + '\n').yellow.inverse
else
console.log ('No configuration path specified.\n').yellow.inverse
this.getSpecifications(configPath, libPath, args)
getSpecifications: (path, ... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:2:raw_corpus | raw_corpus | this.start(opts) if opts
start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + te... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 51 | 72 | ||
mojotech/pioneer:src/pioneer.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
this.start(opts) if opts
start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "("... | this.start(opts)(opts ? {
start: function(opts) {
var timeStart;
timeStart = new Date().getTime();
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
var testTime;
testTime = moment.duration(new Date().getTime() - timeStart)._data;
console.log("Duration " +... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 51 | 72 |
mojotech/pioneer:src/pioneer.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.start(opts)(opts ? {
start: function(opts) {
var timeStart;
timeStart = new Date().getTime();
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
var testTime;
testTime = moment.duration(new Date().getTim... | this.start(opts) if opts
start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + te... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 51 | 72 |
mojotech/pioneer:src/pioneer.coffee:2:completion | completion | this.start(opts) if opts
start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + te... | parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested: (args) ->
args.version || args.v
module.exports = Pioneer | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | da2d0acac8329b55524dd78107e8b3fd84e93598 | 523 | https://github.com/mojotech/pioneer/blob/da2d0acac8329b55524dd78107e8b3fd84e93598/src/pioneer.coffee | 51 | 72 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('co... | var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./scaffold_builder');
color = require('colors')... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Pioneer, color, configBuilder, cucumber, fs, minimist, moment, path, scaffoldBuilder;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = re... | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:completion | completion | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
class Pione... | configPath = p
else
configPath = null
if(configPath)
console.log ('Configuration loaded from ' + configPath + '\n').yellow.inverse
else
console.log ('No configuration path specified.\n').yellow.inverse
this.getSpecifications(configPath, libPath, args)
getSpecifications: (path, ... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:2:raw_corpus | raw_corpus | start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + testTime.milliseconds + "ms)"
... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 51 | 70 | ||
mojotech/pioneer:src/pioneer.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" +... | ({
start: function(opts) {
var timeStart;
timeStart = new Date().getTime();
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
var testTime;
testTime = moment.duration(new Date().getTime() - timeStart)._data;
console.log("Duration " + "(" + testTime.minutes... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 51 | 70 |
mojotech/pioneer:src/pioneer.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
start: function(opts) {
var timeStart;
timeStart = new Date().getTime();
require('./environment')();
return cucumber.Cli(opts).run(function(success) {
var testTime;
testTime = moment.duration(new Date().getTime() - timeStart)._data;... | start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + testTime.milliseconds + "ms)"
... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 51 | 70 |
mojotech/pioneer:src/pioneer.coffee:2:completion | completion | start: (opts) ->
timeStart = new Date().getTime()
require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + testTime.milliseconds + "ms)"
... | parseAndValidateJSON: (config, path) ->
try
JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested: (args) ->
args.version || args.v
module.exports = Pioneer | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 3ae0a46e53df31bc829355ab9a71546baa97beb4 | 523 | https://github.com/mojotech/pioneer/blob/3ae0a46e53df31bc829355ab9a71546baa97beb4/src/pioneer.coffee | 51 | 70 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
init = (lib... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 937638bd003018a6abd46c918b14fdcaa7d7653b | 523 | https://github.com/mojotech/pioneer/blob/937638bd003018a6abd46c918b14fdcaa7d7653b/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('co... | var applySpecifications, color, configBuilder, cucumber, fs, getSpecifications, init, minimist, moment, path, scaffoldBuilder, start;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./sc... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | 937638bd003018a6abd46c918b14fdcaa7d7653b | 523 | https://github.com/mojotech/pioneer/blob/937638bd003018a6abd46c918b14fdcaa7d7653b/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var applySpecifications, color, configBuilder, cucumber, fs, getSpecifications, init, minimist, moment, path, scaffoldBuilder, start;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = requir... | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
init = (lib... | JavaScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 937638bd003018a6abd46c918b14fdcaa7d7653b | 523 | https://github.com/mojotech/pioneer/blob/937638bd003018a6abd46c918b14fdcaa7d7653b/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:1:completion | completion | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
init = (lib... | configPath = null
if(configPath)
console.log ('Configuration loaded from ' + configPath + '\n').yellow.inverse
else
console.log ('No configuration path specified.\n').yellow.inverse
getSpecifications(configPath, libPath, args)
getSpecifications = (path, libPath, args) ->
obj = {}
if(path)
fs.read... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 937638bd003018a6abd46c918b14fdcaa7d7653b | 523 | https://github.com/mojotech/pioneer/blob/937638bd003018a6abd46c918b14fdcaa7d7653b/src/pioneer.coffee | 1 | 50 |
mojotech/pioneer:src/pioneer.coffee:2:raw_corpus | raw_corpus | require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + testTime.milliseconds + "ms)"
process.exit(if success then 0 else 1)
parseAndValidateJSON ... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 937638bd003018a6abd46c918b14fdcaa7d7653b | 523 | https://github.com/mojotech/pioneer/blob/937638bd003018a6abd46c918b14fdcaa7d7653b/src/pioneer.coffee | 51 | 68 | ||
mojotech/pioneer:src/pioneer.coffee:2:completion | completion | require('./environment')()
cucumber.Cli(opts).run (success) ->
testTime = moment.duration(new Date().getTime() - timeStart)._data
console.log "Duration " + "(" + testTime.minutes + "m:" + testTime.seconds + "s:" + testTime.milliseconds + "ms)"
process.exit(if success then 0 else 1)
parseAndValidateJSON ... | JSON.parse(config)
catch err
throw new Error(path + " does not include a valid JSON object.\n")
isVersionRequested = (args) ->
args.version || args.v
module.exports = init
module.exports._parseAndValidateJSON = parseAndValidateJSON | CoffeeScript | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | 937638bd003018a6abd46c918b14fdcaa7d7653b | 523 | https://github.com/mojotech/pioneer/blob/937638bd003018a6abd46c918b14fdcaa7d7653b/src/pioneer.coffee | 51 | 68 |
mojotech/pioneer:src/pioneer.coffee:1:raw_corpus | raw_corpus | moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('colors')
cucumber = require('cucumber')
init = (lib... | CoffeeScript | mojotech/pioneer | src/pioneer.coffee | MIT | edac57e6944c6a8a654fbdc3a47ef89dcfecb0c2 | 523 | https://github.com/mojotech/pioneer/blob/edac57e6944c6a8a654fbdc3a47ef89dcfecb0c2/src/pioneer.coffee | 1 | 50 | ||
mojotech/pioneer:src/pioneer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
moment = require('moment')
fs = require('fs')
path = require('path')
minimist = require('minimist')
configBuilder = require('./config_builder')
scaffoldBuilder = require('./scaffold_builder')
color = require('co... | var applySpecifications, color, configBuilder, cucumber, fs, getSpecifications, init, minimist, moment, path, scaffoldBuilder, start;
moment = require('moment');
fs = require('fs');
path = require('path');
minimist = require('minimist');
configBuilder = require('./config_builder');
scaffoldBuilder = require('./sc... | CoffeeScript | JavaScript | mojotech/pioneer | src/pioneer.coffee | MIT | edac57e6944c6a8a654fbdc3a47ef89dcfecb0c2 | 523 | https://github.com/mojotech/pioneer/blob/edac57e6944c6a8a654fbdc3a47ef89dcfecb0c2/src/pioneer.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.