Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trailblazer-wizard

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trailblazer-wizard

  • 0.0.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

trailblazer-wizard

A helper to aid you with generating blank Trailblazer concept files including: operations, contracts, finders, and representables.

Installation

Install the gem and add to the application's Gemfile by executing:

$ gem 'trailblazer-wizard'

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install trailblazer-wizard

Usage

All concept files are generated inside the app/concepts directory.

To generate files, simply run this command:

$ wizard [--model] [--actions] [--only] [--except] [--context]
ArgumentTypePresenceDescription
modelStringRequiredThe model.
actionsArrayRequiredThe files' names.
onlyArrayOptionalOnly the specified concept types.
exceptArrayOptionalExcept the specified concept types.
contextStringOptionalA 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

Configuration

To change the base directory app/concepts, or maybe pluralize concept directories, or even use alternative concept type names... there is the possibility to apply these tweaks by creating an initializer:

# config/initializers/trailblazer_wizard.rb

TrailblazerWizard.configure do |config|
    config.base_directory = "example/example"
    config.puralize = true
    config.alt_types = {
        form: :contract,
        view: 'representable'
    }
end

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.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Wizard project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 06 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc