Exemple #1
0
var ViewGenerator = module.exports = function ViewGenerator(args, options, config) {
  // By calling `NamedBase` here, we get the argument to the subgenerator call
  // as `this.name`.
  yeoman.generators.NamedBase.apply(this, arguments);

  this.viewName = fleck.singularize(this.name);
  this.pluralViewName = fleck.pluralize(this.name);
  this.viewPath ='app/views/'+this._.underscored(this.viewName)+'.coffee';
  this.templatePath = 'app/templates/'+this._.underscored(this.viewName)+'.mustache';
};
Exemple #2
0
function byType(parts) {
  var cat = fleck.singularize(parts.shift());
  var name = 

  parts.push(cat);
  name = buildName(cat, parts);

  return {
    name: name,
    cat: cat
  }
}
Exemple #3
0
RouterGenerator.prototype.files = function files() {
  this.models = [];
  var controllers = this.controller_files;
  for (var i in controllers) {
    var stripped = controllers[i].replace('_controller.js', '');
    this.models.push({
      single: fleck.singularize(stripped),
      plural: stripped
    });
  }
  this.copy('base.js', this.options.router_file);
};
RouterGenerator.prototype.files = function files() {
  this.models = [];
  var models = this.model_files;
  for (var i in models) {
    var extension = this._getJSPath('_model');
    var stripped = models[i].replace(extension, '');
    this.models.push({
      single: fleck.singularize(stripped),
      plural: fleck.pluralize(stripped)
    });
  }
  this.copy(this._getJSPath('base'), this.options.router_file);
};