Skip to content

Commit

Permalink
simplify install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jenseng committed Apr 1, 2014
1 parent e70fe7f commit a4d74e6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
25 changes: 25 additions & 0 deletions RAILS2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Rails 2 Installation

To get HairTrigger working in Rails 2, you need to:

## Add it to your project

Put hairtrigger in your Gemfile, or if you're not using bundler, you can
`gem install hairtrigger` and then put hairtrigger in environment.rb

## Set up a rake task

Create lib/tasks/hair_trigger.rake with the following:

```ruby
$VERBOSE = nil
Dir["#{Gem::Specification.find_by_name('hairtrigger').full_gem_path}/lib/tasks/*.rake"].each { |ext| load ext }
```

This will give you the `db:generate_trigger_migration` task, and will ensure
that hairtrigger hooks into `db:schema:dump`.

If you are unpacking the gem in vendor/plugins, this step is not needed
(though you'll then want to delete its Gemfile to avoid possible conflicts).


27 changes: 2 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,8 @@ and a simple rake task does all the dirty work for you.

## Installation

### Rails 3 or 4

If you are using Rails 3 or 4, just `gem 'hairtrigger'`

### Rails 2

#### Step 1.

Put hairtrigger in your Gemfile, or if you're not using bundler, you can
`gem install hairtrigger` and then put hairtrigger in environment.rb

#### Step 2.

Create lib/tasks/hair_trigger.rake with the following:

```ruby
$VERBOSE = nil
Dir["#{Gem::Specification.find_by_name('hairtrigger').full_gem_path}/lib/tasks/*.rake"].each { |ext| load ext }
```

This will give you the `db:generate_trigger_migration` task, and will ensure
that hairtrigger hooks into `db:schema:dump`.

If you are unpacking the gem in vendor/plugins, this step is not needed
(though you'll then want to delete its Gemfile to avoid possible conflicts).
If you are using Rails 3 or beyond, just add `gem 'hairtrigger'` to your
Gemfile. For Rails 2, it's [slightly more involved](RAILS2.md)

## Usage

Expand Down

0 comments on commit a4d74e6

Please sign in to comment.