diff --git a/.editorconfig b/.editorconfig index 5d5dea4..2fe4874 100644 --- a/.editorconfig +++ b/.editorconfig @@ -29,5 +29,5 @@ indent_size = 2 indent_style = space indent_size = 2 -[*.md] +[*.{diff,md}] trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 7da12c3..86fceae 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ # dependencies /node_modules -/bower_components/* +/bower_components # misc /.sass-cache diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..08096ef --- /dev/null +++ b/.jshintrc @@ -0,0 +1,32 @@ +{ + "predef": [ + "document", + "window", + "-Promise" + ], + "browser": true, + "boss": true, + "curly": true, + "debug": false, + "devel": true, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true, + "unused": true +} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0533b91 --- /dev/null +++ b/.npmignore @@ -0,0 +1,12 @@ +bower_components/ +tests/ + +.bowerrc +.editorconfig +.ember-cli +.travis.yml +.npmignore +**/.gitkeep +bower.json +Brocfile.js +testem.json diff --git a/.travis.yml b/.travis.yml index df6253d..cf23938 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ cache: directories: - node_modules +before_install: + - "npm config set spin false" + - "npm install -g npm@^2" + install: - npm install -g bower - npm install diff --git a/Brocfile.js b/Brocfile.js index b093f32..741a737 100644 --- a/Brocfile.js +++ b/Brocfile.js @@ -1,3 +1,4 @@ +/* jshint node: true */ /* global require, module */ var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..00e9fbb --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2015 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/bower.json b/bower.json index 2a15e04..bc64635 100644 --- a/bower.json +++ b/bower.json @@ -3,15 +3,15 @@ "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", - "ember": "1.7.0", - "ember-data": "1.0.0-beta.10", - "ember-resolver": "~0.1.7", - "loader.js": "stefanpenner/loader.js#1.0.1", - "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3", - "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4", - "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", - "ember-qunit": "0.1.8", - "ember-qunit-notifications": "0.0.4", - "qunit": "~1.15.0" + "ember": "1.8.1", + "ember-data": "1.0.0-beta.14.1", + "ember-resolver": "~0.1.11", + "loader.js": "ember-cli/loader.js#1.0.1", + "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", + "ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.1", + "ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", + "ember-qunit": "0.2.8", + "ember-qunit-notifications": "0.0.7", + "qunit": "~1.17.1" } } \ No newline at end of file diff --git a/config/environment.js b/config/environment.js index 1abeb19..0dfaed4 100644 --- a/config/environment.js +++ b/config/environment.js @@ -1,5 +1,5 @@ 'use strict'; -module.exports = function(/*environment, appConfig */) { +module.exports = function(/* environment, appConfig */) { return { }; }; diff --git a/index.js b/index.js index f689f82..aaf2824 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,6 @@ +/* jshint node: true */ +'use strict'; + module.exports = { name: 'ember-cli-toggle', diff --git a/package.json b/package.json index 3ec4352..437887e 100644 --- a/package.json +++ b/package.json @@ -18,16 +18,20 @@ "author": "Ilya Radchenko", "license": "MIT", "devDependencies": { - "body-parser": "^1.2.0", - "broccoli-asset-rev": "0.3.0", + "broccoli-asset-rev": "^2.0.0", "broccoli-ember-hbs-template-compiler": "^1.6.1", - "ember-cli": "0.1.1", - "ember-cli-content-security-policy": "0.2.0", "ember-cli-github-pages": "0.0.2", + "ember-cli": "0.1.15", + "ember-cli-6to5": "^3.0.0", + "ember-cli-app-version": "0.3.1", + "ember-cli-content-security-policy": "0.3.0", + "ember-cli-dependency-checker": "0.0.7", "ember-cli-ic-ajax": "0.1.1", - "ember-cli-inject-live-reload": "^1.2.2", - "ember-cli-qunit": "0.1.0", - "ember-data": "1.0.0-beta.10", + "ember-cli-inject-live-reload": "^1.3.0", + "ember-cli-qunit": "0.3.7", + "ember-cli-uglify": "1.0.1", + "ember-data": "1.0.0-beta.14.1", + "ember-export-application-global": "^1.0.2", "express": "^4.8.5", "glob": "^4.0.5" }, @@ -41,4 +45,4 @@ "ember-addon": { "configPath": "tests/dummy/config" } -} +} \ No newline at end of file diff --git a/testem.json b/testem.json index eff93f9..42a4ddb 100644 --- a/testem.json +++ b/testem.json @@ -1,6 +1,6 @@ { "framework": "qunit", - "test_page": "tests/index.html", + "test_page": "tests/index.html?hidepassed", "launch_in_ci": [ "PhantomJS" ], diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html index f5990f6..13873aa 100644 --- a/tests/dummy/app/index.html +++ b/tests/dummy/app/index.html @@ -11,9 +11,15 @@ + + {{content-for 'head-footer'}} + {{content-for 'body'}} + + + {{content-for 'body-footer'}} diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index bd43f46..ea50b41 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -28,16 +28,16 @@ module.exports = function(environment) { if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; - ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_ACTIVE_GENERATION = true; // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - ENV.APP.LOG_VIEW_LOOKUPS = true; + // ENV.APP.LOG_VIEW_LOOKUPS = true; } if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; - ENV.locationType = 'auto'; + ENV.locationType = 'none'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; diff --git a/tests/dummy/public/robots.txt b/tests/dummy/public/robots.txt index ee2cc21..5debfa4 100644 --- a/tests/dummy/public/robots.txt +++ b/tests/dummy/public/robots.txt @@ -1,3 +1,2 @@ -# robotstxt.org/ - +# http://www.robotstxt.org User-agent: * diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index 7cd4320..16cc7c3 100644 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -4,22 +4,16 @@ import Router from '../../router'; import config from '../../config/environment'; export default function startApp(attrs) { - var App; + var application; var attributes = Ember.merge({}, config.APP); attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; - Router.reopen({ - location: 'none' - }); - Ember.run(function() { - App = Application.create(attributes); - App.setupForTesting(); - App.injectTestHelpers(); + application = Application.create(attributes); + application.setupForTesting(); + application.injectTestHelpers(); }); - App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL" - - return App; + return application; } diff --git a/tests/index.html b/tests/index.html index 78fd346..09689c8 100644 --- a/tests/index.html +++ b/tests/index.html @@ -8,6 +8,7 @@ {{content-for 'head'}} + {{content-for 'test-head'}} @@ -28,15 +29,23 @@ zoom: 50%; } + + {{content-for 'head-footer'}} + {{content-for 'test-head-footer'}}
+ {{content-for 'body'}} + {{content-for 'test-body'}} + + {{content-for 'body-footer'}} + {{content-for 'test-body-footer'}}