From 079740ca2c8fa2eebbc5dd88a80092bfcad5ab73 Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Mon, 9 Apr 2012 22:21:09 -0700 Subject: [PATCH] Make Thor tasks more visible; Init Pages submodule when not present if about to run tests that require it --- Contribute.markdown | 2 +- Rakefile | 37 ++++++++++++++++++++++-------- Release.markdown | 14 ++++++----- tasks/jasmine_dev/base.rb | 4 ++-- tasks/jasmine_dev/execute_specs.rb | 2 +- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/Contribute.markdown b/Contribute.markdown index 5b71b92e..5360d36d 100644 --- a/Contribute.markdown +++ b/Contribute.markdown @@ -12,7 +12,7 @@ Or, How to make a successful pull request * _Be environment agnostic_ - server-side developers are just as important as browser developers * _Be browser agnostic_ - if you must rely on browser-specific functionality, please write it in a way that degrades gracefully * _Write specs_ - Jasmine's a testing framework; don't add functionality without test-driving it -* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and JSHint - your contribution shouldn't break Jasmine for other users +* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and JSHint - your contribution shouldn't break Jasmine for other users Follow these tips and your pull request, patch, or suggestion is much more likely to be integrated. diff --git a/Rakefile b/Rakefile index 8ccc9d03..1acbd943 100644 --- a/Rakefile +++ b/Rakefile @@ -7,19 +7,38 @@ Dir["#{File.dirname(__FILE__)}/tasks/**/*.rb"].each do |file| require file end -task :default => :spec +desc "Run all Jasmine JS specs" +task :jasmine_specs do + jasmine_dev = JasmineDev.new + + return unless jasmine_dev.node_installed? + + system "thor jasmine_dev:execute_specs" + + puts "\n\033[33m>>> DEPRECATED <<< Run Jasmine's JavaScript specs with 'thor jasmine_dev:execute_specs'\n\033[0m" +end + +desc "Run all Jasmine core tests (JavaScript and dev tasks)" +task :spec => :require_pages_submodule do + jasmine_dev = JasmineDev.new + + return unless jasmine_dev.node_installed? -desc "Run all developement tests" -task :spec do system "rspec" end -# Keeping this around for the Doc task, remove when doc is refactored task :require_pages_submodule do - raise "Submodule for Github Pages isn't present. Run git submodule update --init" unless pages_submodule_present -end - -def pages_submodule_present - File.exist?('pages/download.html') + jasmine_dev = JasmineDev.new + + unless jasmine_dev.pages_submodule_installed? + puts 'Installing the Github pages submodule:' + system 'git submodule update --init' + puts 'Now continuing...' + end end +desc "View full development tasks" +task :list_dev_tasks do + puts "Jasmine uses Thor for command line tasks for development. Here is the command set:" + system "thor list" +end \ No newline at end of file diff --git a/Release.markdown b/Release.markdown index 80a7c70c..b9a78c14 100644 --- a/Release.markdown +++ b/Release.markdown @@ -5,8 +5,11 @@ ___Jasmine Core Maintainers Only___ Follow the instructions in `Contribute.markdown` during development. -### Git Commits +### Git Rules +Please work on feature branches. + +Please attempt to keep commits to `master` small, but cohesive. If a feature is contained in a bunch of small commits (e.g., it has several wip commits), please squash them when merging back to `master`. ### Version @@ -16,10 +19,11 @@ The current version lives in the file `src/version.json`. This file should be se This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem. +Note that Jasmine should *not* use the "patch" version number. Let downstream projects rev their patch versions as needed, keeping their major and minor version numbers in sync with Jasmine core. ### Update the Github Pages (as needed) -Github pages have to exist in a branch called gh-pages in order for their app to serve them. This repo adds that branch as a submodule under the `pages` directory. This is a bit of a hack, but it allows us to work with the pages and the source at the same time and with one set of rake tasks. +Github pages have to exist in a branch called `gh-pages` in order for their app to serve them. This repo adds that branch as a submodule under the `pages` directory. This is a bit of a hack, but it allows us to work with the pages and the source at the same time and with one set of rake tasks. If you want to submit changes to this repo and aren't a Pivotal Labs employee, you can fork and work in the `gh-pages` branch. You won't be able to edit the pages in the submodule off of master. @@ -29,12 +33,10 @@ The pages are built with [Frank](https://github.com/blahed/frank). All the sourc When ready to release - specs are all green and the stories are done: -1. Update the version in `version.json` to a release candidate - add an `rc` property with a value of 1 +1. Update the version in `version.json` to a release candidate - add a `release_candidate` property with a value of 1 1. Update any comments on the public interfaces -1. `rake doc` - builds the `jsdoc` pages 1. Update any links or top-level landing page for the Github Pages -1. `rake standalone` - builds the standalone distribution ZIP file -1. `rake build_pages` - builds the Github Pages +1. `thor jasmine_dev:release_prep` - updates the version, builds the `.js` files, builds the standalone release, and builds the Github pages 1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org There should be a post to Pivotal Labs blog and a tweet to that link. diff --git a/tasks/jasmine_dev/base.rb b/tasks/jasmine_dev/base.rb index 0c9df609..07dc09e4 100644 --- a/tasks/jasmine_dev/base.rb +++ b/tasks/jasmine_dev/base.rb @@ -29,7 +29,7 @@ class JasmineDev < Thor def node_installed? return true if has_node? - say "Node.js is required to develop Jasmine. Please visit http://nodejs.org to install. ", + say "Node.js is required to develop Jasmine. Please visit http://nodejs.org to install.", :red false end @@ -48,7 +48,7 @@ class JasmineDev < Thor end def has_pages_submodule? - File.exist?(File.join(JasmineDev.project_root, 'pages', 'download.html')) + File.exist?(File.join(JasmineDev.project_root, 'pages', 'index.html')) end end end diff --git a/tasks/jasmine_dev/execute_specs.rb b/tasks/jasmine_dev/execute_specs.rb index 63f4ff02..1147af88 100644 --- a/tasks/jasmine_dev/execute_specs.rb +++ b/tasks/jasmine_dev/execute_specs.rb @@ -30,7 +30,7 @@ class JasmineDev < Thor open_specs_in_browser end - desc "execute_specs", "Run all of Jasmine's specs" + desc "execute_specs", "Run all of Jasmine's JavaScript specs" def execute_specs invoke :execute_specs_in_node