Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (69 sloc) 2.82 KB

Guard::Motion Build Status

Motion guard allows to automatically & intelligently launch RubyMotion specs when files are modified.


Please be sure to have Guard installed before continue.

Install the gem:

$ gem install guard-motion

Add it to your Gemfile (inside development group):

gem 'guard-motion'

Add guard definition to your Guardfile by running this command:

$ guard init motion

Make sure Guard::Motion is loaded in your project Rakefile:

require 'guard/motion'


Please read Guard usage doc


Motion guard can be really adapted to all kind of project setup.

Typical RubyMotion App

guard 'motion' do
  watch(%r{^app/(.+)\.rb$})     { |m| "spec/#{m[1]}_spec.rb" }

Typical RubyMotion library

guard 'motion' do
  watch(%r{^lib/[^/]+/(.+)\.rb$})     { |m| "./spec/#{m[1]}_spec.rb" }

Please read Guard doc for more information about the Guardfile DSL.


By default, Guard::Motion will only look for spec files within spec in your project root. You can configure Guard::Motion to look in additional paths by using the :spec_paths option:

guard 'motion', :spec_paths => ["spec", "vendor/other_project/spec"] do
  # ...

If you have only one path to look, you can configure :spec_paths option with a string:

guard 'motion', :spec_paths => "test" do
  # ...

List of available options:

:bundler => false            # use "bundle exec" to run the rake command, default: true
:binstubs => true            # use "bin/rake" to run the rake command (takes precedence over :bundle), default: false
:notification => false       # display Growl (or Libnotify) notification after the specs are done running, default: true
:all_after_pass => false     # run all specs after changed specs pass, default: true
:all_on_start => false       # run all the specs at startup, default: true
:keep_failed => false        # keep failed specs until they pass, default: true
:spec_paths => ["spec"]      # specify an array of paths that contain spec files

You can also use a custom binstubs directory using :binstubs => 'some-dir'.


Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.