How to use core-object - 10 common examples

To help you get started, we’ve selected a few core-object examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github isleofcode / corber / node-tests / fixtures / corber-mock / corber / config / framework.js View on Github external
//Mock Ember Config
const CoreObject    = require('core-object');

module.exports = CoreObject.extend({
  name: 'ember'
});
github ember-cli / ember-cli / lib / models / blueprint.js View on Github external
uses these hooks to add and remove relevant route declarations in
  `app/router.js`.

  ### Overriding Install

  If you don't want your blueprint to install the contents of
  `files` you can override the `install` method. It receives the
  same `options` object described above and must return a promise.
  See the built-in `resource` blueprint for an example of this.

  @class Blueprint
  @constructor
  @extends CoreObject
  @param {String} [blueprintPath]
*/
let Blueprint = CoreObject.extend({
  availableOptions: [],
  anonymousOptions: ['name'],

  _printableProperties: [
    'name',
    'description',
    'availableOptions',
    'anonymousOptions',
    'overridden',
  ],

  init(blueprintPath) {
    this._super();

    this.path = blueprintPath;
    this.name = path.basename(blueprintPath);
github ember-cli-deploy / ember-cli-deploy / lib / utilities / adapter.js View on Github external
var CoreObject  = require('core-object');
var Promise     = require('ember-cli/lib/ext/promise');
var SilentError = require('silent-error');

module.exports = CoreObject.extend({
  upload: function() {
    var message = 'You have to implement the `upload` method in a subclass ' +
                  'of Adapter!';

    return Promise.reject(new SilentError(message));
  }
});
github isleofcode / corber / lib / objects / emulator.js View on Github external
const CoreObject       = require('core-object');

module.exports = CoreObject.extend({
  id: undefined,
  platform: undefined,
  name: undefined,

  label() {
    return `${this.platform} - ${this.name}`;
  }
});
github isleofcode / corber / lib / frameworks / framework.js View on Github external
const CoreObject       = require('core-object');
const Promise          = require('rsvp').Promise;

module.exports = CoreObject.extend({
  afterInstall() {
    return Promise.resolve();
  }
});
github ember-cli / ember-try / lib / tasks / reset.js View on Github external
'use strict';

const CoreObject = require('core-object');
const debug = require('debug')('ember-try:commands:reset');
const ScenarioManager = require('../utils/scenario-manager');
const DependencyManagerAdapterFactory = require('./../utils/dependency-manager-adapter-factory');

module.exports = CoreObject.extend({
  run() {
    let dependencyAdapters = this.dependencyManagerAdapters || DependencyManagerAdapterFactory.generateFromConfig(this.config, this.project.root);
    debug('DependencyManagerAdapters: %s', dependencyAdapters.map((item) => { return item.configKey; }));
    return new ScenarioManager({ dependencyManagerAdapters: dependencyAdapters }).cleanup();
  },
});
github deployjs / deployjs-cli / commands / command-factory.js View on Github external
run(commandType, project, options) {
    if(!this.commands[commandType]) {
      throw new Error('command `' + commandType + '` not supported');
    }

    let command = new (CoreObject.extend(this.commands[commandType]))();
    command.project = project;
    command.ui = project.ui;

    return command.run(options, [ options.environment ]);
  }
});
github angular / angular-cli / packages / @angular / cli / ember-cli / lib / models / command.js View on Github external
insideProject: true,
  outsideProject: true,
  everywhere: true,
};

path.name = 'Path';

/**
 * The base class for all CLI commands.
 *
 * @module ember-cli
 * @class Command
 * @constructor
 * @extends CoreObject
 */
let Command = CoreObject.extend({
  /**
   * The description of what this command does.
   *
   * @final
   * @property description
   * @type String
   */
  description: null,

  /**
   * Does this command work everywhere or just inside or outside of projects.
   *
   * Possible values:
   *
   * - `insideProject`
   * - `outsideProject`
github ember-cli / ember-cli / lib / models / command.js View on Github external
return true;
    } else {
      return false;
    }
  },
};

/**
 * The base class for all CLI commands.
 *
 * @module ember-cli
 * @class Command
 * @constructor
 * @extends CoreObject
 */
let Command = CoreObject.extend({
  /**
   * The description of what this command does.
   *
   * @final
   * @property description
   * @type String
   */
  description: null,

  /**
   * Does this command work everywhere or just inside or outside of projects.
   *
   * Possible values:
   *
   * - `insideProject`
   * - `outsideProject`
github fossasia / susper.com / node_modules / @angular / cli / ember-cli / lib / models / command.js View on Github external
insideProject: true,
  outsideProject: true,
  everywhere: true,
};

path.name = 'Path';

/**
 * The base class for all CLI commands.
 *
 * @module ember-cli
 * @class Command
 * @constructor
 * @extends CoreObject
 */
let Command = CoreObject.extend({
  /**
   * The description of what this command does.
   *
   * @final
   * @property description
   * @type String
   */
  description: null,

  /**
   * Does this command work everywhere or just inside or outside of projects.
   *
   * Possible values:
   *
   * - `insideProject`
   * - `outsideProject`

core-object

A lightweight implementation of OOP Class in JavaScript

MIT
Latest version published 7 years ago

Package Health Score

59 / 100
Full package analysis

Popular core-object functions

Similar packages