{"size": 622, "ext": "js", "max_stars_repo_path": "component/index.js", "max_stars_repo_name": "Hellenic/generator-react-prototype", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "component/index.js", "max_issues_repo_name": "Hellenic/generator-react-prototype", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "component/index.js", "max_forks_repo_name": "Hellenic/generator-react-prototype", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.9230769231, "max_line_length": 76, "alphanum_fraction": 0.6655948553}
'use strict';

var yeoman = require('yeoman-generator');
var _ = require('underscore.string');

var ComponentGenerator = yeoman.Base.extend({
  constructor: function() {
    yeoman.Base.apply(this, arguments);

    this.argument('componentName', { type: String, defaults: 'Component' });
    this.pkg = require('../package.json');
  },

  writing: function() {
    var componentFileName = _.slugify(this.componentName);

    this.fs.copyTpl(
      this.templatePath('component.js'),
      this.destinationPath('app/components/' + componentFileName + '.js'),
      this
    );
  }
});

module.exports = ComponentGenerator;
