README.md in stairs-0.6.1 vs README.md in stairs-0.7.0
- old
+ new
@@ -18,10 +18,25 @@
interactive prompts for everything else.
[![Build Status](https://travis-ci.org/patbenatar/stairs.png?branch=master)](https://travis-ci.org/patbenatar/stairs)
[![Code Climate](https://codeclimate.com/github/patbenatar/stairs.png)](https://codeclimate.com/github/patbenatar/stairs)
+## Table of Contents
+
+* [Setup](#setup)
+* [Running Scripts](#running-scripts)
+ * [Command Line Utility](#advanced)
+* [Defining Scripts](#defining-scripts)
+ * [Collecting Input](#collecting-values)
+ * [Asking Questions](#asking-questions)
+ * [Setting ENV vars](#setting-env-vars)
+ * [Writing to Files](#writing-files)
+ * [Miscellaneous](#misc-helpers)
+ * [Steps](#steps)
+ * [Groups](#groups)
+* [Plugins](#plugins)
+
## Setup
### Rails
Add Stairs to your `Gemfile`:
@@ -40,11 +55,11 @@
```ruby
require "stairs/tasks"
```
-## Usage
+## Running Scripts
### Basic
In an app with a `setup.rb`, just run the rake task:
@@ -58,10 +73,11 @@
```
$ stairs --help
Usage: stairs [options]
--use-defaults Use defaults when available
+ -g, --groups GROUPS Specify groups to run. e.g. init,reset
```
## Defining scripts
A script composes many steps that setup a project.
@@ -97,12 +113,13 @@
do_something if yes
end
dinner = choice "Meat or vegetables?", ["Meat", "Vegetables"]
```
-### Setting env vars
-Stairs currently supports writing environment variables for rbenv-vars, RVM, and dotenv.
+### Setting ENV vars
+Stairs currently supports writing environment variables for rbenv-vars, RVM, and
+dotenv.
```ruby
env "NAME", value
```
@@ -122,24 +139,62 @@
Display a message when setup completes
```ruby
finish "Now that you're done, go have a drink!"
```
-### Defining setup steps
+### Steps
+Group related setup procedures into named steps using `setup`:
+
```ruby
setup :a_cool_service do
# ...
end
```
#### Using predefined steps (aka plugins)
+
```ruby
setup :s3
setup :facebook, required: false
```
-## Plugins for common setups
+[Available Plugins](#plugins)
+
+### Groups
+
+Stairs supports organizing your script into groups in a way similar to what you
+may be used to with Bundler. With groups you can target specific steps to run
+for different use cases (see `-g` option in the [command line utility](#advanced)).
+
+Anything outside of a group will always be executed. Anything within a group
+will only be executed when its group is run. By default, Stairs runs the `newb`
+group with `$ rake newb`.
+
+For example, you may want to run different steps on a brand new setup than you
+would when resetting an existing setup:
+
+```ruby
+group :newb do
+ setup :s3
+end
+
+group :newb, :reset do
+ setup :balanced
+ rake "db:setup"
+end
+```
+
+And then run your reset like so:
+
+```bash
+$ stairs -g reset
+```
+
+## Plugins
+
+Many projects share dependencies. Plugins are predefined setup steps for common
+use cases.
Some steps support options. Options are specified as a hash like so:
```ruby
setup :step_name, option_1: "value", option_2: "value"