From 37c51438a7979abfbf394c4830e27d7148b7a2ac Mon Sep 17 00:00:00 2001 From: aredda Date: Thu, 2 May 2024 01:04:16 +0100 Subject: [PATCH] chore: more documentation --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 5a1c70b..8eab847 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,39 @@ If bundler is not being used to manage dependencies, install the gem by executin ## Usage +All concept files are generated inside the `app/concepts` directory. + To generate files, simply run this command: $ wizard [--model] [--actions] [--only] [--except] [--context] +| Argument | Type | Presence | Description | +|----------|--------|--------------|-------------------------------------------------------| +| model | String | **Required** | The model. | +| actions | Array | **Required** | The files' names. | +| only | Array | Optional | Only the specified *concept types*. | +| except | Array | Optional | Except the specified *concept types*. | +| context | String | Optional | A directory to group concept files, `nil` by default. | + +Allowed concept types are: `operation | finder | form (meant for contracts) | view (meant for representables)` + +#### Example 1: + + wizard --model=User --actions=create --only=operation,form + +This command will generate: + + app/concepts/user/operation/create.rb + app/concepts/user/form/create.rb + +#### Example 2: with context + + wizard --model=User --context=admin --actions=index --only=operation + +Generates: + + app/concepts/user/admin/operation/index.rb + ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/aredda/trailblazer-wizard. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/wizard/blob/main/CODE_OF_CONDUCT.md).