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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gss/engine:src/domains/Abstract.coffee:4:completion | completion | engine.intrinsic.restyle object || scope, property, value, continuation, operation
else | engine.assumed.set object || scope, property, value
return | CoffeeScript | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 84ae01a1b1312671108b96680a12061434a4f80f | 2,854 | https://github.com/gss/engine/blob/84ae01a1b1312671108b96680a12061434a4f80f/src/domains/Abstract.coffee | 161 | 164 |
gss/engine:src/domains/Abstract.coffee:3:raw_corpus | raw_corpus | # Array of commands, stops command propagation
Abstract::List = Command.List
# Global variable
Abstract::Value = Value.extend()
Abstract::Value.Variable = Abstract::Value.extend {
signature: [
property: ['String']
],
},
'get': (property, engine, operation, continuation, scope) ->
return ['get', property]... | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 111 | 160 | ||
gss/engine:src/domains/Abstract.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Array of commands, stops command propagation
Abstract::List = Command.List
# Global variable
Abstract::Value = Value.extend()
Abstract::Value.Variable = Abstract::Value.extend {
signature: [
property: ['String']
],
},
'get': (property, engine, operat... | // Array of commands, stops command propagation
Abstract.prototype.List = Command.List;
// Global variable
Abstract.prototype.Value = Value.extend();
Abstract.prototype.Value.Variable = Abstract.prototype.Value.extend({
signature: [
{
property: ['String']
}
]
}, {
'get': function(property, engine,... | CoffeeScript | JavaScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 111 | 160 |
gss/engine:src/domains/Abstract.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Array of commands, stops command propagation
Abstract.prototype.List = Command.List;
// Global variable
Abstract.prototype.Value = Value.extend();
Abstract.prototype.Value.Variable = Abstract.prototype.Value.extend({
signature: [
{
property: ['Stri... | # Array of commands, stops command propagation
Abstract::List = Command.List
# Global variable
Abstract::Value = Value.extend()
Abstract::Value.Variable = Abstract::Value.extend {
signature: [
property: ['String']
],
},
'get': (property, engine, operation, continuation, scope) ->
return ['get', property]... | JavaScript | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 111 | 160 |
gss/engine:src/domains/Abstract.coffee:3:completion | completion | # Array of commands, stops command propagation
Abstract::List = Command.List
# Global variable
Abstract::Value = Value.extend()
Abstract::Value.Variable = Abstract::Value.extend {
signature: [
property: ['String']
],
},
'get': (property, engine, operation, continuation, scope) ->
return ['get', property]... | debugger
return ['get', engine.getPath(object, property)]
# Proxy math that passes basic expressions along
Abstract::Value.Expression = Value.Expression.extend {},
'+': (left, right) ->
['+', left, right]
'-': (left, right) ->
['-', left, right]
'/': (left, right) ->
['/', left, right]
'*': ... | CoffeeScript | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 111 | 160 |
gss/engine:src/domains/Abstract.coffee:4:raw_corpus | raw_corpus | 'set': (object, property, value, engine, operation, continuation, scope) ->
if engine.intrinsic
engine.intrinsic.restyle object || scope, property, value, continuation, operation
else
engine.assumed.set object || scope, property, value
return | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 161 | 166 | ||
gss/engine:src/domains/Abstract.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
'set': (object, property, value, engine, operation, continuation, scope) ->
if engine.intrinsic
engine.intrinsic.restyle object || scope, property, value, continuation, operation
else
engine.assumed.set object || scope, property, value
ret... | ({
'set': function(object, property, value, engine, operation, continuation, scope) {
if (engine.intrinsic) {
engine.intrinsic.restyle(object || scope, property, value, continuation, operation);
} else {
engine.assumed.set(object || scope, property, value);
}
}
}); | CoffeeScript | JavaScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 161 | 166 |
gss/engine:src/domains/Abstract.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
'set': function(object, property, value, engine, operation, continuation, scope) {
if (engine.intrinsic) {
engine.intrinsic.restyle(object || scope, property, value, continuation, operation);
} else {
engine.assumed.set(object || scope, pro... | 'set': (object, property, value, engine, operation, continuation, scope) ->
if engine.intrinsic
engine.intrinsic.restyle object || scope, property, value, continuation, operation
else
engine.assumed.set object || scope, property, value
return | JavaScript | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 161 | 166 |
gss/engine:src/domains/Abstract.coffee:4:completion | completion | 'set': (object, property, value, engine, operation, continuation, scope) ->
if engine.intrinsic
engine.intrinsic.restyle object || scope, property, value, continuation, operation | else
engine.assumed.set object || scope, property, value
return | CoffeeScript | CoffeeScript | gss/engine | src/domains/Abstract.coffee | MIT | 6bb82858753ae588e930911ac6dc5db1ced37cb0 | 2,854 | https://github.com/gss/engine/blob/6bb82858753ae588e930911ac6dc5db1ced37cb0/src/domains/Abstract.coffee | 161 | 166 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | module.exports = CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optConfig of c... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | ac60f4050f1bd0ee25198ac18beb22b40c1a0543 | 579 | https://github.com/nevir/groc/blob/ac60f4050f1bd0ee25198ac18beb22b40c1a0543/lib/utils/cli_helpers.coffee | 8 | 57 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, ... | var CLIHelpers;
module.exports = CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefaults) {
... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | ac60f4050f1bd0ee25198ac18beb22b40c1a0543 | 579 | https://github.com/nevir/groc/blob/ac60f4050f1bd0ee25198ac18beb22b40c1a0543/lib/utils/cli_helpers.coffee | 8 | 57 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var CLIHelpers;
module.exports = CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configu... | module.exports = CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optConfig of c... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | ac60f4050f1bd0ee25198ac18beb22b40c1a0543 | 579 | https://github.com/nevir/groc/blob/ac60f4050f1bd0ee25198ac18beb22b40c1a0543/lib/utils/cli_helpers.coffee | 8 | 57 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | module.exports = CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optConfig of c... | extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
for optName, optConfig of config
if optConfig.type == 'list' and not _.isArray opts.argv[optName]
argv[o... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | ac60f4050f1bd0ee25198ac18beb22b40c1a0543 | 579 | https://github.com/nevir/groc/blob/ac60f4050f1bd0ee25198ac18beb22b40c1a0543/lib/utils/cli_helpers.coffee | 8 | 57 |
nevir/groc:lib/utils/cli_helpers.coffee:2:raw_corpus | raw_corpus | return error if error
config = {}
for line in stdout.split '\n'
pieces = line.split '='
config[pieces[0]] = pieces[1]
# * If the user has a tracked `gh-pages` branch, chances are extremely high that its tracked
# remote is the correct github project.
pagesRemote = confi... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | ac60f4050f1bd0ee25198ac18beb22b40c1a0543 | 579 | https://github.com/nevir/groc/blob/ac60f4050f1bd0ee25198ac18beb22b40c1a0543/lib/utils/cli_helpers.coffee | 58 | 95 | ||
nevir/groc:lib/utils/cli_helpers.coffee:2:completion | completion | return error if error
config = {}
for line in stdout.split '\n'
pieces = line.split '='
config[pieces[0]] = pieces[1]
# * If the user has a tracked `gh-pages` branch, chances are extremely high that its tracked
# remote is the correct github project.
pagesRemote = confi... | return callback null, url, pagesRemote if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, value of config
url = @extractGitHubURL value
return callback null, url, pagesRemote if url
callback ... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | ac60f4050f1bd0ee25198ac18beb22b40c1a0543 | 579 | https://github.com/nevir/groc/blob/ac60f4050f1bd0ee25198ac18beb22b40c1a0543/lib/utils/cli_helpers.coffee | 58 | 95 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 1 | 40 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist:... | // # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefaul... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
... | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | opts.options optName, _(optConfig).extend(default: defaultVal)
# ## extractArgv
# In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an indivi... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:2:raw_corpus | raw_corpus | # ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (repository_url, callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, an... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 42 | 83 | ||
nevir/groc:lib/utils/cli_helpers.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (repository_url, callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are seve... | // ## guessPrimaryGitHubURL
({
guessPrimaryGitHubURL: function(repository_url, callback) {
// `git config --list` provides information about branches and remotes - everything we need to
// attempt to guess the project's GitHub repository.
// There are several states that a GitHub-based repository could b... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 42 | 83 |
nevir/groc:lib/utils/cli_helpers.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ## guessPrimaryGitHubURL
({
guessPrimaryGitHubURL: function(repository_url, callback) {
// `git config --list` provides information about branches and remotes - everything we need to
// attempt to guess the project's GitHub repository.
// There ar... | # ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (repository_url, callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, an... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 42 | 83 |
nevir/groc:lib/utils/cli_helpers.coffee:2:completion | completion | # ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (repository_url, callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, an... | else
if config["remote.#{pagesRemote}.url"]
url = @extractGitHubURL config["remote.#{pagesRemote}.url"]
return callback null, url, pagesRemote if url
# * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.ori... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 42 | 83 |
nevir/groc:lib/utils/cli_helpers.coffee:3:raw_corpus | raw_corpus | owner = match[1]
repo = if match[2][-4..] == '.git' then match[2][0...-4] else match[2]
"https://github.com/#{owner}/#{repo}" | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 86 | 89 | ||
nevir/groc:lib/utils/cli_helpers.coffee:3:completion | completion | owner = match[1]
repo = if match[2][-4..] == '.git' then match[2][0...-4] else match[2] | "https://github.com/#{owner}/#{repo}" | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 43f474917430a775de368bf2c00dc2e4103b437d | 579 | https://github.com/nevir/groc/blob/43f474917430a775de368bf2c00dc2e4103b437d/lib/utils/cli_helpers.coffee | 86 | 89 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 1a1f64a32ef68e9bbc7f1337a5ff37bf07500771 | 579 | https://github.com/nevir/groc/blob/1a1f64a32ef68e9bbc7f1337a5ff37bf07500771/lib/utils/cli_helpers.coffee | 1 | 40 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist:... | // # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefaul... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 1a1f64a32ef68e9bbc7f1337a5ff37bf07500771 | 579 | https://github.com/nevir/groc/blob/1a1f64a32ef68e9bbc7f1337a5ff37bf07500771/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
... | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 1a1f64a32ef68e9bbc7f1337a5ff37bf07500771 | 579 | https://github.com/nevir/groc/blob/1a1f64a32ef68e9bbc7f1337a5ff37bf07500771/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | opts.options optName, _(optConfig).extend(default: defaultVal)
# ## extractArgv
# In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an indivi... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 1a1f64a32ef68e9bbc7f1337a5ff37bf07500771 | 579 | https://github.com/nevir/groc/blob/1a1f64a32ef68e9bbc7f1337a5ff37bf07500771/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:2:raw_corpus | raw_corpus | # ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, and we've probably... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5a3923006ea87d318fdcaebef1d2a6f9ca74be22 | 579 | https://github.com/nevir/groc/blob/5a3923006ea87d318fdcaebef1d2a6f9ca74be22/lib/utils/cli_helpers.coffee | 42 | 80 | ||
nevir/groc:lib/utils/cli_helpers.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that ... | // ## guessPrimaryGitHubURL
({
guessPrimaryGitHubURL: function(callback) {
// `git config --list` provides information about branches and remotes - everything we need to
// attempt to guess the project's GitHub repository.
// There are several states that a GitHub-based repository could be in, and we've ... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5a3923006ea87d318fdcaebef1d2a6f9ca74be22 | 579 | https://github.com/nevir/groc/blob/5a3923006ea87d318fdcaebef1d2a6f9ca74be22/lib/utils/cli_helpers.coffee | 42 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ## guessPrimaryGitHubURL
({
guessPrimaryGitHubURL: function(callback) {
// `git config --list` provides information about branches and remotes - everything we need to
// attempt to guess the project's GitHub repository.
// There are several states... | # ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, and we've probably... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5a3923006ea87d318fdcaebef1d2a6f9ca74be22 | 579 | https://github.com/nevir/groc/blob/5a3923006ea87d318fdcaebef1d2a6f9ca74be22/lib/utils/cli_helpers.coffee | 42 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:2:completion | completion | # ## guessPrimaryGitHubURL
guessPrimaryGitHubURL: (callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, and we've probably... | if pagesRemote and config["remote.#{pagesRemote}.url"]
url = @extractGitHubURL config["remote.#{pagesRemote}.url"]
return callback null, url if url
# * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
re... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5a3923006ea87d318fdcaebef1d2a6f9ca74be22 | 579 | https://github.com/nevir/groc/blob/5a3923006ea87d318fdcaebef1d2a6f9ca74be22/lib/utils/cli_helpers.coffee | 42 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:3:raw_corpus | raw_corpus | owner = match[1]
repo = if match[1][-4..] == '.git' then match[1][0...-4] else match[1]
"https://github.com/#{owner}/#{repo}" | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | d16064e9610b77a38e7ee73124e84bd7279b282f | 579 | https://github.com/nevir/groc/blob/d16064e9610b77a38e7ee73124e84bd7279b282f/lib/utils/cli_helpers.coffee | 83 | 86 | ||
nevir/groc:lib/utils/cli_helpers.coffee:3:completion | completion | owner = match[1]
repo = if match[1][-4..] == '.git' then match[1][0...-4] else match[1] | "https://github.com/#{owner}/#{repo}" | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | d16064e9610b77a38e7ee73124e84bd7279b282f | 579 | https://github.com/nevir/groc/blob/d16064e9610b77a38e7ee73124e84bd7279b282f/lib/utils/cli_helpers.coffee | 83 | 86 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 622c75a87f229c79c81783acc44adedbb375cb6c | 579 | https://github.com/nevir/groc/blob/622c75a87f229c79c81783acc44adedbb375cb6c/lib/utils/cli_helpers.coffee | 1 | 40 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist:... | // # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefaul... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 622c75a87f229c79c81783acc44adedbb375cb6c | 579 | https://github.com/nevir/groc/blob/622c75a87f229c79c81783acc44adedbb375cb6c/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
... | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 622c75a87f229c79c81783acc44adedbb375cb6c | 579 | https://github.com/nevir/groc/blob/622c75a87f229c79c81783acc44adedbb375cb6c/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
for optName, optCon... | opts.options optName, _(optConfig).extend(default: defaultVal)
# ## extractArgv
# In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an indivi... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 622c75a87f229c79c81783acc44adedbb375cb6c | 579 | https://github.com/nevir/groc/blob/622c75a87f229c79c81783acc44adedbb375cb6c/lib/utils/cli_helpers.coffee | 1 | 40 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the not... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 1 | 39 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist:... | // # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefaul... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
... | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the not... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the not... | # * We support two tiers of default values. First, we set up the hard-coded defaults specified
# as part of `config`.
defaults = {}
for optName, optConfig of config
defaults[optName] = optConfig.default if optConfig.default?
# * We follow up with the higher precedence defaults passed via `extr... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:2:raw_corpus | raw_corpus | # In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 41 | 80 | ||
nevir/groc:lib/utils/cli_helpers.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
... | // In addition to the extended configuration that we desire, we also want special handling for
// generated values:
({
extractArgv: function(opts, config) {
var argv, optConfig, optName;
argv = opts.argv;
// * With regular optimist parsing, you either get an individual value or an array. For
// list-style ... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 41 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// In addition to the extended configuration that we desire, we also want special handling for
// generated values:
({
extractArgv: function(opts, config) {
var argv, optConfig, optName;
argv = opts.argv;
// * With regular optimist parsing, you either get... | # In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 41 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:2:completion | completion | # In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
... | guessPrimaryGitHubURL: (callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, and we've probably missed
# a few. We attem... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 41 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:3:raw_corpus | raw_corpus | # * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, va... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 82 | 102 | ||
nevir/groc:lib/utils/cli_helpers.coffee:3:completion | completion | # * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, va... | callback new Error "Could not guess a GitHub URL for the current repository :("
# A quick helper that extracts a GitHub project URL from its repository URL.
extractGitHubURL: (url) ->
match = url?.match /github\.com[:\/]([^\/]+)\/([^\/]+)/
return null unless match
owner = match[1]
repo = if match... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | bbe7e24a187d738fb4c690f8eb80c8d7e62204c5 | 579 | https://github.com/nevir/groc/blob/bbe7e24a187d738fb4c690f8eb80c8d7e62204c5/lib/utils/cli_helpers.coffee | 82 | 102 |
nevir/groc:lib/utils/cli_helpers.coffee:3:raw_corpus | raw_corpus | # * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, va... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 677bedaf24cef6b024178668c0d71dcb13cdbcf9 | 579 | https://github.com/nevir/groc/blob/677bedaf24cef6b024178668c0d71dcb13cdbcf9/lib/utils/cli_helpers.coffee | 82 | 99 | ||
nevir/groc:lib/utils/cli_helpers.coffee:3:completion | completion | # * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, va... | callback new Error "Could not guess a GitHub URL for the current repository :("
# A quick helper that extracts a GitHub project URL from its repository URL.
extractGitHubURL: (url) ->
match = url?.match /github\.com[:\/]([^\/]+)\/([^\/]+)\.git/
return null unless match
"https://github.com/#{match[1]}/... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 677bedaf24cef6b024178668c0d71dcb13cdbcf9 | 579 | https://github.com/nevir/groc/blob/677bedaf24cef6b024178668c0d71dcb13cdbcf9/lib/utils/cli_helpers.coffee | 82 | 99 |
nevir/groc:lib/utils/cli_helpers.coffee:3:raw_corpus | raw_corpus | # * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, va... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 58058ac70fd2f33aab6ade661040744221f8addc | 579 | https://github.com/nevir/groc/blob/58058ac70fd2f33aab6ade661040744221f8addc/lib/utils/cli_helpers.coffee | 82 | 99 | ||
nevir/groc:lib/utils/cli_helpers.coffee:3:completion | completion | # * If that fails, we fall back to the origin remote if it is a GitHub repository.
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# * We fall back to searching all remotes for a GitHub repository, and choose the first one
# we encounter.
for key, va... | callback new Error "Could not guess a GitHub URL for the current repository :("
# A quick helper that extracts a GitHub project URL from its repository URL.
extractGitHubURL: (url) ->
match = url?.match /github\.com:([^\/]+)\/([^\/]+)\.git/
return null unless match
"https://github.com/#{match[1]}/#{ma... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 58058ac70fd2f33aab6ade661040744221f8addc | 579 | https://github.com/nevir/groc/blob/58058ac70fd2f33aab6ade661040744221f8addc/lib/utils/cli_helpers.coffee | 82 | 99 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the not... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | c548513e4ce177c118b0c3117ba4d7b70fbf8286 | 579 | https://github.com/nevir/groc/blob/c548513e4ce177c118b0c3117ba4d7b70fbf8286/lib/utils/cli_helpers.coffee | 1 | 39 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist:... | // # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefaul... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | c548513e4ce177c118b0c3117ba4d7b70fbf8286 | 579 | https://github.com/nevir/groc/blob/c548513e4ce177c118b0c3117ba4d7b70fbf8286/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
... | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the not... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | c548513e4ce177c118b0c3117ba4d7b70fbf8286 | 579 | https://github.com/nevir/groc/blob/c548513e4ce177c118b0c3117ba4d7b70fbf8286/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the not... | # * We support two tiers of default values. First, we set up the hard-coded defaults specified
# as part of `config`.
defaults = {}
for optName, optConfig of config
defaults[optName] = optConfig.default if optConfig.default?
# * We follow up with the higher precedence defaults passed via `extr... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | c548513e4ce177c118b0c3117ba4d7b70fbf8286 | 579 | https://github.com/nevir/groc/blob/c548513e4ce177c118b0c3117ba4d7b70fbf8286/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist()
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the n... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 1 | 39 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# # Command Line Helpers
CLIHelpers =
# ## configureOptimist()
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimis... | // # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist()
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options.
configureOptimist: function(opts, config, extraDefa... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// # Command Line Helpers
var CLIHelpers;
CLIHelpers = {
// ## configureOptimist()
// [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
// layer on a little bit of additional structure when defining our options... | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist()
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the n... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | # # Command Line Helpers
CLIHelpers =
# ## configureOptimist()
# [Optimist](https://github.com/substack/node-optimist) fails to provide a few conveniences, so we
# layer on a little bit of additional structure when defining our options.
configureOptimist: (opts, config, extraDefaults) ->
# * We want the n... | # * We support two tiers of default values. First, we set up the hard-coded defaults specified
# as part of `config`.
defaults = {}
for optName, optConfig of config
defaults[optName] = optConfig.default if optConfig.default?
# * We follow up with the higher precedence defaults passed via `extr... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 1 | 39 |
nevir/groc:lib/utils/cli_helpers.coffee:2:raw_corpus | raw_corpus | # In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 41 | 80 | ||
nevir/groc:lib/utils/cli_helpers.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
... | // In addition to the extended configuration that we desire, we also want special handling for
// generated values:
({
extractArgv: function(opts, config) {
var argv, optConfig, optName;
argv = opts.argv;
// * With regular optimist parsing, you either get an individual value or an array. For
// list-style ... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 41 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// In addition to the extended configuration that we desire, we also want special handling for
// generated values:
({
extractArgv: function(opts, config) {
var argv, optConfig, optName;
argv = opts.argv;
// * With regular optimist parsing, you either get... | # In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 41 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:2:completion | completion | # In addition to the extended configuration that we desire, we also want special handling for
# generated values:
extractArgv: (opts, config) ->
argv = opts.argv
# * With regular optimist parsing, you either get an individual value or an array. For
# list-style options, we always want an array.
... | guessPrimaryGitHubURL: (callback) ->
# `git config --list` provides information about branches and remotes - everything we need to
# attempt to guess the project's GitHub repository.
#
# There are several states that a GitHub-based repository could be in, and we've probably missed
# a few. We attem... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d | 579 | https://github.com/nevir/groc/blob/b59d6d264cb0158ec4a8c49593dbf5b1aacbe28d/lib/utils/cli_helpers.coffee | 41 | 80 |
nevir/groc:lib/utils/cli_helpers.coffee:1:raw_corpus | raw_corpus | CLIHelpers =
# Attempt to guess our primary github remote repository
guessPrimaryGitHubURL: (callback) ->
# git config lays it all out for us
childProcess.exec 'git config --list', (error, stdout, stderr) =>
return error if error
config = {}
for line in stdout.split '\n'
pieces ... | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5aa7fbf6815c2c43b784c9d6595af4883e67d9b5 | 579 | https://github.com/nevir/groc/blob/5aa7fbf6815c2c43b784c9d6595af4883e67d9b5/lib/utils/cli_helpers.coffee | 1 | 37 | ||
nevir/groc:lib/utils/cli_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
CLIHelpers =
# Attempt to guess our primary github remote repository
guessPrimaryGitHubURL: (callback) ->
# git config lays it all out for us
childProcess.exec 'git config --list', (error, stdout, stderr) =>
return error if error
config... | var CLIHelpers;
CLIHelpers = {
// Attempt to guess our primary github remote repository
guessPrimaryGitHubURL: function(callback) {
// git config lays it all out for us
return childProcess.exec('git config --list', (error, stdout, stderr) => {
var config, i, key, len, line, pagesRemote, pieces, ref, ... | CoffeeScript | JavaScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5aa7fbf6815c2c43b784c9d6595af4883e67d9b5 | 579 | https://github.com/nevir/groc/blob/5aa7fbf6815c2c43b784c9d6595af4883e67d9b5/lib/utils/cli_helpers.coffee | 1 | 37 |
nevir/groc:lib/utils/cli_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var CLIHelpers;
CLIHelpers = {
// Attempt to guess our primary github remote repository
guessPrimaryGitHubURL: function(callback) {
// git config lays it all out for us
return childProcess.exec('git config --list', (error, stdout, stderr) => {
va... | CLIHelpers =
# Attempt to guess our primary github remote repository
guessPrimaryGitHubURL: (callback) ->
# git config lays it all out for us
childProcess.exec 'git config --list', (error, stdout, stderr) =>
return error if error
config = {}
for line in stdout.split '\n'
pieces ... | JavaScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5aa7fbf6815c2c43b784c9d6595af4883e67d9b5 | 579 | https://github.com/nevir/groc/blob/5aa7fbf6815c2c43b784c9d6595af4883e67d9b5/lib/utils/cli_helpers.coffee | 1 | 37 |
nevir/groc:lib/utils/cli_helpers.coffee:1:completion | completion | CLIHelpers =
# Attempt to guess our primary github remote repository
guessPrimaryGitHubURL: (callback) ->
# git config lays it all out for us
childProcess.exec 'git config --list', (error, stdout, stderr) =>
return error if error
config = {}
for line in stdout.split '\n'
pieces ... | return callback null, url if url
# Next up, their origin remote if it's a valid github remote
url = @extractGitHubURL config['remote.origin.url']
return callback null, url if url
# Last chance, any github-looking remote
for key, value of config
url = @extractGitHubURL value
... | CoffeeScript | CoffeeScript | nevir/groc | lib/utils/cli_helpers.coffee | MIT | 5aa7fbf6815c2c43b784c9d6595af4883e67d9b5 | 579 | https://github.com/nevir/groc/blob/5aa7fbf6815c2c43b784c9d6595af4883e67d9b5/lib/utils/cli_helpers.coffee | 1 | 37 |
kelp404/angular-form-builder:test/karma.config.coffee:1:raw_corpus | raw_corpus | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js'
'node_modu... | CoffeeScript | kelp404/angular-form-builder | test/karma.config.coffee | MIT | 521099b060370087e587945e9c29eeb79023bfee | 600 | https://github.com/kelp404/angular-form-builder/blob/521099b060370087e587945e9c29eeb79023bfee/test/karma.config.coffee | 1 | 50 | ||
kelp404/angular-form-builder:test/karma.config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'node_... | module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['node_modules/jquery/dist/jquery.min.js', 'node_modules/angular/angular.min.js',... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma.config.coffee | MIT | 521099b060370087e587945e9c29eeb79023bfee | 600 | https://github.com/kelp404/angular-form-builder/blob/521099b060370087e587945e9c29eeb79023bfee/test/karma.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma.config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['node_modules/jquery/dist... | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'node_modules/jquery/dist/jquery.min.js'
'node_modu... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma.config.coffee | MIT | 521099b060370087e587945e9c29eeb79023bfee | 600 | https://github.com/kelp404/angular-form-builder/blob/521099b060370087e587945e9c29eeb79023bfee/test/karma.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma.config.coffee:1:raw_corpus | raw_corpus | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/jquery/dist/jquery.min.js'
'test/lib/angu... | CoffeeScript | kelp404/angular-form-builder | test/karma.config.coffee | MIT | bd9ea86ecfd2b0d2ab29723a330ca0f976b4f9af | 600 | https://github.com/kelp404/angular-form-builder/blob/bd9ea86ecfd2b0d2ab29723a330ca0f976b4f9af/test/karma.config.coffee | 1 | 50 | ||
kelp404/angular-form-builder:test/karma.config.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/... | module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/jquery/dist/jquery.min.js', 'test/lib/angular/angular.min.js', 'test/l... | CoffeeScript | JavaScript | kelp404/angular-form-builder | test/karma.config.coffee | MIT | bd9ea86ecfd2b0d2ab29723a330ca0f976b4f9af | 600 | https://github.com/kelp404/angular-form-builder/blob/bd9ea86ecfd2b0d2ab29723a330ca0f976b4f9af/test/karma.config.coffee | 1 | 50 |
kelp404/angular-form-builder:test/karma.config.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(config) {
return config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: ['test/lib/jquery/dist/jqu... | module.exports = (config) ->
config.set
# base path, that will be used to resolve files and exclude
basePath: '../'
frameworks: ['jasmine']
# list of files / patterns to load in the browser
files: [
'test/lib/jquery/dist/jquery.min.js'
'test/lib/angu... | JavaScript | CoffeeScript | kelp404/angular-form-builder | test/karma.config.coffee | MIT | bd9ea86ecfd2b0d2ab29723a330ca0f976b4f9af | 600 | https://github.com/kelp404/angular-form-builder/blob/bd9ea86ecfd2b0d2ab29723a330ca0f976b4f9af/test/karma.config.coffee | 1 | 50 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:1:raw_corpus | raw_corpus | module.exports = class GitTimeMachineView
zoom: 1.5
constructor: (serializedState, options={}) ->
@$element = $("<div class='git-time-machine'>") unless @$element
if options.editor?
@setEditor(options.editor)
@render()
@_bindWindowEvents()
setEditor: (editor) ->
return if !editor?... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 14 | 63 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class GitTimeMachineView
zoom: 1.5
constructor: (serializedState, options={}) ->
@$element = $("<div class='git-time-machine'>") unless @$element
if options.editor?
@setEditor(options.editor)
@render()
@_bindWindowE... | var GitTimeMachineView;
module.exports = GitTimeMachineView = (function() {
class GitTimeMachineView {
constructor(serializedState, options = {}) {
if (!this.$element) {
this.$element = $("<div class='git-time-machine'>");
}
if (options.editor != null) {
this.setEditor(options.e... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 14 | 63 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var GitTimeMachineView;
module.exports = GitTimeMachineView = (function() {
class GitTimeMachineView {
constructor(serializedState, options = {}) {
if (!this.$element) {
this.$element = $("<div class='git-time-machine'>");
}
if (opt... | module.exports = class GitTimeMachineView
zoom: 1.5
constructor: (serializedState, options={}) ->
@$element = $("<div class='git-time-machine'>") unless @$element
if options.editor?
@setEditor(options.editor)
@render()
@_bindWindowEvents()
setEditor: (editor) ->
return if !editor?... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 14 | 63 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:1:completion | completion | module.exports = class GitTimeMachineView
zoom: 1.5
constructor: (serializedState, options={}) ->
@$element = $("<div class='git-time-machine'>") unless @$element
if options.editor?
@setEditor(options.editor)
@render()
@_bindWindowEvents()
setEditor: (editor) ->
return if !editor?... | @commits = @gitCommitHistory()
unless @commits?
@_renderPlaceholder()
else
@$element.text("")
@_renderCloseHandle()
@_renderTimeplot(@commits)
@_renderStats(@commits)
return @$element
# Returns an object that can be retrieved when package is activated
serialize: ->
... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 14 | 63 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:raw_corpus | raw_corpus | @timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement: ->
return @$element.get(0)
gitCommitHistory: (editor=@lastActivatedEditor)->
return null unless editor?
if editor.__gitTimeMachine?.sourceEditor?
editor = editor.__gitTimeMachine.sourceEditor
... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 64 | 113 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement: ->
return @$element.get(0)
gitCommitHistory: (editor=@lastActivatedEditor)->
return null unless editor?
if editor.__gitTimeMachine?.sourceEditor... | var ref;
if ((ref = this.timeplot) != null) {
ref.hide()({ // so it knows to hide the popup
show: function() {
var ref1;
return (ref1 = this.timeplot) != null ? ref1.show() : void 0;
},
getElement: function() {
return this.$element.get(0);
},
gitCommitHistory: function(editor = ... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ref;
if ((ref = this.timeplot) != null) {
ref.hide()({ // so it knows to hide the popup
show: function() {
var ref1;
return (ref1 = this.timeplot) != null ? ref1.show() : void 0;
},
getElement: function() {
return this.$element.... | @timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement: ->
return @$element.get(0)
gitCommitHistory: (editor=@lastActivatedEditor)->
return null unless editor?
if editor.__gitTimeMachine?.sourceEditor?
editor = editor.__gitTimeMachine.sourceEditor
... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:2:completion | completion | @timeplot?.hide() # so it knows to hide the popup
show: ->
@timeplot?.show()
getElement: ->
return @$element.get(0)
gitCommitHistory: (editor=@lastActivatedEditor)->
return null unless editor?
if editor.__gitTimeMachine?.sourceEditor?
editor = editor.__gitTimeMachine.sourceEditor
... | return null
atom.notifications.addError String e
console.error e
return null
return commits;
_bindWindowEvents: () ->
$(window).on 'resize', @_onEditorResize
_unbindWindowEvents: () ->
$(window).off 'resize', @_onEditorResize
_renderPlaceholder: () ->
@$element.html("<div... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 64 | 113 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 114 | 163 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machi... | $closeHandle.on('mousedown', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// why not? instead of adding callback, our own event...
return atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle");
});
atom.tooltips.add($closeHandle, {
titl... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
$closeHandle.on('mousedown', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// why not? instead of adding callback, our own event...
return atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:... | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate))
timeSpan = moment.duration... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | rightRevHash = @lastActivatedEditor.__gitTimeMachine.revisions?[1]?.revHash ? null
if reverse
rightRevHash = revHash
else
leftRevHash = revHash
# order by created asc
[leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash)
GitRevisionView.showRevision(@lastActivatedE... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 164 | 196 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:completion | completion | rightRevHash = @lastActivatedEditor.__gitTimeMachine.revisions?[1]?.revHash ? null
if reverse
rightRevHash = revHash
else
leftRevHash = revHash
# order by created asc
[leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash)
GitRevisionView.showRevision(@lastActivatedE... | _onRevisionClose: =>
rightRevHash = leftRevHash = null
@timeplot.setRevisions(leftRevHash, rightRevHash)
_orderRevHashes: (revHashA, revHashB) ->
unorderedRevs = [revHashA, revHashB]
return unorderedRevs unless @commits?.length > 0
orderedRevs = []
for rev in @commits
if rev.id in unor... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 0fa2ac0d06951d3724cc171862b18a063f6b3e12 | 1,111 | https://github.com/littlebee/git-time-machine/blob/0fa2ac0d06951d3724cc171862b18a063f6b3e12/lib/git-time-machine-view.coffee | 164 | 196 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ee97545054e4fdcbbb5fea240230d11233a4dc92 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ee97545054e4fdcbbb5fea240230d11233a4dc92/lib/git-time-machine-view.coffee | 114 | 163 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machi... | $closeHandle.on('mousedown', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// why not? instead of adding callback, our own event...
return atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle");
});
atom.tooltips.add($closeHandle, {
titl... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ee97545054e4fdcbbb5fea240230d11233a4dc92 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ee97545054e4fdcbbb5fea240230d11233a4dc92/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
$closeHandle.on('mousedown', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// why not? instead of adding callback, our own event...
return atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:... | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ee97545054e4fdcbbb5fea240230d11233a4dc92 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ee97545054e4fdcbbb5fea240230d11233a4dc92/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | return
_renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate))
timeSpan = moment.duration... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | ee97545054e4fdcbbb5fea240230d11233a4dc92 | 1,111 | https://github.com/littlebee/git-time-machine/blob/ee97545054e4fdcbbb5fea240230d11233a4dc92/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:raw_corpus | raw_corpus | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 114 | 163 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machi... | $closeHandle.on('mousedown', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// why not? instead of adding callback, our own event...
return atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle");
});
atom.tooltips.add($closeHandle, {
titl... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
$closeHandle.on('mousedown', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
e.stopPropagation();
// why not? instead of adding callback, our own event...
return atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:... | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:3:completion | completion | $closeHandle.on 'mousedown', (e)->
e.preventDefault()
e.stopImmediatePropagation()
e.stopPropagation()
# why not? instead of adding callback, our own event...
atom.commands.dispatch(atom.views.getView(atom.workspace), "git-time-machine:toggle")
atom.tooltips.add($closeHandle, { title: ... | _renderStats: (commits) ->
content = ""
if commits.length > 0
byAuthor = _.indexBy commits, 'authorName'
authorCount = _.keys(byAuthor).length
durationInMs = moment.unix(commits[commits.length - 1].authorDate).diff(moment.unix(commits[0].authorDate))
timeSpan = moment.duration(durationIn... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 114 | 163 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:raw_corpus | raw_corpus | if reverse
rightRevHash = revHash
else
leftRevHash = revHash
# order by created asc
[leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash)
GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose)
@timeplot.setRevisions(leftRevH... | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 164 | 197 | ||
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if reverse
rightRevHash = revHash
else
leftRevHash = revHash
# order by created asc
[leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash)
GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHas... | var leftRevHash, rightRevHash,
indexOf = [].indexOf;
if (reverse) {
rightRevHash = revHash;
} else {
leftRevHash = revHash;
}
// order by created asc
[leftRevHash, rightRevHash] = this._orderRevHashes(leftRevHash, rightRevHash);
GitRevisionView.showRevision(this.lastActivatedEditor, leftRevHash, rightRevHash, ... | CoffeeScript | JavaScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 164 | 197 |
littlebee/git-time-machine:lib/git-time-machine-view.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var leftRevHash, rightRevHash,
indexOf = [].indexOf;
if (reverse) {
rightRevHash = revHash;
} else {
leftRevHash = revHash;
}
// order by created asc
[leftRevHash, rightRevHash] = this._orderRevHashes(leftRevHash, rightRevHash);
GitRevisionView.showRevisio... | if reverse
rightRevHash = revHash
else
leftRevHash = revHash
# order by created asc
[leftRevHash, rightRevHash] = @_orderRevHashes(leftRevHash, rightRevHash)
GitRevisionView.showRevision(@lastActivatedEditor, leftRevHash, rightRevHash, @_onRevisionClose)
@timeplot.setRevisions(leftRevH... | JavaScript | CoffeeScript | littlebee/git-time-machine | lib/git-time-machine-view.coffee | MIT | 2d2adcc4c8d3095653098d677e55020f71b2e4a1 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2d2adcc4c8d3095653098d677e55020f71b2e4a1/lib/git-time-machine-view.coffee | 164 | 197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.