Constructor function for the Slay app object.
@param {string} root Root directory of the application
@param {object} options Options for this app instance.
@constructor
766194
function App(root, options) {
  options = options || {};
  if (!root || typeof root !== 'string') {
    throw new Error('Application root is not provided or not a string.');
  }
  if (typeof options !== 'object') {
    throw new Error('Application options is not provided or not an object.');
  }

  Broadway.call(this, options, express());
  App.bootstrap(this, root);
}
994651
function buildApp(src, dest, options, callback) {
  const appArgs = selectAppArgs(options);
  copy(src, dest, (error) => {
    if (error) {
      callback(`Error Copying temporary directory: ${error}`);
      return;
    }

    fs.writeFileSync(
      path.join(dest, '/nativefier.json'),
      JSON.stringify(appArgs),
    );

    maybeCopyScripts(options.inject, dest)
      .catch((err) => {
        log.warn(err);
      })
      .then(() => {
        changeAppPackageJsonName(dest, appArgs.name, appArgs.targetUrl);
        callback();
      });
  });
}
42538
public static void main (String[] args)
    {
        if (args.length <= 1) {
            System.err.println("Usage: I18nSyncTask rootDir rootDir/com/mypackage/Foo.properties " +
                               "[.../Bar.properties ...]");
            System.exit(255);
        }

        File rootDir = new File(args[0]);
        if (!rootDir.isDirectory()) {
            System.err.println("Invalid root directory: " + rootDir);
            System.exit(255);
        }

        I18nSync tool = new I18nSync();
        boolean errors = false;
        for (int ii = 1; ii < args.length; ii++) {
            try {
                tool.process(rootDir, new File(args[ii]));
            } catch (IOException ioe) {
                System.err.println("Error processing '" + args[ii] + "': " + ioe);
                errors = true;
            }
        }
        System.exit(errors ? 255 : 0);
    }
