{"id":21939172,"url":"https://github.com/grottopress/lucille","last_synced_at":"2025-04-22T14:49:43.147Z","repository":{"id":41936643,"uuid":"400616037","full_name":"GrottoPress/lucille","owner":"GrottoPress","description":"Utilities for Lucky framework","archived":false,"fork":false,"pushed_at":"2025-04-19T08:57:48.000Z","size":168,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T15:11:57.293Z","etag":null,"topics":["crystal","lucky-framework"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrottoPress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-27T19:29:03.000Z","updated_at":"2025-04-19T08:57:51.000Z","dependencies_parsed_at":"2023-02-06T08:17:17.324Z","dependency_job_id":"a3c90a33-aa49-4639-9b41-83b9c54c5e6a","html_url":"https://github.com/GrottoPress/lucille","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flucille","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flucille/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flucille/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Flucille/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrottoPress","download_url":"https://codeload.github.com/GrottoPress/lucille/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250263165,"owners_count":21401809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal","lucky-framework"],"created_at":"2024-11-29T02:17:13.590Z","updated_at":"2025-04-22T14:49:43.075Z","avatar_url":"https://github.com/GrottoPress.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lucille\n\n**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.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     lucille:\n       github: GrottoPress/lucille\n   ```\n\n1. Run `shards update`\n\n1. Require *Lucille* in your app:\n\n   ```crystal\n   # ...\n\n   require \"lucille\"\n   # \u003c= Or you may require only the components you need:\n   # \u003c= `require \"lucille/avram\"`\n   # \u003c= `require \"lucille/carbon\"`\n   # \u003c= `require \"lucille/lucky\"`\n\n   # For specs:\n   #\n   #   require \"lucille/spec\"\n   #\n   #   Or require only the components you need:\n   #\n   #     require \"lucille/spec/avram\"\n   #     require \"lucille/spec/carbon\"\n   #     require \"lucille/spec/lucky\"\n\n   # ...\n   ```\n\n## Utilities\n\n### Avram\n\n- #### Macros\n\n  - `__enum`: Creates an *Avram* adapter that saves enums to the database as `String`\n\n- #### Validations\n\n  - `.validate_email`\n  - `.validate_domain`\n  - `.validate_domain_label`\n  - `.validate_foreign_key`\n  - `.validate_http_url`\n  - `.validate_ip`\n  - `.validate_ip4`\n  - `.validate_ip6`\n  - `.validate_name`\n  - `.validate_negative_number`\n  - `.validate_not_pwned`\n  - `.validate_positive_number`\n  - `.validate_slug`\n  - `.validate_url`\n  - `.validate_unicode_name`\n  - `.validate_username`\n\n- #### Models (Data)\n\n  - `Lucille::JSON`\n  - `Lucille::StatusColumns`\n  - `Lucille::SuccessStatusColumns`\n\n- #### Models (Domain)\n\n  - `RecordStatus`\n  - `SuccessStatus`\n\n- #### Operations\n\n  - `Lucille::Activate`\n  - `Lucille::Deactivate`\n  - `Lucille::SetUserIdFromUser`\n  - `Lucille::UserFromUserId`\n  - `Lucille::ValidateStatus`\n  - `Lucille::ValidateUserExists`\n\n- #### Queries\n\n  - `Lucille::StatusQuery`\n  - `Lucille::SuccessStatusQuery`\n\n- #### Criteria\n\n  - `String::Lucky::Criteria#search`\n\n### Carbon\n\n- #### Mixins\n\n  - `MailHelpers`: Includes helpers for working with *Carbon* mails\n\n### Lucky\n\n- #### Actions\n\n  - `Lucille::ActionHelpers`\n\n- #### Annotations\n\n  - `Memoize`: Invokes *Lucky*'s `.memoize` macro\n\n- #### Serializers\n\n  - `Lucille::Serializer`: It's a `module`, so you can create serializer with `struct`s.\n\n### Spec\n\n- #### Avram\n\n  - `#have_error`: Spec expectation that asserts the validity of an attribute\n  - `#nested_params`: Creates nested params\n  - `#params`: Creates params\n\n- #### Carbon\n\n  - `DevDeliverLaterStrategy`: Delivers mail immediately, in the current fiber.\n\n## I18n\n\n*Lucille* uses *Rex* for i18n. See \u003chttps://github.com/GrottoPress/rex\u003e.\n\nUse the following as a guide to set up translations:\n\n```yaml\nen:\n  operation:\n    error:\n      active_at_required: Active time is required\n      inactive_at_earlier: Inactive time cannot be earlier than active time\n      user_not_found: User does not exist\n```\n\n## Development\n\nCreate a `.env` file:\n\n```bash\nDATABASE_URL='postgres://postgres:password@localhost:5432/lucille_spec'\n```\n\nUpdate the file with your own details. Then run tests with `crystal spec`.\n\n## Contributing\n\n1. [Fork it](https://github.com/GrottoPress/lucille/fork)\n1. Switch to the `master` branch: `git checkout master`\n1. Create your feature branch: `git checkout -b my-new-feature`\n1. Make your changes, updating changelog and documentation as appropriate.\n1. Commit your changes: `git commit`\n1. Push to the branch: `git push origin my-new-feature`\n1. Submit a new *Pull Request* against the `GrottoPress:master` branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Flucille","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrottopress%2Flucille","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Flucille/lists"}