Permalink
Browse files

Make Thor tasks more visible; Init Pages submodule when not present i…

…f about to run tests that require it
  • Loading branch information...
1 parent fbbccf6 commit 079740ca2c8fa2eebbc5dd88a80092bfcad5ab73 Davis W. Frank committed Apr 10, 2012
Showing with 39 additions and 18 deletions.
  1. +1 −1 Contribute.markdown
  2. +27 −8 Rakefile
  3. +8 −6 Release.markdown
  4. +2 −2 tasks/jasmine_dev/base.rb
  5. +1 −1 tasks/jasmine_dev/execute_specs.rb
View
@@ -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.
View
@@ -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
+ jasmine_dev = JasmineDev.new
-def pages_submodule_present
- File.exist?('pages/download.html')
+ 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
View
@@ -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.
@@ -29,7 +29,7 @@ def run_with_output(*run_args)
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 @@ def pages_submodule_installed?
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
@@ -30,7 +30,7 @@ def execute_specs_in_browser
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

0 comments on commit 079740c

Please sign in to comment.