Make Thor tasks more visible; Init Pages submodule when not present if about to run tests that require it
This commit is contained in:
35
Rakefile
35
Rakefile
@@ -7,19 +7,38 @@ Dir["#{File.dirname(__FILE__)}/tasks/**/*.rb"].each do |file|
|
|||||||
require file
|
require file
|
||||||
end
|
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"
|
system "rspec"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Keeping this around for the Doc task, remove when doc is refactored
|
|
||||||
task :require_pages_submodule do
|
task :require_pages_submodule do
|
||||||
raise "Submodule for Github Pages isn't present. Run git submodule update --init" unless pages_submodule_present
|
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
|
end
|
||||||
|
|
||||||
def pages_submodule_present
|
desc "View full development tasks"
|
||||||
File.exist?('pages/download.html')
|
task :list_dev_tasks do
|
||||||
|
puts "Jasmine uses Thor for command line tasks for development. Here is the command set:"
|
||||||
|
system "thor list"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,11 @@ ___Jasmine Core Maintainers Only___
|
|||||||
|
|
||||||
Follow the instructions in `Contribute.markdown` during development.
|
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
|
### 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.
|
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)
|
### 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.
|
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:
|
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. 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. Update any links or top-level landing page for the Github Pages
|
||||||
1. `rake standalone` - builds the standalone distribution ZIP file
|
1. `thor jasmine_dev:release_prep` - updates the version, builds the `.js` files, builds the standalone release, and builds the Github pages
|
||||||
1. `rake build_pages` - builds the Github Pages
|
|
||||||
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org
|
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.
|
There should be a post to Pivotal Labs blog and a tweet to that link.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class JasmineDev < Thor
|
|||||||
def node_installed?
|
def node_installed?
|
||||||
return true if has_node?
|
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
|
:red
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
@@ -48,7 +48,7 @@ class JasmineDev < Thor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def has_pages_submodule?
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class JasmineDev < Thor
|
|||||||
open_specs_in_browser
|
open_specs_in_browser
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "execute_specs", "Run all of Jasmine's specs"
|
desc "execute_specs", "Run all of Jasmine's JavaScript specs"
|
||||||
|
|
||||||
def execute_specs
|
def execute_specs
|
||||||
invoke :execute_specs_in_node
|
invoke :execute_specs_in_node
|
||||||
|
|||||||
Reference in New Issue
Block a user