Lucille is a collection of utilities for Lucky framework. It includes many custom validations for Avram operations, and several helper types and methods for use in app development and specs.
-
Add the dependency to your
shard.yml
:dependencies: lucille: github: GrottoPress/lucille
-
Run
shards update
-
Require Lucille in your app:
# ... require "lucille" # <= Or you may require only the components you need: # <= `require "lucille/avram"` # <= `require "lucille/carbon"` # <= `require "lucille/lucky"` # For specs: # # require "lucille/spec" # # Or require only the components you need: # # require "lucille/spec/avram" # require "lucille/spec/carbon" # require "lucille/spec/lucky" # ...
-
__enum
: Creates an Avram adapter that saves enums to the database asString
-
.validate_email
.validate_domain
.validate_domain_label
.validate_foreign_key
.validate_http_url
.validate_ip
.validate_ip4
.validate_ip6
.validate_name
.validate_negative_number
.validate_not_pwned
.validate_positive_number
.validate_slug
.validate_url
.validate_unicode_name
.validate_username
-
Lucille::JSON
Lucille::StatusColumns
Lucille::SuccessStatusColumns
-
RecordStatus
SuccessStatus
-
Lucille::Activate
Lucille::Deactivate
Lucille::SetUserIdFromUser
Lucille::UserFromUserId
Lucille::ValidateStatus
Lucille::ValidateUserExists
-
Lucille::StatusQuery
Lucille::SuccessStatusQuery
-
String::Lucky::Criteria#search
-
MailHelpers
: Includes helpers for working with Carbon mails
-
Lucille::ActionHelpers
-
Memoize
: Invokes Lucky's.memoize
macro
-
Lucille::Serializer
: It's amodule
, so you can create serializer withstruct
s.
-
#have_error
: Spec expectation that asserts the validity of an attribute#nested_params
: Creates nested params#params
: Creates params
-
DevDeliverLaterStrategy
: Delivers mail immediately, in the current fiber.
Lucille uses Rex for i18n. See https://github.com/GrottoPress/rex.
Use the following as a guide to set up translations:
en:
operation:
error:
active_at_required: Active time is required
inactive_at_earlier: Inactive time cannot be earlier than active time
user_not_found: User does not exist
Create a .env
file:
DATABASE_URL='postgres://postgres:password@localhost:5432/lucille_spec'
Update the file with your own details. Then run tests with crystal spec
.
- Fork it
- Switch to the
master
branch:git checkout master
- Create your feature branch:
git checkout -b my-new-feature
- Make your changes, updating changelog and documentation as appropriate.
- Commit your changes:
git commit
- Push to the branch:
git push origin my-new-feature
- Submit a new Pull Request against the
GrottoPress:master
branch.