Skip to content

Commit

Permalink
update styling and readability of readme
Browse files Browse the repository at this point in the history
  • Loading branch information
k1bs committed Jan 11, 2018
1 parent f7cfbb8 commit c89ec70
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem "sprig"
```
Use `rails generate sprig:install` to create environment-specific and shared seed directories.

##The Sprig Directive
## The Sprig Directive

Within your seed file, you can use the `sprig` directive to initiate Sprig's dark magicks. A simple directive might look like this.

Expand All @@ -33,11 +33,11 @@ sprig_shared [User, Post, Comment]

This directive tells Sprig to go find your datafiles for the `User`, `Post`, and `Comment` seed resources, build records from the data entries, and insert them into the database. Sprig will automatically detect known datafile types like `.yml`, `.json`, or `.csv` within your environment-specific seed directory.

##Environment
## Environment

Seed files are unique to the environment in which your Rails application is running. Within `db/seeds` create an environment-specific directory (i.e. `/development` for your 'development' environment).

###Shared
### Shared

Shared seed files default directory is `shared` (eg `db/seeds/shared`)
You can change it by settings`
Expand All @@ -49,7 +49,7 @@ sprig_shared [User]
```
This will insert `:env/users` and `shared/users` seeds

##Seed files
## Seed files

Hang your seed definitions on a `records` key for *yaml* and *json* files.

Expand Down Expand Up @@ -159,7 +159,7 @@ records:
published_at: "<%= 1.week.ago %>"
```

##Custom Sources and Parsers
## Custom Sources and Parsers

If all your data is in `.wat` files, fear not. You can tell Sprig where to look for your data, and point it toward a custom parser class for turning your data into records. The example below tells Sprig to read `User` seed data from a Google Spreadsheet, and parse it accordingly.

Expand All @@ -179,7 +179,7 @@ sprig [
]
```

##Configuration
## Configuration

When Sprig conventions don't suit, just add a configuration block to your seed file.

Expand Down

0 comments on commit c89ec70

Please sign in to comment.