1135391
function init (root, storage) {
  // calling path
  const calling = path.dirname(getCallingScript())

  // root path
  root = !root || root === '.' || root === './'
    ? root = calling
    : path.isAbsolute(root)
      ? root
      : path.normalize(calling + root)
  sketchpad.root = root.replace(/\/*$/, '/')

  // settings path
  const settingsFolder = path.normalize(sketchpad.root + (storage || 'storage') + '/sketchpad/')
  settingsFile = settingsFolder + 'settings.json'

  // check for settings
  if (!fs.existsSync(settingsFolder)) {
    return error('Folder "' +settingsFolder+ '" not found')
  }
  if (!fs.existsSync(settingsFile)) {
    return error('File "settings.json" not found in "' +settingsFolder+ '"')
  }

  // load settings
  sketchpad.load()
  return this
}
334286
function initMembers(rootPath) {

    this._rootPath = rootPath;
    ShellJS.mkdir(this._rootPath);

    this._appPath = this._rootPath + Path.sep + "app";
    ShellJS.mkdir(this._appPath);

    this._logPath = Path.join(OS.tmpdir(), "crosswalk-app-tools-" + this._packageId);
    ShellJS.mkdir(this._logPath);

    // Packages end up in working dir
    this._pkgPath = process.cwd();

    this._prjPath = this._rootPath + Path.sep + "prj";
    ShellJS.mkdir(this._prjPath);
}
777189
@Override
    public void initialise(String root) {
        functionCalls.clear();
        variables.clear();
        initCreator(root);
    }
1007153
function main(opt) {
    var t = opt.types
    var template = opt.template

    return {
        manipulateOptions: function (rp) {
            var resolveModuleSource = rp.resolveModuleSource
            resolve =  resolveModuleSource || defaultResolve
        },

        visitor: {
            ImportDeclaration: {
                exit: function (curPath, state) {
                    var opts = state.opts
                    var file = state.file


                    var importPath = curPath.node.source.value
                    var jsFilename = file.opts.filename

                    if (importPath.endsWith('.css')) {
                        const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development'
                        if (env === 'development') {
                            devHandler(curPath, importPath, jsFilename)
                        } else {
                            prodHandler(curPath, opts, importPath, jsFilename, template, t)
                        }
                    }
                }
            }
        }
    }
}
785072
function main(args) {
    // Get the launch options/arguments.
    // TODO: These casts could be fixed if all the options weren't ?optional.
    const logger = logger_1.getLogger(args.verbose);
    const barrelName = barrelName_1.getBarrelName(args.name, logger);
    const rootPath = rootPath_1.resolveRootPath(args.directory);
    const baseUrl = baseUrl_1.getCombinedBaseUrl(rootPath, args.baseUrl);
    // Build the directory tree.
    const rootTree = fileTree_1.buildTree(rootPath, barrelName, logger);
    // Work out which directories should have barrels.
    const destinations = destinations_1.getDestinations(rootTree, args.location, barrelName, logger);
    // Potentially there are some existing barrels that need removing.
    purge_1.purge(rootTree, args.delete !== undefined && args.delete, barrelName, logger);
    // Create the barrels.
    const quoteCharacter = quoteCharacter_1.getQuoteCharacter(args.singleQuotes);
    const semicolonCharacter = noSemicolon_1.getSemicolonCharacter(args.noSemicolon);
    builder_1.buildBarrels(destinations, quoteCharacter, semicolonCharacter, barrelName, logger, baseUrl, args.structure, !!args.local, [].concat(args.include || []), [].concat(args.exclude || []));
}
172211
function handle(options, callback) {
  if (_.isString(options)) {
    options = { path: options };
  }

  if (_.isObject(options)) {
    const opts = { };
    _.merge(opts, config, options);
    options = opts;
  } else {
    options = _.cloneDeep(config);
  }

  options.path = options.path || config.get("home");
  return stat(options.path, function(err, stats) {
    if (err) {
      return callback(err);
    }

    const done = wrap(stats, callback);

    if (stats.isDirectory()) {
      options.dirStats = stats;
      return processDir(options, done);
    } else if (stats.isFile()) {
      return processFile(options, done);
    }

    return callback(null, null);
  });
}
1292294
function setResourcePaths( root){
  rootPath = root;
  router.setPathToContent       ( root + '/app/content');
  renderer.setPathToTemplates   ( root + '/app/templates');
  renderer.setPathToModules     ( root + '/app/modules');
  renderer.setPathToStaticFiles ( root + '/app/static');
  console.info( 'running from %s', root);
}
967551
function(name, root) {
    this.name = name;
    if (root) {
        this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
    } else {
        this.root = new DirectoryEntry(this.name, '/', this);
    }
}
1007051
function create(root) {
    var result = toc(root);

    var node = result.map;

    if(!node) return null;

    data(node, {
        class: ['vremark-toc']
    });

    return result.map;
}
942052
function findRoot(root) {
  var pkg;
  root = root.split(path.sep);
  while(!pkg && root.length > 1) {
    var cur = root.join(path.sep);
    if(fs.existsSync(path.join(cur, "package.json"))) {
      return cur;
    }
    root.pop();
  }
}
786667
function Kona(options) {

  // call the koa constructor here
  Koa.call(this);

  options = options || {};

  // setup kona root and application paths / helpers
  this.setupPaths(options);

  // setup env vars, logger, needed modules
  this.setupEnvironment(options);

  this.loadMixins(this.root.join('package.json'));
}
528850
function (options) {
    var Router, args;
    if (this.get('parent')) {
      throw new Error('Only the root route may be exported as an Ember router.');
    }
    args = slice.call(arguments);
    if (!args.length || args[args.length - 1] instanceof Ember.Mixin) {
      args.push(options = {});
    }
    else {
      options = args[args.length - 1];
    }
    options._enhancedRouterRootMeta = this;
    Router = Ember.Router.extend.apply(Ember.Router, args);
    Router.map(this.get('mapFunction'));
    return Router;
  }
1300583
def ng_option(options, opt = {})
    opt[:root_selector] ||= ng_root_selector
    row = ng.row(opt)
    ng_options(options, opt)[row]
  end
330637
function createDOM (rootDoc, id, option) {
  var el = rootDoc.getElementById(id);
  var head = rootDoc.getElementsByTagName('head')[0];
  if(el) {
    if(option.append) return el
    el.parentNode && el.parentNode.removeChild(el);
  }
  el = rootDoc.createElement('style');
  head.appendChild(el);
  el.setAttribute('id', id);
  if (option.attrs)
    for (var i in option.attrs) {
      el.setAttribute(i, option.attrs[i]);
    }
  return el
}