var isPackageMissing = require('ember-cli-is-package-missing');
var stringUtil = require('ember-cli-string-utils');

module.exports = {
  description: 'Generates a Falcor route and service mock.',
  availableOptions: [
    {
      name: 'route',
      type: 'string'
    },
    {
      name: 'method',
      type: 'string',
      default: 'get'
    }
  ],
  locals: function(options) {
    var contents;

    var name = options.entity.name;
    var dasherizedName = stringUtil.dasherize(name);
    var camelized = stringUtil.camelize(name);
    var classified = stringUtil.classify(name);

    switch (options.entity.method) {
      case 'get':
        contents = 'get: function(pathSets) { }';
        break;
      case 'set':
        contents = 'set: function(JSONGraphEnvelope) { }';
        break;
      case 'call':
        contents = 'call: function(callPath, args, pathSuffixes, paths) { }';
        break;
      default:
        contents = 'get: function(pathSets) { }';
        break;
    }

    return {
      route: 'fuck',
      contents: contents,
      camelizedName: camelized,
      classifyName: classified,
      dasherizedName: dasherizedName
    };
  },

  afterInstall: function(options) {
   var jsonGraphMissing = isPackageMissing(this, 'falcor-json-graph');
   var libsToInstall = [];

   if (jsonGraphMissing) {
     libsToInstall.push({ name: 'falcor-json-graph', target: '^1.1.5' });
   }

   if (!options.dryRun && jsonGraphMissing) {
     return this.addPackagesToProject(libsToInstall);
   }

 }
};

@@ -108,16 +108,103 @@
 utils');
+%0Avar Blueprint = require('ember-cli/lib/models/blueprint');%0Avar path = require('path');
 %0A%0Amodule
@@ -436,16 +436,342 @@
  %7D%0A  %5D,%0A
+%0A  beforeInstall: function(options) %7B%0A    var serverBlueprint = Blueprint.lookup('falcor-server', %7B%0A      ui: this.ui,%0A      analytics: this.analytics,%0A      project: this.project,%0A      paths: %5Bpath.join(this.project.nodeModulesPath, 'ember-falcor', 'blueprints')%5D%0A    %7D);%0A%0A    return serverBlueprint.install(options);%0A  %7D,%0A%0A
   locals
@@ -1023,16 +1023,24 @@
 .entity.
+options.
 method) 
@@ -1445,14 +1445,36 @@
 te: 
-'fuck'
+options.entity.options.route
 ,%0A  

Fix option passing