[
  {
    "path": ".bowerrc",
    "content": "{\n  \"directory\": \"bower_components\"\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "# EditorConfig helps developers define and maintain consistent\n# coding styles between different editors and IDEs\n# editorconfig.org\n\nroot = true\n\n\n[*]\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nindent_style = space\nindent_size = 2\n\n[*.js]\nindent_style = space\nindent_size = 2\n\n[*.hbs]\nindent_style = space\nindent_size = 2\n\n[*.css]\nindent_style = space\nindent_size = 2\n\n[*.html]\nindent_style = space\nindent_size = 2\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".ember-cli",
    "content": "{\n  /**\n    Ember CLI sends analytics information by default. The data is completely\n    anonymous, but there are times when you might want to disable this behavior.\n\n    Setting `disableAnalytics` to true will prevent any data from being sent.\n  */\n  \"disableAnalytics\": false\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# compiled output\n/dist\n!/dist/.keep\n/tmp\n\n# dependencies\n/node_modules\n/bower_components/*\n\n# misc\n/.sass-cache\n/connect.lock\n/coverage/*\n/libpeerconnection.log\nnpm-debug.log\ntestem.log\n.idea\n"
  },
  {
    "path": ".hound.yml",
    "content": "javascript:\n  enabled: true\n  config_file: .jshintrc\n"
  },
  {
    "path": ".jshintrc",
    "content": "{\n  \"predef\": [\n    \"document\",\n    \"window\",\n    \"-Promise\"\n  ],\n  \"browser\": true,\n  \"boss\": true,\n  \"curly\": true,\n  \"debug\": false,\n  \"devel\": true,\n  \"eqeqeq\": true,\n  \"evil\": true,\n  \"forin\": false,\n  \"immed\": false,\n  \"laxbreak\": false,\n  \"newcap\": true,\n  \"noarg\": true,\n  \"noempty\": false,\n  \"nonew\": false,\n  \"nomen\": false,\n  \"onevar\": false,\n  \"plusplus\": false,\n  \"regexp\": false,\n  \"undef\": true,\n  \"sub\": true,\n  \"strict\": false,\n  \"white\": false,\n  \"eqnull\": true,\n  \"esnext\": true,\n  \"unused\": true,\n  \"moz\": true\n}\n"
  },
  {
    "path": ".npmignore",
    "content": "test-app\ntests\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\n\nsudo: false\n\ncache:\n  directories:\n    - node_modules\n\ninstall:\n  - npm install -g bower\n  - npm install\n  - bower install\n\nscript:\n  - npm test\n"
  },
  {
    "path": ".watchmanconfig",
    "content": "{\n  \"ignore_dirs\": [\"tmp\", \"dist\"]\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2014 Jake Craige\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# ember-cli-cordova [![Build Status](https://travis-ci.org/poetic/ember-cli-cordova.svg?branch=master)](https://travis-ci.org/poetic/ember-cli-cordova) [![Gitter](https://badges.gitter.im/poetic/ember-cli-cordova.svg)](https://gitter.im/poetic/ember-cli-cordova?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n\nI will not be focusing on backward compatibility with older ember-cli versions\nas it's moving too fast and the API is constantly changing. I will always have\nthis working with the latest stable release of ember-cli.\n\n## Goals\n\nTo provide a toolchain tightly integrated with ember-cli to make developing hybrid\napps with cordova and ember as simple as possible.\n\n## Supported Platforms\n\nAndroid and iOS. While we don't plan on actively supporting other platforms,\nfeel free to open an issue or submit a pull request.\n\n## Required Ember Versions\n\nReleases as of 0.1.0 require Ember 2.x and ember-cli 2.3.0.\n\nThe lastest release for Ember 1.x is 0.0.19 and requires at least ember-cli >= 0.1.1\n\n## Getting Started\n\nPlease see our Getting Started guide\n[here](https://github.com/poetic/ember-cli-cordova/blob/master/docs/getting-started.md)\n\n## Blueprints\n+ `ember g cordova-init com.reverse.domain --platform=android` Required generator\n  that sets up the cordova project with a few tweaks to the ember app\n+ (optional) `ember g cordova-starter-kit` Adds some packages and files that makes up the\n  base setup for projects I develop.\n\n## Commands\n+ `ember cordova:open` open xcode project\n+ `ember cordova:build --environment=production --platform=ios` build cordova project\n+ `ember cordova:archive 0.0.2 --environment=staging --commit --tag` archive ios project with xcode\n+ `ember cordova:prepare` needs to be run after cloning a project\n+ `ember cordova` Passes commands(plugin(s), platform(s), run, emulate) and arguments to the cordova command\n+ `ember help` ember cli help with a section for addon provided commands as well\n\n# Docs\n\nDocumentation can be found found in the docs directory [here](https://github.com/poetic/ember-cli-cordova/tree/master/docs).\n\n- [Getting Started](https://github.com/poetic/ember-cli-cordova/blob/master/docs/getting-started.md)\n- [Configuration](https://github.com/poetic/ember-cli-cordova/blob/master/docs/configuration.md)\n- [FAQ](https://github.com/poetic/ember-cli-cordova/blob/master/docs/faq.md)\n\n# ember-cordova\n\n[ember-cordova](https://github.com/isleofcode/ember-cordova) recently started as a fork of ember-cli-cordova by some\ncontributors and maintainers. It only supports Ember 2, and includes\nadded features such as build hooks, native splash screen & icon management,\na platform service (e.g. isIOS) and an ember/cordova plugin ecosystem.\n\nember-cli-cordova will still be maintained and active.\n\nIt does not include features such as mobiletouch by default, starter\nblueprints and support for Ember <2. For these items, your best bet is\nto continue with ember-cli-cordova.\n\n# Dependency Docs\n\n-  [ember-cli](http://ember-cli.com)\n-  [cordova](http://cordova.apache.org/docs/en/4.0.0/)\n\n# Contributing\n\n## Working with master\n\n``` sh\ngit clone https://github.com/poetic/ember-cli-cordova.git\ncd ember-cli-cordova\nnpm i && bower i\nnpm link\nember new CordovaTest\ncd CordovaTest\nnpm install --save-dev ember-cli-cordova\nnpm link ember-cli-cordova\n```\n\nAfter this, any changes you make to the cloned repo will be instantly reflected\nin the test app you generated. It just symlinks the node_modules folder.\n\n# Example App\n\nYou can find an example app using this here:\n[jakecraige/ember-cli-cordova-example-app](https://github.com/jakecraige/ember-cli-cordova-example-app)\n\n# Credits\n\n[ember-cli](https://github.com/stefanpenner/ember-cli)\n[ember](https://github.com/emberjs/emberjs)\n"
  },
  {
    "path": "addon/initializers/in-app-livereload.js",
    "content": "import redirect from '../utils/redirect';\n\nexport var initialize = function(app, config) {\n  var url = config.cordova.emberUrl || 'http://localhost:4200';\n  return redirect(url);\n};\n\nexport default {\n  name: 'cordova:in-app-livereload',\n  initialize: initialize\n};\n"
  },
  {
    "path": "addon/mixins/controllers/nav-bar.js",
    "content": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n  nav: {\n    title: { },\n    leftButton: { },\n    rightButton: { }\n  },\n\n  actions: {\n    leftButton: function() {\n      var leftAction = this.get('nav.leftButton.action');\n\n      if(leftAction) {\n        leftAction();\n      }\n    },\n\n    rightButton: function() {\n      var rightAction = this.get('nav.rightButton.action');\n\n      if(rightAction) {\n        rightAction();\n      }\n    },\n\n    resetNavBar: function() {\n      this.set('nav', {\n        title: { },\n        leftButton: { },\n        rightButton: { }\n      });\n    }\n  }\n});\n"
  },
  {
    "path": "addon/mixins/cordova-events.js",
    "content": "/* jshint esnext:true */\n\nimport Ember from 'ember';\n\n// include this mixin to define cordova event listeners with an onCordova object\n//\n// onCordova supports arrays, strings, and anonymous functions, e.g.:\n//\n// ```\n// export default MyEmberObject.extend({\n//   onCordova: {\n//     pause: ['pauseListening', 'disconnectPeripheral'],\n//     resume: 'resumeListening',\n//     volumeup: function() { console.log('a little bit louder now'); }\n//   }\n// });\n// ```\nexport default Ember.Mixin.create({\n  cordova: Ember.inject.service(),\n\n  subscribeToCordovaEvents: Ember.on('init', function() {\n    var cordova = this.get('cordova'),\n        onCordova = this.get('onCordova');\n\n    Ember.keys(onCordova).forEach(function(key) {\n      var func = Ember.get(onCordova, key);\n\n      // subscribe to events\n      if (func instanceof Array) {\n        func.forEach(function(fn) {\n          if (this._validateIsFunction(fn)) {\n            cordova.on(key, this, fn);\n          }\n        }, this);\n      } else {\n        if (this._validateIsFunction(func)) {\n          cordova.on(key, this, func);\n        }\n      }\n    }, this);\n  }),\n\n  _validateIsFunction: function(func) {\n    var isFunction = false;\n\n    if (func instanceof Function) {\n      isFunction = true;\n    } else if (typeof func === 'string') {\n      var fn = this.get(func);\n\n      isFunction = fn instanceof Function;\n    }\n\n    return isFunction;\n  }\n});\n"
  },
  {
    "path": "addon/mixins/routes/nav-bar.js",
    "content": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n  _navController: Ember.computed('nav.controller', function() {\n    var name = this.get('nav.controller') || 'application';\n\n    return this.controllerFor(name);\n  }),\n\n  afterModel: function(model) {\n    this._setDefaults();\n    this._setNavOptions(model);\n    this._setNavActions();\n\n    return this._super.apply(this, arguments);\n  },\n\n  // Since we are using so many nested paths this makes sure they are set to\n  // null values\n  _setDefaults: function() {\n    var ctrl = this.get('_navController');\n\n    if(!ctrl.get('nav')) {\n      ctrl.send('resetNavBar');\n\n    } else if(!ctrl.get('nav.title')) {\n      ctrl.set('nav.title', {});\n\n    } else if(!ctrl.get('nav.leftButton')) {\n      ctrl.set('nav.leftButton', {});\n\n    } else if(!ctrl.get('nav.rightButton')) {\n      ctrl.set('nav.rightButton', {});\n    }\n  },\n\n  _setNavOptions: function(model) {\n    var ctrl = this.get('_navController');\n\n    var navOptions = Ember.A([\n      'title.text',\n      'leftButton.text', 'leftButton.icon',\n      'rightButton.text', 'rightButton.icon'\n    ]);\n\n    navOptions.forEach(function(key){\n      var optionPath = 'nav.' + key;\n      var value      = this.get(optionPath);\n\n      if (value) {\n        if(Ember.typeOf(value) === 'function') {\n          value = value.call(this, model);\n        }\n\n        ctrl.set(optionPath, value);\n      }\n    }, this);\n  },\n\n  _setNavActions: function() {\n    var ctrl = this.get('_navController');\n\n    Ember.A(['leftButton', 'rightButton']).forEach(function(button) {\n      var actionPath = 'nav.' + button + '.action';\n\n      var action = this.get(actionPath);\n      if (action) {\n        ctrl.set(actionPath, Ember.run.bind(this, action));\n      }\n    }, this);\n  },\n\n  actions: {\n    willTransition: function() {\n      this.get('_navController').send('resetNavBar');\n      return this._super.apply(this, arguments);\n    }\n  }\n});\n"
  },
  {
    "path": "addon/services/cordova.js",
    "content": "/* jshint esnext:true */\n\nimport Ember from 'ember';\n\n// from https://cordova.apache.org/docs/en/4.0.0/cordova_events_events.md.html\n// use var because cordova/android was throwing errors re: const && strict mode\nvar CORDOVA_EVENTS = Ember.A([\n  'deviceready',\n  'pause',\n  'resume',\n  'backbutton',\n  'menubutton',\n  'searchbutton',\n  'startcallbutton',\n  'endcallbutton',\n  'volumedownbutton',\n  'volumeupbutton',\n  'batterycritical',\n  'batterylow',\n  'batterystatus',\n  'online',\n  'offline'\n]);\n\n// the cordova service listens for cordova events emitted to the document,\n// and triggers the same events in emberland.\n//\n// subscribe to cordova events as such:\n//\n// ```javascript\n// export default MyEmberObject.extend({\n//   cordova: Ember.inject.service()\n//\n//   init: function() {\n//     cordova.on('resume', function() { console.log('i am resumed'); });\n//   }\n// });\n// ```\nexport default Ember.Service.extend(\n  Ember.Evented, {\n\n  setEventTriggers: Ember.on('init', function() {\n    var _this = this;\n\n    CORDOVA_EVENTS.forEach(function(eventName) {\n      Ember.$(document).on(eventName, function() {\n        _this.trigger(eventName);\n      });\n    });\n  })\n});\n"
  },
  {
    "path": "addon/utils/redirect.js",
    "content": "import Ember from 'ember';\n\nexport default function(url) {\n  if(window.location.href.indexOf('file://') > -1) {\n    Ember.run.later(function() {\n      window.location.replace(url);\n    }, 50);\n  }\n}\n"
  },
  {
    "path": "app/components/cdv-nav-bar.js",
    "content": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n  tagName: 'header'\n});\n"
  },
  {
    "path": "app/initializers/in-app-livereload.js",
    "content": "/* globals cordova */\n\nimport config from '../config/environment';\nimport reloadInitializer from 'ember-cli-cordova/initializers/in-app-livereload';\n\nvar inAppReload = reloadInitializer.initialize;\n\nexport var initialize = function(app) {\n  if(typeof cordova === 'undefined' ||\n      config.environment !== 'development' ||\n      (config.cordova &&\n        (!config.cordova.liveReload || !config.cordova.liveReload.enabled))) {\n    return;\n  }\n\n  return inAppReload(app, config);\n};\n\nexport default {\n  name: 'cordova:in-app-livereload',\n  initialize: initialize\n};\n"
  },
  {
    "path": "app/services/cordova.js",
    "content": "/* jshint esnext:true */\n\nimport CordovaService from 'ember-cli-cordova/services/cordova';\n\nexport default CordovaService.extend({});\n"
  },
  {
    "path": "app/templates/cdv-generic-nav-bar.hbs",
    "content": "{{#if nav.leftButton.text}}\n  <button {{action 'leftButton'}}>\n    {{#if nav.leftButton.icon}}\n      <i class=\"icon {{nav.leftButton.icon}}\"></i>\n    {{/if}}\n    {{nav.leftButton.text}}\n  </button>\n{{/if}}\n\n{{#if nav.title.text}}\n  <h1>\n    {{nav.title.text}}\n  </h1>\n{{/if}}\n\n{{#if nav.rightButton.text}}\n  <button {{action 'rightButton'}}>\n    {{#if nav.rightButton.icon}}\n      <i class=\"icon {{nav.rightButton.icon}}\"></i>\n    {{/if}}\n    {{nav.rightButton.text}}\n  </button>\n{{/if}}\n"
  },
  {
    "path": "app/templates/components/cdv-nav-bar.hbs",
    "content": "{{yield}}\n"
  },
  {
    "path": "blueprints/cordova-init/files/config/environment.js",
    "content": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n  var ENV = {\n    modulePrefix: '<%= modulePrefix %>',\n    environment: environment,\n    baseURL: '/',\n    defaultLocationType: 'auto',\n    EmberENV: {\n      FEATURES: {\n        // Here you can enable experimental features on an ember canary build\n        // e.g. 'with-controller': true\n      }\n    },\n\n    APP: {\n      // Here you can pass flags/options to your application instance\n      // when it is created\n    },\n\n    cordova: {\n      rebuildOnChange: false,\n      emulate: false\n    }\n  };\n\n  if (environment === 'development') {\n    // ENV.APP.LOG_RESOLVER = true;\n    ENV.APP.LOG_ACTIVE_GENERATION = true;\n    // ENV.APP.LOG_TRANSITIONS = true;\n    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;\n    ENV.APP.LOG_VIEW_LOOKUPS = true;\n  }\n\n  if (environment === 'test') {\n    // Testem prefers this...\n    ENV.baseURL = '/';\n    ENV.locationType = 'none';\n\n    // keep test console output quieter\n    ENV.APP.LOG_ACTIVE_GENERATION = false;\n    ENV.APP.LOG_VIEW_LOOKUPS = false;\n\n    ENV.APP.rootElement = '#ember-testing';\n  }\n\n  if (environment === 'production') {\n\n  }\n\n  return ENV;\n};\n"
  },
  {
    "path": "blueprints/cordova-init/files/gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# compiled output\n/dist\n/tmp\n\n# dependencies\n/node_modules\n/bower_components/*\n\n# misc\n/.sass-cache\n/connect.lock\n/coverage/*\n/libpeerconnection.log\nnpm-debug.log\ntestem.log\n\n# iOS\ncordova/platforms/ios/build/\ncordova/platforms/ios/www/\ncordova/platforms/ios/cordova/console.log\n*.xcuserdatad\n\n# android\ncordova/platforms/android/assets/www\ncordova/platforms/android/bin\ncordova/platforms/android/gen\ncordova/platforms/android/local.properties\ncordova/platforms/android/ant-build\ncordova/platforms/android/ant-gen\ncordova/platforms/android/CordovaLib/ant-build\ncordova/platforms/android/CordovaLib/ant-gen\ncordova/platforms/android/CordovaLib/bin\ncordova/platforms/android/CordovaLib/gen\ncordova/platforms/android/CordovaLib/local.properties\n\n# wp8\ncordova/platforms/wp8/bin\ncordova/platforms/wp8/obj\ncordova/platforms/wp8/www\ncordova/platforms/wp8/.staging\ncordova/platforms/wp8/*.suo\ncordova/platforms/wp8/*.csproj.user\n\n#browser\ncordova/platforms/browser/build\ncordova/platforms/browser/www\n"
  },
  {
    "path": "blueprints/cordova-init/index.js",
    "content": "var projectWithConfig = require('../../lib/models/project-with-config');\nvar Promise           = require('../../lib/ext/promise');\nvar stringUtils       = require('../../lib/utils/string');\nvar defaultPlatform   = require('../../lib/utils/default-platform');\n\nmodule.exports = {\n  locals: function(options) {\n    var name = options.project.pkg.name;\n\n    return {\n      namespace:     stringUtils.classify(name),\n      modulePrefix:  stringUtils.dasherize(name)\n    }\n  },\n\n  afterInstall: function(options) {\n    this.options          = options.entity.options;\n    this.options.platform = options.platform || defaultPlatform(this.project);\n\n    projectWithConfig(this.project, options.entity.name);\n\n    return this.setupCordova();\n  },\n\n  setupCordova: function() {\n    var createProject   = require('../../lib/tasks/create-cordova-project')(this.project);\n    var addPlatforms    = require('../../lib/tasks/add-platforms')(this.project, this.options);\n    var updateConfig    = require('../../lib/tasks/update-config-xml')(this.project);\n    var linkEnvironment = require('../../lib/tasks/link-environment')(this.project);\n\n    return createProject().then(addPlatforms).then(updateConfig).then(linkEnvironment);\n  }\n};\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/files/app/adapters/application.js",
    "content": "import DS from 'ember-data';\nimport config from '../config/environment';\n\nexport default DS.ActiveModelAdapter.extend({\n  host: config.apiUrl\n});\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/files/app/routes/application.js",
    "content": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n  actions: {\n    back: function() {\n      history.back();\n    },\n\n    openLink: function(url) {\n      window.open(url, '_system');\n    }\n  }\n});\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/files/app/styles/app.scss",
    "content": "* {\n  -webkit-tap-highlight-color: rgba(0,0,0,0);\n  -webkit-tap-highlight-color: transparent;\n  box-sizing: border-box;\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  input, textarea {\n    -webkit-touch-callout: auto;\n    -webkit-user-select: auto;\n  }\n}\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/files/app/templates/application.hbs",
    "content": "<h1>Welcome to ember-cli-cordova!</h1>\n\n{{liquid-outlet name=\"main\"}}\n\n{{liquid-outlet modal}}\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/files/app/transitions.js",
    "content": "export default function() {\n\n}\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/files/config/environment.js",
    "content": "/* jshint node: true */\n\nvar os     = require('os');\nvar ifaces = os.networkInterfaces();\n\nvar addresses = [];\nfor (var dev in ifaces) {\n  ifaces[dev].forEach(function(details){\n    if(details.family === 'IPv4' && details.address !== '127.0.0.1') {\n      addresses.push(details.address);\n    }\n  });\n}\n\nmodule.exports = function(environment) {\n  var ENV = {\n    modulePrefix: '<%= modulePrefix %>',\n    environment: environment,\n    baseURL: '/',\n    defaultLocationType: 'auto',\n    EmberENV: {\n      FEATURES: {\n        // Here you can enable experimental features on an ember canary build\n        // e.g. 'with-controller': true\n      }\n    },\n\n    APP: {\n      // Here you can pass flags/options to your application instance\n      // when it is created\n    },\n\n    cordova: {\n      rebuildOnChange: false,\n      emulate: false,\n      emberUrl: 'http://' + addresses[0] + ':4200',\n      liveReload: {\n        enabled: false,\n        platform: 'ios'\n      }\n    }\n  };\n\n  if (environment === 'development') {\n    // ENV.APP.LOG_RESOLVER = true;\n    ENV.APP.LOG_ACTIVE_GENERATION = true;\n    // ENV.APP.LOG_TRANSITIONS = true;\n    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;\n    ENV.APP.LOG_VIEW_LOOKUPS = true;\n\n    ENV.apiUrl   = 'http://' + addresses[0] + ':3000/api/v1';\n    ENV.development = true;\n  }\n\n  if (environment === 'test') {\n    // Testem prefers this...\n    ENV.baseURL = '/';\n    ENV.locationType = 'auto';\n\n    // keep test console output quieter\n    ENV.APP.LOG_ACTIVE_GENERATION = false;\n    ENV.APP.LOG_VIEW_LOOKUPS = false;\n\n    ENV.APP.rootElement = '#ember-testing';\n  }\n\n  if (environment === 'staging') {\n    ENV.apiUrl = 'http://<%= modulePrefix %>-staging.herokuapp.com/api/v1';\n    ENV.staging = true;\n  }\n\n\n  if (environment === 'production') {\n    ENV.apiUrl = 'http://<%= modulePrefix %>.herokuapp.com/api/v1';\n    ENV.production = true;\n  }\n\n  return ENV;\n};\n"
  },
  {
    "path": "blueprints/cordova-starter-kit/index.js",
    "content": "var path        = require('path');\nvar chalk       = require('chalk');\nvar Promise     = require('../../lib/ext/promise');\nvar stringUtils = require('../../lib/utils/string');\nvar runCommand  = require('../../lib/utils/run-command');\n\nmodule.exports = {\n  // Allows the generator to not require an entity name\n  normalizeEntityName: function(entityName) {\n    return entityName;\n  },\n\n  locals: function(options) {\n    var name = options.project.pkg.name;\n\n    return {\n      namespace:     stringUtils.classify(name),\n      modulePrefix:  stringUtils.dasherize(name)\n    }\n  },\n\n  addPluginToProject: function(name) {\n    var ui = this.ui;\n\n    return runCommand('cordova plugin add ' + name, null, {\n      cwd: path.join(this.project.root, 'cordova')\n    })().then(function() {\n      if (ui) {\n        ui.writeLine('  ' + chalk.green('install plugin') + ' ' + name);\n      }\n    });\n  },\n\n  afterInstall: function() {\n    return Promise.all([\n      this.addPackageToProject('broccoli-sass'),\n      this.addPackageToProject('liquid-fire'),\n      this.addPackageToProject('ember-gestures')\n    ]);\n  }\n};\n"
  },
  {
    "path": "bower.json",
    "content": "{\n  \"name\": \"ember-cli-cordova\",\n  \"dependencies\": {\n    \"ember\": \"~2.3.1\",\n    \"ember-cli-shims\": \"0.1.0\",\n    \"ember-cli-test-loader\": \"0.2.2\",\n    \"ember-qunit-notifications\": \"0.1.0\"\n  }\n}\n"
  },
  {
    "path": "docs/commands.md",
    "content": "##Overview\n\nAll commands follow the pattern `ember cordova:{command}`. You can use the `cdv` alias\ninsted of`cordova`, for example `ember cdv:{command}`.\n\n##Open\n\n####Description\n\nOpen the native platform project with the default or specified application\n\n####Available options\n+ platform (default:ios)\n+ application (default:system default application)\n\n####Examples\n+ `ember cordova:open`\n+ `ember cordova:open --platform=android --application=eclipse`\n\n\n##Archive\n\n####Description\n\nBuild project and create xcode archive. If the tag or commit options are present\nthey will be performed after archiving.\n\n####Available options\n+ environment (default:staging)\n+ tag (default:false)\n+ commit (default:false)\n\n####Examples\n+ `ember cordova:archive`\n+ `ember cordova:archive 0.0.2 --environment=staging --commit --tag `\n\n##Build\n\n####Description\n\nBuild the ember and cordova project together running in the simulator or on a device\n\n####Available options\n+ environment (default:development)\n+ platform (default:ios)\n\n####Examples\n+ `ember cordova:build`\n+ `ember cordova:build --environment=production --platform=ios`\n\n##Prepare\n\n####Description\n\nNeeded after cloning or copying a project.\n\n###Available options\n\n####Examples\n+ `ember cordova:prepare`\n\n##Cordova\n\n####Description\n\nPasses commands(plugin(s), platform(s), run, emulate) and arguments to the cordova command\n\n###Available options\n  + run\n  + emulate\n  + platform(s)\n  + plugin(s)\n\n####Examples\n+ `ember cordova platform`\n+ `ember cordova platforms`\n+ `ember cordova run`\n"
  },
  {
    "path": "docs/configuration.md",
    "content": "### Configuration\n\nAll configuration is currently optional. Configuration will be done in your\napp's `config/environment`. You need to set it up like this:\n\n```js\nENV.cordova = {\n  // Rebuild the cordova project on file changes. Blocks the server until it's\n  // finished.\n  //\n  // default: false\n  rebuildOnChange: true,\n\n  // Run the cordova emulate command after the build is finished\n  //\n  // default: false\n  emulate: true,\n\n  // Which emulated target to deploy to\n  //\n  // default: <system default>\n  emulateTarget: {\n    ios: \"iPad-2\",\n    android: \"android-20\"\n  },\n\n  // Which platform to build and/or emulate\n  //\n  // default: 'ios'\n  platform: 'ios',\n\n  // Which URL the ember server is running on. This is used when using\n  // live-reload that comes with the starter kit.\n  //\n  // default: 'the-device-ip:4200'\n  emberUrl: 'http://10.0.1.12:4200',\n\n  // Whether or not to use liveReload on the device simulator. Requires a few\n  // plugins to be installed that come with the starter-kit. It will cause your\n  // app to not boot up in the browser\n  //\n  // default: false and iOS\n  liveReload: {\n    enabled: false,\n    platform: 'ios'\n  }\n};\n```\n"
  },
  {
    "path": "docs/events.md",
    "content": "# Events\n\n## Description\n\nember-cli-cordova creates a service at `services/cordova.js`, which listens for\nevents defined and emitted by Cordova (e.g. `deviceready`, `pause`, `resume`).\n\n\n## Usage\n\n**Simple Usage:**\n\nMany events require only simple callbacks, e.g. pausing / resuming listener\nfunctions, logging the event, etc.\n\nIn these cases, extend your object/class with the provided mixin, which will\nlook for an `onCordova` object and run the provided functions when an event\nmatching the key is emitted. For example:\n\n```javascript\nimport CordovaEventsMixin from 'ember-cli-cordova/mixins/cordova-events';\n\nexport default MyEmberObject.extend(\n  CordovaEventsMixin, {\n\n  onCordova: {\n    pause: ['pauseListening', 'disconnectPeripheral'],\n    resume: 'resumeListening',\n    volumeup: function() { console.log('a little bit louder now'); }\n  }\n});\n```\n\n(Yes, `onCordova` supports arrays of named functions, single named functions,\nand anonymous functions!)\n\n**Advanced Usage:**\n\nIf you have more advanced needs, e.g. turning on/off an event subscription when\nan `Ember.Route` is activated/deactivated, or just prefer a more manual\napproach, you can inject the provided service and tinker away:\n\n```javascript\nexport default MyRoute.extend({\n  cordova: Ember.inject.service(),\n\n  activate: function() {\n    // use named function to unsubscribe later\n    this.get('cordova').on('pause', this, '_resumeListening');\n  },\n\n  deactivate: function() {\n    this.get('cordova').off('pause', this, '_resumeListening');\n  },\n\n  _resumeListening: function() {\n    console.log('do your thing');\n  }\n});\n```\n"
  },
  {
    "path": "docs/faq.md",
    "content": "# FAQ\n\n#### I am getting `Current working directory is not a Cordova-based project.` when I run a cordova command\n\nIf you are running a cli command, make sure the dist directory exists. You can\nrun `ember build` to create it if it doesnt. You can also try to run `ember\ncordova:prepare`\n\n#### When running `ember cordova:archive` command I get an Xcode build error saying the scheme doesnt exist\n\nError example:\n\n```\nld[10658:1007] WARNING: Timed out waiting for <IDEWorkspace,\n0x7fc00d207d40>/\"runContextManager.runContexts\" (10.000125 seconds elapsed)\nxcodebuild: error: The project 'MyApp' does not contain a scheme named 'MyApp'.\n```\n\nThis is caused by not having opened the project in Xcode before. It\nautomatically generates some info it needs to archive the project. To fix this,\nrun `ember cordova:open` and let it open in Xcode. After you've done this once you\ncan just run `ember cordova:archive` command again and it shouldn't give you any more\ntrouble.\n\n"
  },
  {
    "path": "docs/getting-started.md",
    "content": "# Getting Started\n\nThis guide will walk you through setting up your first app with\nember-cli-cordova.\n\n## Prerequisites\n\n- [ember-cli](http://www.ember-cli.com)\n- [cordova](https://www.npmjs.org/package/cordova)\n\nEmber-cli-cordova requires ember-cli and cordova. You may install them as follows:\n\n```\nnpm install -g ember-cli\nnpm install -g cordova\n```\n\n## Setting Up The App\n\nFirst, let's set up your ember-cli project:\n\n```sh\nember new hello\n```\n\nAfter that's set up, we need to add the ember-cli-cordova addon to the application. Go in the freshly generated `hello` folder, then install the addon.\n\n```sh\nember install ember-cli-cordova\n```\n\nEmber cli-cordova requires cordova. If you don't have cordova, use this line to install it.\n\n```sh\nnpm install -g cordova\n```\n\nTo intialize the cordova project we use a generator provided by\nember-cli-cordova. You pass in the com domain identifier that you want to use\nwith your app. It can be anything you like as long as it's unique. This matters\nif you plan on releasing it to the app stores. It takes an optional `platform`\nargument that defaults to `ios`. If you want to generate an android project you\nwould pass in `--platform=android` at the end or set your default platform in [cordova configuration](https://github.com/poetic/ember-cli-cordova/blob/master/docs/configuration.md).\n\n```sh\nember generate cordova-init com.poeticsystems.hello\n```\n\nThis will prompt you to overwrite some default files. You should overwrite them\nas they provide some required settings and helpful additions.\n\nThis will also create the cordova project for you in the `cordova` directory. If\nyou ever need raw access to the cordova project you can `cd` into this directory\nto run the command or modify files.\n\nAfter that, the project is ready to go. There are some configuration options in\nyour environment config that you can set to enable / disable some features. See\nthe [configuration](https://github.com/poetic/ember-cli-cordova/blob/master/docs/configuration.md) section for information on that.\n\n### Optional Starter Kit\n\nThere's also a starter kit generator. This includes lots of goodies that we use\nat our company to develop our cordova apps. things like\n[broccoli-sass](https://github.com/joliss/broccoli-sass) for sass support and\n[liquid-fire](https://github.com/ef4/liquid-fire) for animations. It also\nincludes a default application adapter, modal component, style resets and extra\nconfiguration.\n\nTo run this, simple run\n\n```sh\nember generate cordova-starter-kit\n```\n\n## Developing The App\n\nOnce your project is set up, you're ready to start developing. We've tried to\nkeep the experience as similar to ember-cli as possible. You just need to move\nyour `locationType` setting in `config/environment.js` to `defaultLocationType`\nso that it'd be used when not building for cordova (cordova needs `hash` as\n`locationType`).\n\nThen you can simply run the `serve` command and begin\n\n```sh\nember serve\n```\n\nThis will run the ember server and behave no different than in vanilla\nember-cli. This is the primary place you will be working as it provides the\nquickest feedback loop, debugging tools and best experience.\n\nThe one drawback to this is that any cordova plugins you use will not work in\nthe browser. This means that when you want to test the functionality of\na plugin, you will need to load the app up on a simulator or device.\n\nWhen you need to serve or build files for a browser environment (not for cordova)\nbe sure to override the `EMBER_CLI_CORDOVA` environment variable to set it to a\nfalsy value (`0`, `no`, `off` or `false`). It'll allow you to use `locationType`\nas specified in `defaultLocationType` and will not inject the `cordova.js`\nscript tag.\n\n```sh\nEMBER_CLI_CORDOVA=0 ember serve\n```\n\n### Running The App On A Simulator Or Device\n\nWhen you need to run on a device or simulator, we have some options to automate\nthis. By default, all features that affect the cordova build are disabled. You\nwill need to enable the ones you want in the `config/environment.js`.\n\n#### Normal Cordova Build\n\nTo run a simple cordova build with ember linked up, run\n\n```\nember cordova:build\n```\n\nThis will build your ember project, link everything up to cordova and run\na cordova build. If you choose this route, no changes will be reflected in the\nrunning app until you run it again. To simplify, after every change you will\nneed to run this command. Sometimes that's what you want, but we have an option\nto automate this.\n\nIn your `config/environment` you can set `cordova.rebuildOnChange` to true. This\nwill hook into the ember server and automate this build after every change. Then\nwhen you run the app again, you will be able to see the changes.\n\nWhile this is convenient at times(mainly plugin development) it's still not as\nquick as we want it to be. We want Livereload on the device!\n\n#### Livereload\n\nWhen enabled, this feature will allow you to use ember-cli's livereload when the\napp is running on you device or simulator. This allows you get instant feedback\non a real device which allows you to get the full experience of using the app\nand plugins with an instant feedback loop. It is disabled in production...[for\nnow](https://github.com/poetic/ember-cli-cordova/pull/56).\n\nLivereload is currently disabled by default and will need to be turned on in\nyour `config/environment`. To enable it, set `cordova.liveReload.enabled` to\ntrue, and set `cordova.liveReload.platform` to the platform you will be running\nthe app on.\n\n**A few things to be aware of**\n\n- You will need to rebuild with 'ember cordova:build' when you make changes to the\n  environment config.\n- When you add/remove/update plugins or native code you will also need to run\n  the `ember cordova:build`.\n- You will need to set the `emberUrl` in the config if you are running the app\n  on a device that is not on the same computer or if your ember server is on\n  a different port. It defaults to `http://localhost:4200`. The reason for this\n  is that when the app starts up, it redirects to the url your ember server is\n  running on so it must be set correctly.\n- Livereload is a fairly new feature in ember-cli-cordova and we are really\n  excited about it. If you have any trouble with it please submit an issue or PR\n  so that we can resolve it.\n"
  },
  {
    "path": "docs/nav-bar.md",
    "content": "# Nav Bar\n\n## Description\n\nThe nav-bar component, partial, and mixins provide an easy to use way of having\na global nav bar that gets updated between routes automatically by defining\noptions on the route.\n\nThe component itself is very barebones but there is also a partial you can\ninclude within it along with a few mixins to get a full featured nav bar without\nmuch work.\n\n# Usage\n\nAdd this in your application template\n\n```hbs\n{{#cdv-nav-bar}}\n  {{partial 'cdv-generic-nav-bar'}}\n{{/cdv-nav-bar }}\n```\n\nIn your application controller, mixin the controller NavBarMixin. If you don't\ndo this, the actions within the nav-bar won't work. This is where all state for\nthe nav bar lives.\n\n```js\nimport NavBarMixin from 'ember-cli-cordova/mixins/controllers/nav-bar';\n\nexport default Ember.Controller.extend(NavBarMixin);\n```\n\nThen in any route you can mixin the route NavBarMixin and set options for the\nnav bar. The options will be reset on each transition. This is implemented using\nember's\n[willTransition](http://emberjs.com/api/classes/Ember.Route.html#event_willTransition) in the route. All options are optional.\n\n```js\nimport NavBarMixin from 'ember-cli-cordova/mixins/routes/nav-bar';\n\nexport default Ember.Route.extend(NavBarMixin, {\n  nav: {\n    // Default: application\n    // If the cdv-nav-bar is included in something other than the application\n    // template this needs to be set to that\n    controller: 'application',\n\n\n    // The text or icon option for title, leftButton, or rightButton can be\n    // a string or function. If it's a function // it will be called in the\n    // context of the afterModel hook and have the // model passed in as an\n    // argument\n\n    title: {\n      text: 'Title'\n    },\n\n    leftButton: {\n      // Text to show\n      text: function(model) {\n        return model.get('title');\n      },\n\n      // Class of an icon to display\n      icon: 'save',\n\n      // Action to trigger when it is clicked. It will trigger in the context of\n      // the route so you have access to the correct `this`.\n      action: function() {\n        // ...\n      }\n    },\n\n    // Same options as leftButton\n    rightButton: {\n      // ...\n    },\n  }\n});\n```\n\n\n\n"
  },
  {
    "path": "ember-cli-build.js",
    "content": "/*jshint node:true*/\n/* global require, module */\nvar EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n  var app = new EmberAddon(defaults, {\n    // Add options here\n  });\n\n  /*\n    This build file specifies the options for the dummy test app of this\n    addon, located in `/tests/dummy`\n    This build file does *not* influence how the addon or the app using it\n    behave. You most likely want to be modifying `./index.js` or app's build file\n  */\n\n  return app.toTree();\n};\n"
  },
  {
    "path": "index.js",
    "content": "'use strict';\n\nvar path = require('path');\nvar fs = require('fs');\nvar commands = require('./lib/commands');\nvar postBuild = require('./lib/tasks/post-build');\nvar defaults = require('lodash').defaults;\nvar chalk = require('chalk');\nvar mergeTrees = require('broccoli-merge-trees');\nvar Funnel = require('broccoli-funnel');\n\nmodule.exports = {\n  name: 'ember-cli-cordova',\n\n  _isTargetCordova: function () {\n    return !process.env.EMBER_CLI_CORDOVA ||\n      ['0', 'off', 'false', 'no'].indexOf(process.env.EMBER_CLI_CORDOVA.toLowerCase()) === -1;\n  },\n\n  config: function (env, config) {\n    var conf = {isCordovaBuild: this._isTargetCordova()};\n    if (conf.isCordovaBuild && env !== 'test') {\n      if (config.locationType && config.locationType !== 'hash') {\n        throw new Error('ember-cli-cordova: You must specify the locationType as \\'hash\\' in your environment.js or rename it to defaultLocationType.');\n      }\n      conf.locationType = 'hash';\n    }\n    else if (!conf.locationType) {\n      conf.locationType = config.defaultLocationType || 'auto';\n    }\n    conf.cordova = defaults(config.cordova || {}, {\n      liveReload: {\n        enabled:  false,\n        platform: 'ios'\n      }\n    });\n    return conf;\n  },\n\n  contentFor: function (type) {\n    if (this._isTargetCordova() && type === 'body') {\n      return '<script src=\"inject-cordova.js\"></script>';\n    }\n  },\n\n  includedCommands: function () {\n    return commands;\n  },\n\n  cdvConfig: function () {\n    return this.project.config(process.env.EMBER_ENV || 'development').cordova;\n  },\n\n  postBuild: function () {\n    if (this._isTargetCordova()) {\n      return postBuild(this.project, this.cdvConfig())();\n    }\n    else {\n      return function () {\n      };\n    }\n  },\n\n  treeForPublic: function (tree) {\n    var config = this.cdvConfig();\n\n    if (this._isTargetCordova() && config.liveReload.enabled) {\n      if (!config.liveReload.platform) {\n        throw new Error('ember-cli-cordova: You must specify a liveReload.platform in your environment.js');\n      }\n\n      var platformsPath = path.join(this.project.root, 'cordova', 'platforms');\n      var pluginsPath;\n\n      if (config.liveReload.platform === 'ios') {\n        pluginsPath = path.join(platformsPath, 'ios', 'www');\n      }\n      else if (config.liveReload.platform === 'browser') {\n        pluginsPath = path.join(platformsPath, 'browser', 'www');\n      }\n      else if (config.liveReload.platform === 'android') {\n        pluginsPath = path.join(platformsPath, 'android', 'assets', 'www');\n      }\n      else {\n        pluginsPath = path.join(platformsPath, config.liveReload.platform);\n      }\n\n      var files = ['cordova.js', 'cordova_plugins.js'];\n\n      files.forEach(function (file) {\n        var filePath = path.join(pluginsPath, file);\n        if (!fs.existsSync(filePath)) {\n          var err = new Error('ember-cli-cordova: ' + filePath + ' did not exist. It is required for Device LiveReload to work.');\n          err.stack = null;\n          throw err;\n        }\n      });\n\n      if (fs.existsSync(path.join(pluginsPath, 'plugins'))) {\n        files.push('plugins/**');\n      }\n\n      var pluginsTree = new Funnel(this.treeGenerator(pluginsPath), {\n        srcDir:  '/',\n        include: files,\n        destDir: '/'\n      });\n\n      console.log(chalk.green('ember-cli-cordova: Device LiveReload is enabled'));\n\n      return mergeTrees([tree, pluginsTree]);\n    }\n\n    return tree;\n  }\n};\n"
  },
  {
    "path": "lib/commands/archive.js",
    "content": "'use strict';\n\nvar path              = require('path');\nvar projectWithConfig = require('../models/project-with-config');\n\nmodule.exports = {\n  name: 'cordova:archive',\n  aliases: ['cdv:archive'],\n  description: 'Build project and create xcode archive. If the tag or commit options are present they will be performed after archiving.',\n  works: 'insideProject',\n\n  anonymousOptions: [\n    '<version>'\n  ],\n\n  availableOptions: [\n    { name: 'environment', type: String, default: 'staging' },\n    { name: 'tag', type: Boolean, default: false },\n    { name: 'commit', type: Boolean, default: false }\n  ],\n\n  run: function(options, rawArgs) {\n    projectWithConfig(this.project);\n    var version = rawArgs[0];\n\n    return require('../tasks/archive')(version, options, this.project)();\n  }\n};\n"
  },
  {
    "path": "lib/commands/build.js",
    "content": "'use strict';\n\nvar path            = require('path');\nvar chalk           = require('chalk');\nvar defaultPlatform = require('../utils/default-platform');\n\nmodule.exports = {\n  name: 'cordova:build',\n  aliases: ['cdv:build'],\n  description: 'Build the ember and cordova project together running in the simulator or on a device',\n  works: 'insideProject',\n\n  availableOptions: [\n    { name: 'environment', type: String, default: 'development' },\n    { name: 'platform', type: String }\n  ],\n\n  run: function(options) {\n    var platform = options.platform || defaultPlatform(this.project);\n    return require('../tasks/build')(options.environment, platform, this.project)();\n  }\n};\n"
  },
  {
    "path": "lib/commands/cordova.js",
    "content": "'use strict';\n\nvar path    = require('path');\nvar chalk   = require('chalk');\n\nmodule.exports = {\n  name: 'cordova',\n  aliases: ['cdv'],\n  description: 'Passes commands(plugin(s), platform(s), run, emulate) and arguments to the cordova command',\n  works: 'insideProject',\n  allowedCordovaCommands: [\n    'plugin', 'plugins', 'platform', 'platforms', 'run', 'emulate'\n  ],\n\n  validateAndRun: function(rawArgs) {\n    if(this.allowedCordovaCommands.indexOf(rawArgs[0]) > -1) {\n      return this.run({}, rawArgs);\n    }\n  },\n\n  run: function(options, rawArgs) {\n    return require('../tasks/cordova')(rawArgs, this.project)();\n  }\n};\n"
  },
  {
    "path": "lib/commands/index.js",
    "content": "module.exports = {\n  'cordova':         require('./cordova'),\n  'cordova:build':   require('./build'),\n  'cordova:open':    require('./open'),\n  'cordova:prepare': require('./prepare'),\n  'cordova:archive': require('./archive')\n};\n"
  },
  {
    "path": "lib/commands/open.js",
    "content": "'use strict';\n\nvar path            = require('path');\nvar defaultPlatform = require('../utils/default-platform');\n\nmodule.exports = {\n  name: 'cordova:open',\n  aliases: ['cdv:open'],\n  description: 'Open the native platform project with the default or specified application',\n  works: 'insideProject',\n\n  availableOptions: [\n    { name: 'platform', type: String },\n    { name: 'application', type: String}\n  ],\n\n  run: function(options) {\n    var platform = options.platform || defaultPlatform(this.project);\n    return require('../tasks/open')(this.project, platform, options.application)();\n  }\n};\n"
  },
  {
    "path": "lib/commands/prepare.js",
    "content": "var path       = require('path');\nvar linkEnv    = require('../tasks/link-environment');\nvar runCommand = require('../utils/run-command');\nvar Promise    = require('../ext/promise');\n\nmodule.exports = {\n  name: 'cordova:prepare',\n  aliases: ['cdv:prepare'],\n  description: 'Needed after cloning or copying a project.',\n  works: 'insideProject',\n\n  run: function() {\n    var installDeps = runCommand('npm install && bower install', 'Installing npm and bower dependencies', {\n      cwd: this.project.root\n    });\n\n    // Because of this being parallel. It breaks the logging and it looks like\n    //\n    //   Symlinking ember dir to cordova www...\n    //   Installing npm and bower dependencies...donedone\n    return Promise.all([linkEnv(this.project)(), installDeps()]);\n  }\n};\n"
  },
  {
    "path": "lib/ext/promise.js",
    "content": "// https://github.com/stefanpenner/ember-cli/blob/master/lib/ext/promise.js\n'use strict';\n\nvar RSVP    = require('rsvp');\nvar Promise = RSVP.Promise;\n\nmodule.exports = PromiseExt;\n\n// Utility functions on on the native CTOR need some massaging\nmodule.exports.hash = function() {\n  return this.resolve(RSVP.hash.apply(null, arguments));\n};\n\nmodule.exports.denodeify = function() {\n  var fn = RSVP.denodeify.apply(null, arguments);\n  var Constructor = this;\n\n  return function() {\n    return Constructor.resolve(fn.apply(null, arguments));\n  };\n};\n\nmodule.exports.filter = function() {\n  return this.resolve(RSVP.filter.apply(null, arguments));\n};\n\nmodule.exports.map = function() {\n  return this.resolve(RSVP.map.apply(null, arguments));\n};\n\nfunction PromiseExt() {\n  Promise.apply(this, arguments);\n}\n\nPromiseExt.prototype = Object.create(Promise.prototype);\nPromiseExt.prototype.constructor = PromiseExt;\nPromiseExt.__proto__ = Promise;\n\nPromiseExt.prototype.returns = function(value) {\n  return this.then(function() {\n    return value;\n  });\n};\n\nPromiseExt.prototype.invoke = function(method) {\n  var args = Array.prototype.slice(arguments, 1);\n\n  return this.then(function(value) {\n    return value[method].apply(value, args);\n  }, undefined, 'invoke: ' + method + ' with: ' + args);\n};\n\nPromiseExt.prototype.map = function(mapFn) {\n  var Constructor = this.constructor;\n\n  return this.then(function(values) {\n    return Constructor.map(values, mapFn);\n  });\n};\n\nPromiseExt.prototype.filter = function(mapFn) {\n  var Constructor = this.constructor;\n\n  return this.then(function(values) {\n    return Constructor.filter(values, mapFn);\n  });\n};\n"
  },
  {
    "path": "lib/models/project-with-config.js",
    "content": "'use strict';\n\nvar stringUtils = require('../utils/string');\n\nvar getComId = function(project) {\n\n  var fs   = require('fs');\n  var path = require('path');\n\n  var configPath = path.join(project.root, 'cordova', 'config.xml');\n  var configFile = fs.readFileSync(configPath, { encoding: 'utf-8'});\n\n  var idRegex = /id=\\\"([\\w\\-\\.]+)\\\"/;\n  var matches = configFile.match(idRegex);\n\n  if(matches.length) {\n    return matches[1];\n  }\n\n  throw new Error('Unable to find an id within your cordova/config.xml');\n}\n\nmodule.exports = function(project, id) {\n  project.cordovaConfig = {\n    name:  stringUtils.classify(project.name()),\n    id:    id || getComId(project)\n  };\n\n  return project;\n};\n"
  },
  {
    "path": "lib/tasks/add-platforms.js",
    "content": "'use strict';\n\nvar runCommand = require('../utils/run-command');\nvar path       = require('path');\n\nmodule.exports = function(project, options) {\n  var command = 'cordova platforms add ' + options.platform;\n\n  return runCommand(command, 'Adding ' + options.platform + ' platform to cordova', {\n    cwd: path.join(project.root, 'cordova')\n  });\n};\n"
  },
  {
    "path": "lib/tasks/archive.js",
    "content": "'use strict';\n\nvar path       = require('path');\nvar runCommand = require('../utils/run-command');\nvar Promise    = require('../ext/promise');\nvar defaultPlatform = require('../utils/default-platform');\n\nmodule.exports = function(version, options, project, platform) {\n  var config    = project.cordovaConfig;\n  var updateXml = function() { return Promise.resolve(); };\n  var archiveProject = function() { return Promise.resolve(); };\n\n  platform  = platform || 'ios';\n\n  if (version) {\n    updateXml = require('./update-config-xml-version')(version, project);\n  }\n\n  var build   = require('./build')(options.environment, platform, project);\n\n  if(platform === 'ios') {\n    var iosPath        = path.join(project.root, 'cordova', 'platforms/ios');\n    var archiveCommand = 'xcodebuild -scheme ' + config.name + ' archive';\n    var archiveMessage = 'Archiving project with xcodebuild';\n    archiveProject = runCommand(archiveCommand, archiveMessage, {\n      cwd: iosPath\n    });\n  }\n\n  if(platform === 'android' && version) {\n    var __updateXml = updateXml;\n\n    updateXml = function () {\n      var androidVersionCode = require('./update-config-xml-android-version-code')(project);\n      return __updateXml().then(androidVersionCode);\n    }\n  }\n\n  var commitCommand = 'git add . && git commit -m \"archive version: '\n                      + version + '\"';\n  var commitProject = runCommand(commitCommand, 'Commiting changes', {\n    cwd: project.root\n  });\n\n  var tagCommand = 'git tag -a -m \"' + 'Version ' + version + '\" ' + version;\n  var tagProject = runCommand(tagCommand, 'Tagging with version ' + version, {\n    cwd: project.root\n  });\n\n  return function() {\n    var promises = updateXml().then(build).then(archiveProject);\n\n    if (options.commit && options.tag) {\n      promises.then(commitProject).then(tagProject);\n    } else {\n      if (options.commit) {\n        promises.then(commitProject)\n      } else if (options.tag) {\n        promises.then(tagProject);\n      }\n    }\n\n    return promises;\n  }\n};\n"
  },
  {
    "path": "lib/tasks/build.js",
    "content": "'use strict';\n\nvar runCommand = require('../utils/run-command');\nvar path       = require('path');\nvar linkEnv    = require('../tasks/link-environment');\n\nmodule.exports = function(env, platform, project) {\n  var emberCommand = 'ember build --environment ' + env;\n\n  var emberMsg   = 'Building ember project for environment ' + env;\n  var emberBuild = runCommand(emberCommand, emberMsg, {\n    cwd: project.root\n  });\n\n  var cdvCommand = 'cordova build ' + platform;\n\n  if (env !== 'development') {\n    cdvCommand += ' --release'\n  }\n\n  var cdvMsg   = 'Building cordova project for platform ' + platform;\n  var cdvBuild = runCommand(cdvCommand, cdvMsg, {\n    cwd: path.join(project.root, 'cordova')\n  });\n\n  return function(){\n    return linkEnv(project)().then(emberBuild).then(cdvBuild);\n  };\n};\n"
  },
  {
    "path": "lib/tasks/cordova.js",
    "content": "'use strict';\n\nvar path       = require('path');\nvar runCommand = require('../utils/run-command');\n\nmodule.exports = function(rawArgs, project) {\n\n  var joinedArgs = rawArgs.join(' ');\n  var cdvCommand = 'cordova ' + joinedArgs;\n\n  var msg = \"Running 'cordova \" + joinedArgs + \"'\";\n\n  return function(){\n    return runCommand(cdvCommand, msg, {\n      cwd: path.join(project.root, 'cordova')\n    })();\n  };\n};\n"
  },
  {
    "path": "lib/tasks/create-cordova-project.js",
    "content": "'use strict';\n\nvar runCommand = require('../utils/run-command');\nvar path       = require('path');\n\nmodule.exports = function(project) {\n  var config  = project.cordovaConfig;\n  var command = 'cordova create cordova ' + config.id + ' ' + config.name;\n\n  return runCommand(command, 'Creating Cordova project', {\n    cwd: project.root\n  });\n};\n"
  },
  {
    "path": "lib/tasks/link-environment.js",
    "content": "'use strict';\n\nvar Promise    = require('../ext/promise');\nvar fs         = require('fs-extra');\nvar symlink    = Promise.denodeify(fs.symlink);\nvar remove     = Promise.denodeify(fs.remove);\nvar path       = require('path');\nvar chalk      = require('chalk');\nvar verifyDist = require('./verify-dist');\n\nmodule.exports = function(project){\n  if(!project) {\n    throw new Error('A project must be passed into this function');\n  }\n\n  var cordovaPath = path.join(project.root, 'cordova');\n  var wwwPath     = path.join(cordovaPath, 'www');\n\n  return function() {\n    // allows us to do a relative symlink\n    process.chdir(cordovaPath);\n\n    return remove(wwwPath)\n            .then(symlink.bind(this, '../dist', 'www', 'dir'))\n            .then(verifyDist(project));\n  };\n};\n\n"
  },
  {
    "path": "lib/tasks/modify-xml.js",
    "content": "'use strict';\n\nvar fs      = require('fs');\nvar chalk   = require('chalk');\nvar path    = require('path');\nvar ui      = require('../ui');\nvar Promise = require('../ext/promise');\n\n// Used as the context of this for the replaceFn so it can be used\nvar replaceObject = {\n  xmlReplace: function(regex, value, xml) {\n    return xml.replace(regex, '$1' + value + '$2');\n  }\n};\n\nmodule.exports = function(message, root, replaceFn) {\n  return function modifyXml() {\n    return new Promise(function(resolve, reject){\n      try {\n        var configPath = path.join(root, 'config.xml');\n\n        ui.start(chalk.green(message));\n\n        var xml = fs.readFileSync(configPath, { encoding: 'utf8' });\n\n        xml = replaceFn.call(replaceObject, xml);\n\n        fs.writeFileSync(configPath, xml);\n        resolve();\n\n      } catch(e) {\n        reject(e);\n      }\n    });\n  };\n};\n"
  },
  {
    "path": "lib/tasks/open.js",
    "content": "'use strict';\n\nvar Promise        = require('../ext/promise');\nvar path           = require('path');\nvar runCommand     = require('../utils/run-command');\nvar getOpenCommand = require('../utils/open');\n\nmodule.exports = function(project, platform, application) {\n  var projectPath, command;\n  if (platform === 'ios') {\n    projectPath = path.join(project.root, 'cordova', 'platforms/ios/*.xcodeproj');\n  } else if (platform === 'android') {\n    projectPath = path.join(project.root, 'cordova', 'platforms/android/.project');\n  } else {\n    return Promise.reject(new Error('The ' + platform + ' platform is not supported. Please use \"ios\" or \"android\"'));\n  }\n\n  var command = getOpenCommand(projectPath, application);\n\n  return runCommand(command, 'Opening ' + platform + ' project with the default application');\n};\n"
  },
  {
    "path": "lib/tasks/post-build.js",
    "content": "'use strict';\n\nvar runCommand      = require('../utils/run-command');\nvar defaultPlatform = require('../utils/default-platform');\nvar path            = require('path');\nvar chalk           = require('chalk');\nvar ui              = require('../ui');\nvar Promise         = require('../ext/promise');\n\nfunction createCommand(project, options) {\n  var platform = options.platform || defaultPlatform(project);\n  var command  = 'cordova build ' + platform;\n\n  if (options.emulate) {\n    command += ' && cordova emulate ' + platform;\n\n    if (options.emulateTarget) {\n      if (options.emulateTarget[platform]) {\n        command += ' --target=\"' + options.emulateTarget[platform] + '\"';\n      }\n    }\n  }\n\n  return runCommand(command, null, {\n    cwd: path.join(project.root, 'cordova')\n  });\n}\n\nmodule.exports = function(project, options) {\n  if (!options.rebuildOnChange) {\n    return function() {};\n  }\n\n  return function() {\n    var rebuild = createCommand(project, options)();\n\n    rebuild.then(function() {\n      ui.write(chalk.green('Cordova build successful.\\n'));\n    });\n\n    return Promise.resolve();\n  }\n};\n"
  },
  {
    "path": "lib/tasks/update-config-xml-android-version-code.js",
    "content": "'use strict';\n\nvar fs      = require('fs');\nvar path    = require('path');\nvar Promise = require('../ext/promise');\n\nvar versionCodeRegex = /(android-versionCode=\\\")[\\d.]+(\\\")/;\nvar versionCodeMatch = /android-versionCode=\\\"([\\d.])+\\\"/;\n\nmodule.exports = function(project) {\n  return new Promise(function(resolve, reject){\n    try {\n      var cordovaPath = path.join(project.root, 'cordova');\n      var configPath = path.join(cordovaPath, 'config.xml');\n      var xml = fs.readFileSync(configPath, { encoding: 'utf8' });\n\n      var match = xml.match(versionCodeMatch);\n      if(match) {\n        var versionCode = (parseInt(match[1], 10)) + 1;\n        var message     = 'Update config.xml with android-versionCode ' + versionCode;\n\n        return require('./modify-xml')(message, cordovaPath, function(xml) {\n          return this.xmlReplace(versionCodeRegex, versionCode, xml);\n        })().then(resolve, reject);\n      } else {\n        reject();\n      }\n    } catch (e) {\n      reject(e);\n    }\n  });\n};\n"
  },
  {
    "path": "lib/tasks/update-config-xml-version.js",
    "content": "'use strict';\n\nvar path = require('path');\n\nvar versionRegex = /(version=\\\")[\\d.]+(\\\")/;\n\nmodule.exports = function(version, project) {\n  var message     = 'Update config.xml with version ' + version;\n  var cordovaPath = path.join(project.root, 'cordova');\n\n  return require('./modify-xml')(message, cordovaPath, function(xml) {\n    return this.xmlReplace(versionRegex, version, xml);\n  });\n\n};\n"
  },
  {
    "path": "lib/tasks/update-config-xml.js",
    "content": "'use strict';\n\nvar path    = require('path');\n\n// Match the outer tags so we can match and reinsert them with a String#replace\nvar idRegex        = /(id=\\\")[\\w\\.]+(\\\")/;\nvar nameRegex      = /(<name>)\\w+(<\\/name>)/;\nvar endWidgetRegex = /(.*)(<\\/widget>)/;\n\nvar preferences = [\n  // haha, 4 spaces at the beginning\n  '    <preference name=\"DisallowOverscroll\" value=\"true\" />'\n];\n\nmodule.exports = function(project) {\n  var config = project.cordovaConfig;\n  var message = 'Update config.xml with your project settings';\n  var cordovaPath = path.join(project.root, 'cordova');\n\n  return require('./modify-xml')(message, cordovaPath, function(xml) {\n    xml = this.xmlReplace(idRegex, config.id, xml);\n    xml = this.xmlReplace(nameRegex, config.name, xml);\n\n    // add preference tag(s)\n    xml = this.xmlReplace(endWidgetRegex, preferences.join('\\n') + '\\n', xml);\n\n    return xml;\n  });\n};\n\n"
  },
  {
    "path": "lib/tasks/verify-dist.js",
    "content": "'use strict';\n\nvar runCommand = require('../utils/run-command');\nvar path       = require('path');\nvar fs         = require('fs');\nvar Promise    = require('../ext/promise');\n\nmodule.exports = function(project) {\n  return function() {\n    var distPath = path.join(project.root, 'dist');\n\n    if(fs.existsSync(distPath)) {\n      return Promise.resolve();\n    } else {\n      return runCommand('ember build', 'Building ember app since dist/ dir doesn\\'t exist yet', {\n        cwd: project.root\n      })();\n    }\n\n  }\n};\n"
  },
  {
    "path": "lib/ui/index.js",
    "content": "'use strict';\n\nvar PleasantProgress = require('pleasant-progress');\n\nmodule.exports = {\n  pleasantProgress: new PleasantProgress(),\n  start: function(msg) {\n    this.pleasantProgress.stop(true);\n    this.pleasantProgress.start(msg)\n  },\n  write: function(msg) {\n    this.pleasantProgress.stream.write(msg);\n  }\n};\n"
  },
  {
    "path": "lib/utils/default-platform.js",
    "content": "module.exports = function defaultPlatform(project) {\n  var config = project.config().cordova || {};\n  return config.platform || 'ios';\n};\n"
  },
  {
    "path": "lib/utils/open.js",
    "content": "'use strict';\n/*\n  This file needs to be removed when issue https://github.com/pwnall/node-open/issues/30\n  is resolved, original file can be seen here:\n  https://github.com/pwnall/node-open/blob/0c3ad272bfbc163cce8806e64630c623a9cfd8f4/lib/open.js\n*/\nmodule.exports = function(target, appName) {\n  var opener;\n\n  switch (process.platform) {\n    case 'darwin':\n      if (appName) {\n        opener = 'open -a \"' + escape(appName) + '\"';\n      } else {\n        opener = 'open';\n      }\n      break;\n    case 'win32':\n      // if the first parameter to start is quoted, it uses that as the title\n      // so we pass a blank title so we can quote the file we are opening\n      if (appName) {\n        opener = 'start \"\" \"' + escape(appName) + '\"';\n      } else {\n        opener = 'start';\n      }\n      break;\n    default:\n      if (appName) {\n        opener = escape(appName);\n      } else {\n        // use Portlands xdg-open everywhere else\n        opener = 'xdg-open';\n      }\n      break;\n  }\n\n  if (process.env.SUDO_USER) {\n    opener = 'sudo -u ' + process.env.SUDO_USER + ' ' + opener;\n  }\n\n  return opener + ' ' + target;\n}\n"
  },
  {
    "path": "lib/utils/run-command.js",
    "content": "'use strict';\n\nvar Promise  = require('../ext/promise');\nvar exec     = require('child_process').exec;\nvar chalk    = require('chalk');\nvar ui       = require('../ui');\nvar defaults = require('lodash').defaults;\n\nmodule.exports = function runCommand(command, startedMsg, options) {\n  if(options == null) {\n    options = {}\n  }\n\n  return function() {\n    if(startedMsg) {\n      ui.start(chalk.green(startedMsg));\n    }\n\n    options = defaults(options, {\n      maxBuffer: 5000 * 1024\n    });\n\n    return new Promise(function(resolve, reject) {\n      exec(command, options, function(err, stdout, stderr) {\n        ui.write('\\n');\n\n        if (stdout && stdout.length) {\n          ui.write(stdout);\n        }\n\n        if (stderr && stderr.length) {\n          ui.write(stderr);\n        }\n\n        if (err) {\n          return reject(commandError(command, err));\n        }\n\n        resolve(stdout);\n      });\n    });\n  };\n};\n\nfunction commandError(command, err) {\n  ui.write(chalk.red('\\nError thrown while running shell command: \"' + command + '\"\\n'));\n  if(err.stack) {\n    ui.write(err.stack);\n  } else {\n    ui.write(err);\n  }\n}\n\n"
  },
  {
    "path": "lib/utils/string.js",
    "content": "// https://github.com/emberjs/ember.js/blob/v1.5.0/packages/ember-runtime/lib/system/string.js\n'use strict';\n\nvar STRING_DECAMELIZE_REGEXP = (/([a-z\\d])([A-Z])/g);\nvar _s = require('underscore.string');\n\nmodule.exports = {\n  decamelize: function(str) {\n    return str ? str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase() : '';\n  },\n  dasherize: function(str) {\n    return str ? _s.dasherize(str).replace(/^\\-/, '') : '';\n  },\n  classify: function(str) {\n    // Have to humanize first so that 'MyApp' doesnt turn into 'Myapp'\n    return str ? _s.classify(_s.humanize(str)) : '';\n  }\n};\n"
  },
  {
    "path": "node-tests/fixtures/project/.ember-cdv",
    "content": "{\n  \"name\": \"TestApp\",\n  \"modulePrefix\": \"test-app\",\n  \"id\": \"com.poetic.test-app\"\n}\n"
  },
  {
    "path": "node-tests/fixtures/project/cordova/config.xml",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<widget id=\"com.example.app\" version=\"0.0.0\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\">\n    <name>ExampleApp</name>\n    <description>\n        A sample Apache Cordova application that responds to the deviceready event.\n    </description>\n    <author email=\"dev@cordova.apache.org\" href=\"http://cordova.io\">\n        Apache Cordova Team\n    </author>\n    <content src=\"index.html\" />\n    <access origin=\"*\" />\n</widget>\n"
  },
  {
    "path": "node-tests/helpers/_helper.js",
    "content": "global.expect = require('chai').expect;\nglobal.sinon  = require('sinon');\n\n// be sure to not have any env variable set\ndelete process.env.EMBER_CLI_CORDOVA;\n\n// Requiring a relative path will need to be relative to THIS file path\nglobal.proxyquire = require('proxyquire');\n\nglobal.Promise = require('../../lib/ext/promise');\nglobal.noop    = require('./noop');\n\nglobal.resolveFn = function() { return Promise.resolve() };\n\nglobal.newProject = function() {\n  return {\n    cordovaConfig: {\n      id: 'com.poetic.test-app',\n      name: 'TestApp'\n    },\n    root: 'project-root',\n    config: function (){\n      return {\n        cordova: {}\n      };\n    }\n  }\n};\n"
  },
  {
    "path": "node-tests/helpers/mocks.js",
    "content": "var noop = require('./noop');\n\nexports.ui = {\n  write: noop,\n  pleasantProgress: {\n    write: noop,\n    start: noop,\n    stop: noop,\n    clear: noop,\n  }\n}\n\nexports.Promise = {\n  denodeify: function(fn) { return fn; }\n}\n"
  },
  {
    "path": "node-tests/helpers/noop.js",
    "content": "module.exports = function() {};\n"
  },
  {
    "path": "node-tests/helpers/stub.js",
    "content": "'use strict';\n\nmodule.exports = function stub(obj, name, value) {\n  var original = obj[name];\n\n  obj[name] = function() {\n    obj[name].called++;\n    obj[name].calledWith.push(arguments);\n    return value;\n  };\n\n  obj[name].restore = function() {\n    obj[name] = original;\n  };\n\n  obj[name].called = 0;\n  obj[name].calledWith = [];\n\n  return obj[name];\n};\n"
  },
  {
    "path": "node-tests/unit/addon-test.js",
    "content": "var addon = require('../../index');\n\nfunction expectWithConfig(config, env, call) {\n  if (call) {\n    return expect(addon.config(env || 'development', config));\n  }\n  else {\n    return expect(addon.config.bind(addon, env || 'development', config));\n  }\n}\n\nvar errRegex = /ember-cli-cordova: You must specify the locationType as 'hash' in your environment\\.js/;\n\ndescribe('Addon', function () {\n  describe('config', function () {\n    var savedEnvVar;\n\n    beforeEach(function () {\n      savedEnvVar = process.env.EMBER_CLI_CORDOVA;\n    });\n\n    afterEach(function () {\n      process.env.EMBER_CLI_CORDOVA = savedEnvVar;\n    });\n\n    describe('validates location type', function () {\n      it('should throw Error when auto', function () {\n        expectWithConfig({\n          locationType: 'auto'\n        }).to.throw(Error, errRegex);\n      });\n\n      it('should not throw an error when hash', function () {\n        expectWithConfig({\n          locationType: 'hash'\n        }).to.not.throw(Error, errRegex);\n      });\n\n      it('should not throw an error with auto in test environment', function () {\n        expectWithConfig({\n          locationType: 'auto'\n        }, 'test').to.not.throw(Error, errRegex);\n      });\n\n      it('should not throw an error when the env var is set to 0', function () {\n        process.env.EMBER_CLI_CORDOVA = '0';\n        expectWithConfig({\n          locationType: 'auto'\n        }).to.not.throw(Error, errRegex);\n      });\n    });\n\n    describe('should replace the locationType', function () {\n      it('should use the defaultLocationType when building for test', function () {\n        expectWithConfig({\n          defaultLocationType: 'auto'\n        }, 'test', true).to.have.property('locationType', 'auto');\n      });\n\n      it('should use the defaultLocationType when the env var is set to 0', function () {\n        process.env.EMBER_CLI_CORDOVA = '0';\n        expectWithConfig({\n          defaultLocationType: 'auto'\n        }, null, true).to.have.property('locationType', 'auto');\n      });\n\n      it('should use hash as locationType', function () {\n        expectWithConfig({\n          defaultLocationType: 'auto'\n        }, null, true).to.have.property('locationType', 'hash');\n      });\n    });\n\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/models/project-with-config-test.js",
    "content": "var expect            = require('chai').expect;\nvar path              = require('path');\nvar projectWithConfig = require('../../../lib/models/project-with-config');\n\ndescribe('Model - ProjectWithConfig', function() {\n  var project;\n\n  beforeEach(function() {\n    project = {\n      root: path.join(__dirname, '..', '..', 'fixtures/project'),\n      name: function() {}\n    }\n  });\n\n  it('adds the ember cordova config instance', function() {\n    project = projectWithConfig(project);\n    expect(project.cordovaConfig.id).to.equal('com.example.app');\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/add-platforms-test.js",
    "content": "describe('Tasks - Add Platforms', function() {\n  it('creates the proper command', function() {\n    var addPlatforms = proxyquire('../../lib/tasks/add-platforms', {\n      '../utils/run-command': function(command) {\n        expect(command).to.contain('platforms add some-platform');\n      }\n    });\n\n    return addPlatforms({root: 'test'}, {platform: 'some-platform'});\n  });\n\n  it('executes command in cordova directory', function() {\n    var addPlatforms = proxyquire('../../lib/tasks/add-platforms', {\n      '../utils/run-command': function(_, __, options) {\n        expect(options.cwd).to.equal('test/cordova');\n      }\n    });\n\n    return addPlatforms({root: 'test'}, {platform: 'some-platform'});\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/archive-test.js",
    "content": "describe('Tasks - Archive', function() {\n  var project;\n  beforeEach(function() {\n    project = newProject();\n  });\n\n  describe('version parameter validation', function() {\n    it('calls config-xml-version with version', function() {\n      var archiveVersion = '0.1.0';\n\n      var archive = proxyquire('../../lib/tasks/archive', {\n        './update-config-xml-version': function(version, project) {\n          expect(version).to.eql(archiveVersion);\n          return resolveFn;\n        },\n        './build': resolveFn,\n        '../utils/run-command': resolveFn\n      });\n\n      return archive(archiveVersion, {}, project)();\n    });\n\n    it('doesn\\'t call config-xml-version with version when undefined', function() {\n      var archive = proxyquire('../../lib/tasks/archive', {\n        './update-config-xml-version': function(version, project) {\n          expect(false, 'should not have called here').to.be.ok;\n          return resolveFn;\n        },\n        './build': resolveFn,\n        '../utils/run-command': resolveFn\n      });\n\n      return archive(undefined, {}, project)();\n    });\n  });\n\n  it('prepares proper commands', function() {\n    var archiveVersion = \"0.1.0\";\n    var commandOffset = 0;\n\n    var commands = [\n      'xcodebuild -scheme ' + project.cordovaConfig.name + ' archive',\n      'git add . && git commit -m \"archive version: ' + archiveVersion + '\"',\n      'git tag -a -m \"Version ' + archiveVersion + '\" ' + archiveVersion\n    ];\n\n    var archive = proxyquire('../../lib/tasks/archive', {\n      '../utils/run-command': function(command, msg, options){\n        expect(command).to.eql(commands[commandOffset++]);\n        return resolveFn;\n      },\n      './update-config-xml-version': function(version, project) {\n        expect(version).to.eql(archiveVersion)\n        return resolveFn;\n      },\n      './build': resolveFn\n    });\n\n    return archive(archiveVersion, {}, project);\n  });\n\n  describe('executes proper commands', function() {\n    var archiveVersion;\n    beforeEach(function() {\n      archiveVersion = '0.1.0';\n    });\n\n    it('with no options', function() {\n      var commands = [\n        'update-config-xml-version',\n        'build',\n        'xcodebuild -scheme ' + project.cordovaConfig.name + ' archive'\n      ];\n\n      var options = {};\n\n      return expectCommandsToBeCalled(\n        archiveVersion, options, project, commands\n      );\n    });\n\n    it('with commit option', function() {\n      var commands = [\n        'update-config-xml-version',\n        'build',\n        'xcodebuild -scheme ' + project.cordovaConfig.name + ' archive',\n        'git add . && git commit -m \"archive version: ' + archiveVersion + '\"'\n      ];\n\n      var options = { commit: true };\n\n      return expectCommandsToBeCalled(\n        archiveVersion, options, project, commands\n      );\n    });\n\n    it('with tag option', function() {\n      var commands = [\n        'update-config-xml-version',\n        'build',\n        'xcodebuild -scheme ' + project.cordovaConfig.name + ' archive',\n        'git tag -a -m \"Version ' + archiveVersion + '\" ' + archiveVersion\n      ];\n\n      var options = { tag: true };\n\n      return expectCommandsToBeCalled(\n        archiveVersion, options, project, commands\n      );\n    });\n\n    // TODO: It says tag is never called. But I see no reason why it shouldn't\n    // be.  Will need to investigate and fix later\n    it.skip('with commit and tag option', function() {\n      var commands = [\n        'update-config-xml-version',\n        'build',\n        'xcodebuild -scheme ' + project.cordovaConfig.name + ' archive',\n        'git add . && git commit -m \"archive version: ' + archiveVersion + '\"',\n        'git tag -a -m \"Version ' + archiveVersion + '\" ' + archiveVersion\n      ];\n\n      var options = { commit: true, tag: true };\n\n      return expectCommandsToBeCalled(\n        archiveVersion, options, project, commands\n      );\n    });\n  });\n});\n\nfunction expectCommandsToBeCalled(archiveVersion, options, project, commands) {\n  var stubbedArchive = stubArchive();\n  var stubs          = stubbedArchive.stubs;\n  var archive        = stubbedArchive.archive;\n\n  return archive(archiveVersion, options, project)().then(function() {\n    commands.forEach(function(command, index) {\n      var stub = stubs[command];\n      if (stub) {\n        expect(stub.called, command + ' was never called').to.be.ok;\n      } else {\n        expect(false, command + ' was never even stubbed').to.be.ok;\n      }\n    });\n  });\n}\n\nfunction stubArchive() {\n  var RSVP = require('rsvp');\n  var stubs = {};\n  var archive = proxyquire('../../lib/tasks/archive', {\n    '../utils/run-command': function(command, msg, options){\n      return stubs[command] = sinon.stub().returns(RSVP.resolve(command));\n    },\n\n    './update-config-xml-version': function(version, project) {\n      return stubs['update-config-xml-version'] = sinon.stub().returns(\n        Promise.resolve('update-config-xml-version')\n      );\n    },\n\n    './build': function(env, platform, project) {\n      return stubs['build'] = sinon.stub().returns(Promise.resolve('build'));\n    }\n  });\n\n  return {\n    stubs: stubs,\n    archive: archive\n  };\n}\n"
  },
  {
    "path": "node-tests/unit/tasks/build-test.js",
    "content": "describe('Tasks - Build', function() {\n  var project, commandOffset;\n  beforeEach(function() {\n    project       = newProject();\n    commandOffset = 0;\n  });\n\n  describe('env argument', function() {\n    it('development - runs proper commands', function() {\n      var commands = [\n        'ember build --environment development',\n        'cordova build ios'\n      ];\n\n      var build = proxyquire('../../lib/tasks/build', {\n        '../utils/run-command': function(command) {\n          expect(command).to.eql(commands[commandOffset++]);\n          return resolveFn;\n        },\n        '../tasks/link-environment': function() {\n          return resolveFn;\n        }\n      });\n\n      return build('development', 'ios', project)();\n    });\n\n    it('production - runs proper commands', function() {\n      var commands = [\n        'ember build --environment production',\n        'cordova build ios --release'\n      ];\n\n      var build = proxyquire('../../lib/tasks/build', {\n        '../utils/run-command': function(command) {\n          expect(command).to.eql(commands[commandOffset++]);\n          return resolveFn;\n        },\n        '../tasks/link-environment': function() {\n          return resolveFn;\n        }\n      });\n\n      return build('production', 'ios', project)();\n    });\n  });\n\n  describe('platform argument', function() {\n    it('development - runs proper commands', function() {\n      var commands = [\n        'ember build --environment development',\n        'cordova build android'\n      ];\n\n      var build = proxyquire('../../lib/tasks/build', {\n        '../utils/run-command': function(command) {\n          expect(command).to.eql(commands[commandOffset++]);\n          return resolveFn;\n        },\n        '../tasks/link-environment': function() {\n          return resolveFn;\n        }\n      });\n\n      return build('development', 'android', project)();\n    });\n\n    it('production - runs proper commands', function() {\n      var commands = [\n        'ember build --environment production',\n        'cordova build android --release'\n      ];\n\n      var build = proxyquire('../../lib/tasks/build', {\n        '../utils/run-command': function(command) {\n          expect(command).to.eql(commands[commandOffset++]);\n          return resolveFn;\n        },\n        '../tasks/link-environment': function() {\n          return resolveFn;\n        }\n      });\n\n      return build('production', 'android', project)();\n    });\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/cordova-test.js",
    "content": "describe('Tasks - Cordova', function() {\n  it('creates a proper command', function() {\n    var cordova = proxyquire('../../lib/tasks/cordova', {\n      '../utils/run-command': function(command, msg, options){\n        expect(command).to.match(/cordova plugins add org\\.apache\\.test$/);\n        return noop;\n      },\n    });\n\n    return cordova(['plugins', 'add', 'org.apache.test'], { root: 'test' })();\n  });\n\n  it('executes in proper directory', function() {\n    var cordova = proxyquire('../../lib/tasks/cordova', {\n      '../utils/run-command': function(command, msg, options){\n        expect(options.cwd).to.match(/test\\/cordova$/);\n        return noop;\n      },\n    });\n\n    return cordova(['plugins', 'add', 'org.apache.test'], { root: 'test' })();\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/create-cordova-project-test.js",
    "content": "describe('Tasks - Create cordova project', function() {\n  var project;\n  beforeEach(function() {\n    project = newProject();\n  });\n\n  it('creates the proper command', function() {\n    var createProject = proxyquire('../../lib/tasks/create-cordova-project', {\n      '../utils/run-command': function(command) {\n        expect(command).to.eql('cordova create cordova com.poetic.test-app TestApp');\n        return resolveFn;\n      }\n    });\n\n    return createProject(project)();\n  });\n\n  it('should execute in proper folder', function() {\n    var createProject = proxyquire('../../lib/tasks/create-cordova-project', {\n      '../utils/run-command': function(_, _, options) {\n        expect(options.cwd).to.equal('project-root');\n        return resolveFn;\n      }\n    });\n\n    return createProject(project)();\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/link-environment-test.js",
    "content": "describe('Tasks - Link Environment', function() {\n  var project;\n  beforeEach(function() {\n    project = newProject();\n  });\n\n  before(function() {\n    process._chdir = process.chdir;\n    process.chdir = noop;\n  });\n\n  after(function() {\n    process.chdir = process._chdir;\n  });\n\n  it('removes the cordova/www dir', function() {\n    var createProject = proxyquire('../../lib/tasks/link-environment', {\n      './verify-dist': function() { return resolveFn; },\n      'fs-extra': {\n        remove: function(path, callback) {\n          expect(path).to.eql('project-root/cordova/www');\n          return callback(null, true);\n        },\n        symlink: function(from, to, type, _, callback) {\n          return callback(null, true);\n        }\n      }\n    });\n\n    return createProject(project)();\n  });\n\n  it('creates a relative dir symlink', function() {\n    var createProject = proxyquire('../../lib/tasks/link-environment', {\n      './verify-dist': function() { return resolveFn; },\n      'fs-extra': {\n        remove: function(path, callback) {\n          return callback(null, true);\n        },\n        symlink: function(from, to, type, _, callback) {\n          expect(from).to.eql('../dist');\n          expect(to).to.eql('www');\n          expect(type).to.eql('dir');\n          return callback(null, true);\n        }\n      }\n    });\n\n    return createProject(project)();\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/open-test.js",
    "content": "describe('Tasks - Open', function() {\n  var project;\n  beforeEach(function() {\n    project = newProject();\n  });\n\n  it('rejects when the platform isn\\'t supported', function() {\n    var open = proxyquire('../../lib/tasks/open', {});\n\n    return open(project, 'fake-platform').catch(function(err) {\n      expect(err.toString()).to.match(/platform is not supported/);\n    });\n  });\n\n  describe('runs correct command on each platform', function() {\n    var platform;\n    before(function() {\n      platform = process.platform;\n    });\n\n    after(function() {\n      process.platform = platform;\n    });\n\n    describe('darwin', function() {\n      beforeEach(function() {\n        process.platform = 'darwin';\n      });\n\n      it('ios', function() {\n        return assertOpenCommand(project, 'ios', 'open project-root/cordova/platforms/ios/*.xcodeproj');\n      });\n\n      it('android', function() {\n        return assertOpenCommand(project, 'android', 'open project-root/cordova/platforms/android/.project');\n      });\n    });\n\n    describe('win32', function() {\n      beforeEach(function() {\n        process.platform = 'win32';\n      });\n\n      it('ios', function() {\n        return assertOpenCommand(project, 'ios', 'start project-root/cordova/platforms/ios/*.xcodeproj');\n      });\n\n      it('android', function() {\n        return assertOpenCommand(project, 'android', 'start project-root/cordova/platforms/android/.project');\n      });\n    });\n\n    describe('other', function() {\n      beforeEach(function() {\n        process.platform = 'other';\n      });\n\n      it('ios', function() {\n        return assertOpenCommand(project, 'ios', 'xdg-open project-root/cordova/platforms/ios/*.xcodeproj');\n      });\n\n      it('android', function() {\n        return assertOpenCommand(project, 'android', 'xdg-open project-root/cordova/platforms/android/.project');\n      });\n    });\n  });\n});\n\nfunction assertOpenCommand(project, platform, assertion) {\n  var open = proxyquire('../../lib/tasks/open', {\n    '../utils/run-command': function(command) {\n      expect(command).to.eql(assertion);\n    }\n  });\n  return open(project, platform);\n}\n"
  },
  {
    "path": "node-tests/unit/tasks/post-build-test.js",
    "content": "var uiMock = { write: noop };\n\ndescribe('Tasks - Post Build', function() {\n  var project;\n  beforeEach(function() {\n    project = newProject();\n  });\n\n  var options;\n  describe('rebuildOnChange is false', function() {\n    beforeEach(function() {\n      options = { rebuildOnChange: false };\n    });\n\n    it('return noop', function() {\n      var postBuild = proxyquire('../../lib/tasks/post-build', {});\n\n      var res = postBuild({}, options);\n\n      expect(res.toString()).to.eql(noop.toString());\n    });\n  });\n\n  describe('rebuildOnChange is true', function() {\n    beforeEach(function() {\n      options = { rebuildOnChange: true };\n    });\n\n    it('returns resolving promise and executes correct build', function() {\n      var postBuild = proxyquire('../../lib/tasks/post-build', {\n        '../utils/run-command': function() {\n          return resolveFn;\n        },\n        '../ui': uiMock\n      });\n\n      return postBuild(project, options)().then(function() {\n        expect(true).to.be.ok;\n      });\n    });\n\n    describe('emulate is false', function() {\n      beforeEach(function() {\n        options.emulate = false;\n      });\n\n      it('runs correct command', function() {\n        var postBuild = proxyquire('../../lib/tasks/post-build', {\n          '../utils/run-command': function(command){\n            expect(command).to.eql('cordova build ios');\n            return resolveFn;\n          },\n          '../ui': uiMock\n        });\n\n        return postBuild(project, options)().then(function() {\n          expect(true).to.be.ok;\n        });\n      });\n    });\n\n    describe('emulate is true', function() {\n      beforeEach(function() {\n        options.emulate = true;\n      });\n\n      it('runs correct command', function() {\n        var postBuild = proxyquire('../../lib/tasks/post-build', {\n          '../utils/run-command': function(command){\n            expect(command).to.eql('cordova build ios && cordova emulate ios');\n            return resolveFn;\n          },\n          '../ui': uiMock\n        });\n\n        return postBuild(project, options)().then(function() {\n          expect(true).to.be.ok;\n        });\n      });\n    });\n\n    describe('platform is android and emulate is true', function() {\n      beforeEach(function() {\n        options.platform = 'android';\n        options.emulate = true;\n      });\n\n      it('runs correct command', function() {\n        var postBuild = proxyquire('../../lib/tasks/post-build', {\n          '../utils/run-command': function(command){\n            expect(command).to.eql('cordova build android && cordova emulate android');\n            return resolveFn;\n          },\n          '../ui': uiMock\n        });\n\n        return postBuild(project, options)().then(function() {\n          expect(true).to.be.ok;\n        });\n      });\n    });\n  });\n});\n\n\n"
  },
  {
    "path": "node-tests/unit/tasks/update-config-xml-test.js",
    "content": "var path = require('path');\nvar uiMock = { start: noop };\n\nvar project;\ndescribe('Tasks - Update config xml', function() {\n  beforeEach(function() {\n    project = {\n      cordovaConfig: {\n        id: 'com.poetic.test-app',\n        name: 'TestApp'\n      },\n      root: path.join(__dirname, '..', '..', 'fixtures/project')\n    }\n  });\n\n  it('updates id and name', function() {\n    return proxyUpdate(function(xml) {\n      expect(xml).to.match(/\\sid=\\\"com\\.poetic\\.test\\-app\"\\s/);\n      expect(xml).to.match(/<name>TestApp<\\/name>/);\n    });\n  });\n\n  it('adds DisallowOverscroll preference', function() {\n    return proxyUpdate(function(xml) {\n      expect(xml).to.match(/<preference name=\"DisallowOverscroll\" value=\"true\" \\/>/);\n    });\n  });\n});\n\nfunction proxyUpdate(callback) {\n  var update = proxyquire('../../lib/tasks/update-config-xml', {\n    './modify-xml': proxyquire('../../lib/tasks/modify-xml', {\n      'fs': {\n        writeFileSync: function(path, xml) {\n          callback(xml);\n        }\n      },\n      '../ui': uiMock\n    })\n  });\n\n  return update(project)();\n}\n"
  },
  {
    "path": "node-tests/unit/tasks/update-config-xml-version-test.js",
    "content": "var path = require('path');\n\ndescribe('Tasks - Update config xml version', function() {\n  var project;\n  beforeEach(function() {\n    project = {\n      root: path.join(__dirname, '..', '..', 'fixtures/project')\n    }\n  });\n\n  it('updates version and writes it', function() {\n    var update = proxyquire('../../lib/tasks/update-config-xml-version', {\n      './modify-xml': proxyquire('../../lib/tasks/modify-xml', {\n        'fs': {\n          writeFileSync: function(path, xml) {\n            expect(path).to.eql(project.root + '/cordova/config.xml');\n            expect(xml).to.match(/\\sversion=\\\"0.1.0\"\\s/);\n          }\n        }\n      })\n    });\n\n    return update('0.1.0', project)();\n  });\n});\n"
  },
  {
    "path": "node-tests/unit/tasks/verify-dist-test.js",
    "content": "describe('Tasks - Verify Dist', function() {\n  var project;\n  beforeEach(function() {\n    project = newProject();\n  });\n\n  it('resolves when path exists', function() {\n    var verifyDist = proxyquire('../../lib/tasks/verify-dist', {\n      'fs': {\n        existsSync: function() { return true; }\n      }\n    });\n\n    return verifyDist(project)().then(function() {\n      expect(true).to.be.ok;\n    });\n  });\n\n  it('runs ember build when it doesn\\'t exist', function() {\n    var verifyDist = proxyquire('../../lib/tasks/verify-dist', {\n      '../utils/run-command': function(command) {\n        expect(command).to.eql('ember build');\n      }\n    });\n\n    return verifyDist(project);\n  });\n});\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"ember-cli-cordova\",\n  \"version\": \"0.1.0-beta-2\",\n  \"description\": \"A tool for creating hybrid apps using a combination of ember-cli and cordova \",\n  \"homepage\": \"https://github.com/poetic/ember-cli-cordova\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/poetic/ember-cli-cordova.git\"\n  },\n  \"main\": \"index.js\",\n  \"directories\": {\n    \"doc\": \"docs\",\n    \"test\": \"tests\"\n  },\n  \"scripts\": {\n    \"node-test\": \"mocha --require node-tests/helpers/_helper.js --reporter spec node-tests/**/*-test.js node-tests/**/**/*-test.js\",\n    \"ember-test\": \"ember test\",\n    \"test\": \"npm run node-test && npm run ember-test\"\n  },\n  \"engines\": {\n    \"node\": \">= 0.10.0\"\n  },\n  \"author\": \"Jake Craige <jake@poeticsystems.com>\",\n  \"license\": \"MIT\",\n  \"ember-addon\": {\n    \"configPath\": \"tests/dummy/config\"\n  },\n  \"keywords\": [\n    \"ember-addon\"\n  ],\n  \"dependencies\": {\n    \"broccoli-funnel\": \"^0.2.3\",\n    \"broccoli-merge-trees\": \"^1.1.0\",\n    \"chalk\": \"^0.4.0\",\n    \"ember-cli-babel\": \"^5.1.5\",\n    \"findup-sync\": \"^0.1.3\",\n    \"fs-extra\": \"^0.26.5\",\n    \"lodash\": \"^4.5.1\",\n    \"pleasant-progress\": \"^1.0.1\",\n    \"recursive-readdir\": \"^1.1.1\",\n    \"rsvp\": \"^3.0.6\",\n    \"sinon\": \"^1.17.3\",\n    \"underscore.string\": \"^2.3.3\"\n  },\n  \"devDependencies\": {\n    \"broccoli-asset-rev\": \"^2.2.0\",\n    \"chai\": \"^1.9.1\",\n    \"ember-ajax\": \"0.7.1\",\n    \"ember-cli\": \"2.3.0\",\n    \"ember-cli-app-version\": \"^1.0.0\",\n    \"ember-cli-dependency-checker\": \"^1.2.0\",\n    \"ember-cli-htmlbars\": \"^1.0.1\",\n    \"ember-cli-htmlbars-inline-precompile\": \"^0.3.1\",\n    \"ember-cli-inject-live-reload\": \"^1.3.1\",\n    \"ember-cli-qunit\": \"^1.2.1\",\n    \"ember-cli-release\": \"0.2.8\",\n    \"ember-cli-sri\": \"^2.0.0\",\n    \"ember-cli-uglify\": \"^1.2.0\",\n    \"ember-disable-prototype-extensions\": \"^1.1.0\",\n    \"ember-disable-proxy-controllers\": \"^1.0.1\",\n    \"ember-export-application-global\": \"^1.0.4\",\n    \"ember-load-initializers\": \"^0.5.0\",\n    \"ember-resolver\": \"^2.0.3\",\n    \"ember-sinon\": \"0.5.0\",\n    \"ember-try\": \"^0.1.2\",\n    \"glob\": \"^4.5.3\",\n    \"loader.js\": \"^4.0.0\",\n    \"mocha\": \"^1.20.1\",\n    \"mocha-jshint\": \"0.0.7\",\n    \"proxyquire\": \"^1.0.1\",\n    \"qunit-bdd\": \"jakecraige/qunit-bdd.git#ember-addon\",\n    \"tmp-sync\": \"^1.0.1\"\n  }\n}\n"
  },
  {
    "path": "public/.gitkeep",
    "content": ""
  },
  {
    "path": "public/inject-cordova.js",
    "content": "// ember-cli-cordova\n(function() {\n  var platform = navigator.platform;\n  if (platform.match(/(ipad|iphone|ipod|android)/i)) {\n    var script = document.createElement('script');\n    script.setAttribute('src', 'cordova.js');\n    document.head.appendChild(script);\n  }\n})()\n"
  },
  {
    "path": "testem.json",
    "content": "{\n  \"framework\": \"qunit\",\n  \"test_page\": \"tests/index.html\",\n  \"launch_in_ci\": [\"PhantomJS\"],\n  \"launch_in_dev\": [\"PhantomJS\", \"Chrome\"]\n}\n"
  },
  {
    "path": "tests/.jshintrc",
    "content": "{\n  \"predef\": [\n    \"document\",\n    \"window\",\n    \"location\",\n    \"setTimeout\",\n    \"$\",\n    \"-Promise\",\n    \"QUnit\",\n    \"define\",\n    \"console\",\n    \"equal\",\n    \"notEqual\",\n    \"notStrictEqual\",\n    \"test\",\n    \"asyncTest\",\n    \"testBoth\",\n    \"testWithDefault\",\n    \"raises\",\n    \"throws\",\n    \"deepEqual\",\n    \"start\",\n    \"stop\",\n    \"ok\",\n    \"strictEqual\",\n    \"module\",\n    \"moduleFor\",\n    \"moduleForComponent\",\n    \"moduleForModel\",\n    \"process\",\n    \"expect\",\n    \"visit\",\n    \"exists\",\n    \"fillIn\",\n    \"click\",\n    \"keyEvent\",\n    \"triggerEvent\",\n    \"find\",\n    \"findWithAssert\",\n    \"wait\",\n    \"DS\",\n    \"keyEvent\",\n    \"isolatedContainer\",\n    \"startApp\",\n    \"andThen\",\n    \"currentURL\",\n    \"currentPath\",\n    \"currentRouteName\",\n    \"cordova\",\n    \"describe\",\n    \"before\",\n    \"after\",\n    \"it\",\n    \"lazy\",\n    \"helper\",\n    \"sinon\"\n  ],\n  \"node\": false,\n  \"browser\": false,\n  \"boss\": true,\n  \"curly\": false,\n  \"debug\": false,\n  \"devel\": false,\n  \"eqeqeq\": true,\n  \"evil\": true,\n  \"forin\": false,\n  \"immed\": false,\n  \"laxbreak\": false,\n  \"newcap\": true,\n  \"noarg\": true,\n  \"noempty\": false,\n  \"nonew\": false,\n  \"nomen\": false,\n  \"onevar\": false,\n  \"plusplus\": false,\n  \"regexp\": false,\n  \"undef\": true,\n  \"sub\": true,\n  \"strict\": false,\n  \"white\": false,\n  \"eqnull\": true,\n  \"esnext\": true\n}\n"
  },
  {
    "path": "tests/dummy/.jshintrc",
    "content": "{\n  \"predef\": {\n    \"document\": true,\n    \"window\": true,\n    \"-Promise\": true,\n    \"DummyENV\": true\n  },\n  \"browser\" : true,\n  \"boss\" : true,\n  \"curly\": true,\n  \"debug\": false,\n  \"devel\": true,\n  \"eqeqeq\": true,\n  \"evil\": true,\n  \"forin\": false,\n  \"immed\": false,\n  \"laxbreak\": false,\n  \"newcap\": true,\n  \"noarg\": true,\n  \"noempty\": false,\n  \"nonew\": false,\n  \"nomen\": false,\n  \"onevar\": false,\n  \"plusplus\": false,\n  \"regexp\": false,\n  \"undef\": true,\n  \"sub\": true,\n  \"strict\": false,\n  \"white\": false,\n  \"eqnull\": true,\n  \"esnext\": true,\n  \"unused\": true\n}\n"
  },
  {
    "path": "tests/dummy/app/app.js",
    "content": "import Ember from 'ember';\nimport Resolver from './resolver';\nimport loadInitializers from 'ember-load-initializers';\nimport config from './config/environment';\n\nlet App;\n\nEmber.MODEL_FACTORY_INJECTIONS = true;\n\nApp = Ember.Application.extend({\n  modulePrefix: config.modulePrefix,\n  podModulePrefix: config.podModulePrefix,\n  Resolver\n});\n\nloadInitializers(App, config.modulePrefix);\n\nexport default App;\n"
  },
  {
    "path": "tests/dummy/app/components/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/controllers/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/controllers/nav-bar.js",
    "content": "import Ember from 'ember';\nimport NavBarMixin from 'ember-cli-cordova/mixins/controllers/nav-bar';\n\nexport default Ember.Controller.extend(NavBarMixin);\n"
  },
  {
    "path": "tests/dummy/app/helpers/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <title>Dummy</title>\n    <meta name=\"description\" content=\"\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n    {{content-for 'head'}}\n\n    <link rel=\"stylesheet\" href=\"assets/vendor.css\">\n    <link rel=\"stylesheet\" href=\"assets/dummy.css\">\n\n    {{content-for 'head-footer'}}\n  </head>\n  <body>\n    {{content-for 'body'}}\n\n    <script src=\"assets/vendor.js\"></script>\n    <script src=\"assets/dummy.js\"></script>\n\n    {{content-for 'body-footer'}}\n  </body>\n</html>\n"
  },
  {
    "path": "tests/dummy/app/models/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/resolver.js",
    "content": "import Resolver from 'ember-resolver';\n\nexport default Resolver;\n"
  },
  {
    "path": "tests/dummy/app/router.js",
    "content": "import Ember from 'ember';\nimport config from './config/environment';\n\nvar Router = Ember.Router.extend({\n  location: config.locationType\n});\n\nRouter.map(function() {\n  this.resource('nav-bar', function() {\n    this.route('page-1');\n    this.route('options-from-model');\n    this.route('should-reset');\n  });\n});\n\nexport default Router;\n"
  },
  {
    "path": "tests/dummy/app/routes/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/routes/nav-bar/index.js",
    "content": "import Ember from 'ember';\nimport NavBarMixin from 'ember-cli-cordova/mixins/routes/nav-bar';\n\nexport default Ember.Route.extend(NavBarMixin, {\n  nav: {\n    controller: 'nav-bar',\n    title: {\n      text: 'Index'\n    },\n    leftButton: {\n      text: 'iLeft'\n    },\n    rightButton: {\n      text: 'iRight'\n    },\n  }\n});\n"
  },
  {
    "path": "tests/dummy/app/routes/nav-bar/options-from-model.js",
    "content": "import Ember from 'ember';\nimport NavBarMixin from 'ember-cli-cordova/mixins/routes/nav-bar';\n\nexport default Ember.Route.extend(NavBarMixin, {\n  nav: {\n    controller: 'nav-bar',\n    title: {\n      text: function(model) {\n        return model.get('title');\n      }\n    },\n\n    leftButton: {\n      text: function(model) {\n        return model.get('leftButton');\n      },\n      icon: function(model) {\n        return model.get('leftClass');\n      }\n    },\n\n    rightButton: {\n      text: function(model) {\n        return model.get('rightButton');\n      },\n      icon: function(model) {\n        return model.get('rightClass');\n      }\n    }\n  },\n\n  model: function() {\n    return Ember.Object.create({\n      title:        'modelOption',\n      leftButton:   'modelLeft',\n      leftClass:    'leftClass',\n      rightButton:  'modelRight',\n      rightClass:   'rightClass'\n    });\n  }\n});\n"
  },
  {
    "path": "tests/dummy/app/routes/nav-bar/page-1.js",
    "content": "import Ember from 'ember';\nimport NavBarMixin from 'ember-cli-cordova/mixins/routes/nav-bar';\n\nexport default Ember.Route.extend(NavBarMixin, {\n  nav: {\n    controller: 'nav-bar',\n    title: {\n      text: 'Page 1'\n    },\n    leftButton: {\n      text: 'pLeft'\n    },\n    rightButton: {\n      text: 'pRight'\n    },\n  }\n});\n"
  },
  {
    "path": "tests/dummy/app/styles/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/styles/app.css",
    "content": "html, body {\n  margin: 20px;\n}\n"
  },
  {
    "path": "tests/dummy/app/templates/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/templates/application.hbs",
    "content": "{{outlet}}\n"
  },
  {
    "path": "tests/dummy/app/templates/components/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/templates/nav-bar.hbs",
    "content": "{{#cdv-nav-bar}}\n  {{partial 'cdv-generic-nav-bar'}}\n{{/cdv-nav-bar }}\n\n{{outlet}}\n"
  },
  {
    "path": "tests/dummy/app/views/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/config/environment.js",
    "content": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n  var ENV = {\n    modulePrefix: 'dummy',\n    environment: environment,\n    baseURL: '/',\n    locationType: 'hash',\n    EmberENV: {\n      FEATURES: {\n        // Here you can enable experimental features on an ember canary build\n        // e.g. 'with-controller': true\n      }\n    },\n\n    APP: {\n      // Here you can pass flags/options to your application instance\n      // when it is created\n    }\n  };\n\n  if (environment === 'development') {\n    // ENV.APP.LOG_RESOLVER = true;\n    ENV.APP.LOG_ACTIVE_GENERATION = true;\n    // ENV.APP.LOG_TRANSITIONS = true;\n    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;\n    ENV.APP.LOG_VIEW_LOOKUPS = true;\n  }\n\n  if (environment === 'test') {\n    // Testem prefers this...\n    ENV.baseURL = '/';\n    ENV.locationType = 'auto';\n\n    // keep test console output quieter\n    ENV.APP.LOG_ACTIVE_GENERATION = false;\n    ENV.APP.LOG_VIEW_LOOKUPS = false;\n\n    ENV.APP.rootElement = '#ember-testing';\n  }\n\n  if (environment === 'production') {\n\n  }\n\n  return ENV;\n};\n"
  },
  {
    "path": "tests/dummy/public/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/public/crossdomain.xml",
    "content": "<?xml version=\"1.0\"?>\n<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">\n<cross-domain-policy>\n    <!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->\n\n    <!-- Most restrictive policy: -->\n    <site-control permitted-cross-domain-policies=\"none\"/>\n\n    <!-- Least restrictive policy: -->\n    <!--\n    <site-control permitted-cross-domain-policies=\"all\"/>\n    <allow-access-from domain=\"*\" to-ports=\"*\" secure=\"false\"/>\n    <allow-http-request-headers-from domain=\"*\" headers=\"*\" secure=\"false\"/>\n    -->\n</cross-domain-policy>\n"
  },
  {
    "path": "tests/dummy/public/robots.txt",
    "content": "# robotstxt.org/\n\nUser-agent: *\n"
  },
  {
    "path": "tests/helpers/describe-app.js",
    "content": "import Ember from 'ember';\nimport startApp from './start-app';\n\nexport default function(name, callback) {\n  return describe(name, function() {\n    before(function() {\n      this.app = startApp();\n    });\n\n    after(function() {\n      Ember.run(this.app, 'destroy');\n    });\n\n    lazy('store', function() {\n      return this.app.__container__.lookup('store:main');\n    });\n\n    helper('lookupController', function(name) {\n      return this.app.__container__.lookup('controller:' + name);\n    });\n\n    callback.call(this);\n  });\n}\n"
  },
  {
    "path": "tests/helpers/destroy-app.js",
    "content": "import Ember from 'ember';\n\nexport default function destroyApp(application) {\n  Ember.run(application, 'destroy');\n}\n"
  },
  {
    "path": "tests/helpers/module-for-acceptance.js",
    "content": "import { module } from 'qunit';\nimport startApp from '../helpers/start-app';\nimport destroyApp from '../helpers/destroy-app';\n\nexport default function(name, options = {}) {\n  module(name, {\n    beforeEach() {\n      this.application = startApp();\n\n      if (options.beforeEach) {\n        options.beforeEach.apply(this, arguments);\n      }\n    },\n\n    afterEach() {\n      destroyApp(this.application);\n\n      if (options.afterEach) {\n        options.afterEach.apply(this, arguments);\n      }\n    }\n  });\n}\n"
  },
  {
    "path": "tests/helpers/resolver.js",
    "content": "import Resolver from '../../resolver';\nimport config from '../../config/environment';\n\nconst resolver = Resolver.create();\n\nresolver.namespace = {\n  modulePrefix: config.modulePrefix,\n  podModulePrefix: config.podModulePrefix\n};\n\nexport default resolver;\n"
  },
  {
    "path": "tests/helpers/start-app.js",
    "content": "import Ember from 'ember';\nimport Application from '../../app';\nimport config from '../../config/environment';\n\nexport default function startApp(attrs) {\n  let application;\n\n  let attributes = Ember.merge({}, config.APP);\n  attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;\n\n  Ember.run(() => {\n    application = Application.create(attributes);\n    application.setupForTesting();\n    application.injectTestHelpers();\n  });\n\n  return application;\n}\n"
  },
  {
    "path": "tests/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <title>Dummy Tests</title>\n    <meta name=\"description\" content=\"\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n    {{content-for 'head'}}\n    {{content-for 'test-head'}}\n\n    <link rel=\"stylesheet\" href=\"assets/vendor.css\">\n    <link rel=\"stylesheet\" href=\"assets/dummy.css\">\n    <link rel=\"stylesheet\" href=\"assets/test-support.css\">\n    <style>\n      #ember-testing-container {\n        position: absolute;\n        background: white;\n        bottom: 0;\n        right: 0;\n        width: 640px;\n        height: 384px;\n        overflow: auto;\n        z-index: 9999;\n        border: 1px solid #ccc;\n      }\n      #ember-testing {\n        zoom: 50%;\n      }\n    </style>\n\n    {{content-for 'head-footer'}}\n    {{content-for 'test-head-footer'}}\n  </head>\n  <body>\n    {{content-for 'body'}}\n    {{content-for 'test-body'}}\n\n    <script src=\"assets/vendor.js\"></script>\n    <script src=\"assets/test-support.js\"></script>\n    <script src=\"assets/dummy.js\"></script>\n    <script src=\"testem.js\"></script>\n    <script src=\"assets/test-loader.js\"></script>\n    <script src=\"assets/tests.js\"></script>\n\n    {{content-for 'body-footer'}}\n    {{content-for 'test-body-footer'}}\n  </body>\n</html>\n"
  },
  {
    "path": "tests/integration/nav-bar-test.js",
    "content": "import Ember from 'ember';\nimport describeApp from '../helpers/describe-app';\n\ndescribeApp('Integration - Nav Bar', function() {\n  describe('Route Mixin', function() {\n    describe('Template', function() {\n      it('updates between routes', function() {\n        visit('nav-bar');\n\n        andThen(function() {\n          equal(find('header h1').text().trim(), 'Index');\n          equal(find('header button:first').text().trim(), 'iLeft');\n          equal(find('header button:last').text().trim(), 'iRight');\n        });\n\n        visit('nav-bar/page-1');\n\n        andThen(function() {\n          equal(find('header h1').text().trim(), 'Page 1');\n          equal(find('header button:first').text().trim(), 'pLeft');\n          equal(find('header button:last').text().trim(), 'pRight');\n        });\n      });\n\n      it('values can be a function', function() {\n        visit('nav-bar/options-from-model');\n\n        andThen(function() {\n          var leftButton  = find('header button:first');\n          var title       = find('header h1');\n          var rightButton = find('header button:last');\n\n          equal(title.text().trim(), 'modelOption');\n\n          equal(leftButton.text().trim(), 'modelLeft');\n          ok(leftButton.find('i').hasClass('leftClass'));\n\n          equal(rightButton.text().trim(), 'modelRight');\n          ok(rightButton.find('i').hasClass('rightClass'));\n        });\n      });\n    });\n\n    describe('Actions', function() {\n      before(function() {\n        var navIndex = this.app.__container__.lookup('route:nav-bar/index');\n        var page1    = this.app.__container__.lookup('route:nav-bar/page-1');\n        var spec     = this;\n\n        spec.navIndexStub = sinon.stub();\n        navIndex.setProperties({\n          'nav.leftButton.action': function() {\n            spec.navIndexStub('left');\n          },\n          'nav.rightButton.action': function() {\n            spec.navIndexStub('right');\n          }\n        });\n\n        spec.page1Stub = sinon.stub();\n        page1.setProperties({\n          'nav.leftButton.action': function() {\n            spec.page1Stub('left');\n          },\n          'nav.rightButton.action': function() {\n            spec.page1Stub('right');\n          }\n        });\n      });\n\n      it('updates between routes', function() {\n        visit('nav-bar');\n\n        click('header button:first');\n\n        andThen(Ember.run.bind(this, function() {\n          ok(this.navIndexStub.calledWith('left'));\n          ok(!this.navIndexStub.calledWith('right'));\n        }));\n\n        click('header button:last');\n\n        andThen(Ember.run.bind(this, function() {\n          ok(this.navIndexStub.calledWith('left'));\n          ok(this.navIndexStub.calledWith('right'));\n        }));\n\n        visit('nav-bar/page-1');\n\n        click('header button:first');\n\n        andThen(Ember.run.bind(this, function() {\n          ok(this.page1Stub.calledWith('left'));\n          ok(!this.page1Stub.calledWith('right'));\n        }));\n\n        click('header button:last');\n\n        andThen(Ember.run.bind(this, function() {\n          ok(this.page1Stub.calledWith('left'));\n          ok(this.page1Stub.calledWith('right'));\n        }));\n      });\n    });\n\n    describe('willTransiton reset', function() {\n      it('resets nav options on transition', function() {\n        visit('nav-bar');\n\n        andThen(function() {\n          equal(find('header h1').text().trim(), 'Index');\n        });\n\n        visit('nav-bar/should-reset');\n\n        andThen(Ember.run.bind(this, function() {\n          var ctrl = this.lookupController('nav-bar');\n\n          equal(find('header h1').text().trim(), '');\n          equal(find('header button:first').text().trim(), '');\n          equal(find('header button:last').text().trim(), '');\n          deepEqual(ctrl.get('nav'), {title: {}, leftButton: {}, rightButton: {}});\n        }));\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "tests/test-helper.js",
    "content": "import resolver from './helpers/resolver';\nimport {\n  setResolver\n} from 'ember-qunit';\n\nsetResolver(resolver);\n\ndocument.write('<div id=\"ember-testing-container\"><div id=\"ember-testing\"></div></div>');\n\nQUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});\nvar containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible';\ndocument.getElementById('ember-testing-container').style.visibility = containerVisibility;\n"
  },
  {
    "path": "tests/unit/.gitkeep",
    "content": ""
  }
]