<commit_before>var assert = require('chai').assert;
var createActions = require('./createActions');
var createModel = require('./createModel');

function createResource(obj) {
  assert.deepProperty(obj, 'resource.name');
  assert.deepProperty(obj, 'resource.structure');
  assert.deepProperty(obj, 'methods.get');
  assert.deepProperty(obj, 'methods.put');
  assert.deepProperty(obj, 'methods.post');
  assert.deepProperty(obj, 'methods.patch');
  assert.deepProperty(obj, 'methods.delete');
  return _createResource(obj);
}

function _createResource(obj) {
  var resource = obj.resource;
  var methods = obj.methods;

  var model = createModel(resource);
  var actions = createActions(resource, methods);<commit_msg>Pluralize resource names<commit_after>var assert = require('chai').assert;
var createActions = require('./createActions');
var createModel = require('./createModel');

function createResource(obj) {
  assert.deepProperty(obj, 'resource.name');
  assert.deepProperty(obj, 'resource.structure');
  assert.deepProperty(obj, 'methods.get');
  assert.deepProperty(obj, 'methods.put');
  assert.deepProperty(obj, 'methods.post');
  assert.deepProperty(obj, 'methods.patch');
  assert.deepProperty(obj, 'methods.delete');
  return _createResource(obj);
}

function _createResource(obj) {
  var resource = obj.resource;
  resource.name += 's';
  var model = createModel(resource);
  var actions = createActions(obj);
{'fraction_non_alphanumeric': 0.15157894736842106, 'fraction_numerical': 0.0, 'mean_word_length': 6.202020202020202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4059950', 'n_tokens_mistral': 416, 'n_tokens_neox': 414, 'n_words': 83}