https://github.com/apotonick/declarative
DSL for nested schemas.
https://github.com/apotonick/declarative
Keywords from Contributors
json-parser rack sinatra activejob activerecord mvc json-serialization xml-parser xml-serialization
Last synced: about 19 hours ago
JSON representation
Repository metadata
DSL for nested schemas.
- Host: GitHub
- URL: https://github.com/apotonick/declarative
- Owner: apotonick
- License: mit
- Created: 2015-06-25T02:38:00.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-06-24T10:14:55.000Z (10 months ago)
- Last Synced: 2026-04-19T18:08:03.659Z (12 days ago)
- Language: Ruby
- Size: 86.9 KB
- Stars: 22
- Watchers: 1
- Forks: 9
- Open Issues: 4
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.txt
README.md
Declarative
DSL for nested schemas.
Overview
Declarative allows declaring nested schemas.
Installation
Add this line to your application's Gemfile:
gem 'declarative'
Declarative::Schema
Include this into a class or module to allow defining nested schemas using the popular ::property DSL.
Normally, an abstract base class will define essential configuration.
class Model
extend Declarative::Schema
def self.default_nested_class
Model
end
end
Concrete schema-users simply derive from the base class.
class Song < Model
property :id
property :artist do
property :id
property :name
end
end
This won't do anything but populate the ::definitions graph.
Song.definitions #=>
<Definition "id">
<Definition "artist" nested=..>
<Definition "id">
<Definition "name">
The nested schema will be a subclass of Model.
Song.definitions.get(:artist) #=> <Anonymous:Model definitions=..>
Overriding Nested Building
When declaring nested schemas, per default, Declarative will use its own Schema::NestedBuilder to create the nested schema composer.
Override ::nested_builder to define your own way of doing that.
class Model
extend Declarative::Schema
def self.default_nested_class
Model
end
def self.nested_builder
->(options) do
Class.new(Model) do
class_eval &options[:_block] # executes `property :name` etc. on nested, fresh class.
end
end
end
end
Features
You can automatically include modules into all nested schemas by using ::feature.
class Model
extend Declarative::Schema
feature Bla
Defaults
class Model
extend Declarative::Schema
defaults visible: true
Copyright
- Copyright (c) 2015 Nick Sutterer apotonick@gmail.com
Owner metadata
- Name: Nick Sutterer
- Login: apotonick
- Email:
- Kind: user
- Description:
- Website: http://trailblazer.to
- Location:
- Twitter:
- Company: @trailblazer
- Icon url: https://avatars.githubusercontent.com/u/10406?u=07fb57ecf10f63b322e0a4edced970d0de9a3aa0&v=4
- Repositories: 73
- Last ynced at: 2023-04-09T04:55:32.052Z
- Profile URL: https://github.com/apotonick
GitHub Events
Total
- Pull request event: 1
- Fork event: 1
- Issue comment event: 7
- Push event: 1
Last Year
- Issue comment event: 7
- Push event: 1
Committers metadata
Last synced: 1 day ago
Total Commits: 107
Total Committers: 6
Avg Commits per committer: 17.833
Development Distribution Score (DDS): 0.084
Commits in past year: 2
Committers in past year: 2
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.5
| Name | Commits | |
|---|---|---|
| Nick Sutterer | a****k@g****m | 98 |
| Abinoam P. Marques Jr | a****m@g****m | 4 |
| Abdelkader Boudih | t****e@g****m | 2 |
| Zahidul Haque | i****i@g****m | 1 |
| Takashi Masuda | m****a@f****p | 1 |
| Josef Šimánek | j****k@g****m | 1 |
Committer domains:
- feedforce.jp: 1
Issue and Pull Request metadata
Last synced: 3 days ago
Total issues: 3
Total pull requests: 7
Average time to close issues: N/A
Average time to close pull requests: 29 days
Total issue authors: 3
Total pull request authors: 7
Average comments per issue: 2.0
Average comments per pull request: 3.29
Merged pull request: 5
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: 2 months
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 20.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- shmokmt (1)
- jamesbebbington (1)
- aldesantis (1)
Top Pull Request Authors
- simi (2)
- abinoam (1)
- terceiro (1)
- opodartho (1)
- masutaka (1)
- seuros (1)
- nageshlop (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 672,997,929 total
- Total docker downloads: 1,138,618,624
- Total dependent packages: 6 (may contain duplicates)
- Total dependent repositories: 26,022 (may contain duplicates)
- Total versions: 32
- Total maintainers: 2
gem.coop: declarative
DSL for nested generic schemas with inheritance and refining.
- Homepage: https://github.com/apotonick/declarative
- Documentation: http://www.rubydoc.info/gems/declarative/
- Licenses: MIT
- Latest release: 0.0.20 (published almost 6 years ago)
- Last Synced: 2026-04-30T04:30:40.666Z (1 day ago)
- Versions: 11
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 336,520,513 Total
- Docker Downloads: 569,309,312
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.059%
- Downloads: 0.075%
- Docker downloads count: 0.163%
- Maintainers (2)
ubuntu-20.04: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Licenses: mit
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-13T13:25:13.325Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Forks count: 0.131%
- Average: 0.588%
- Stargazers count: 2.222%
rubygems.org: declarative
DSL for nested generic schemas with inheritance and refining.
- Homepage: https://github.com/apotonick/declarative
- Documentation: http://www.rubydoc.info/gems/declarative/
- Licenses: MIT
- Latest release: 0.0.20 (published almost 6 years ago)
- Last Synced: 2026-04-29T22:45:41.380Z (1 day ago)
- Versions: 11
- Dependent Packages: 6
- Dependent Repositories: 26,022
- Downloads: 336,477,416 Total
- Docker Downloads: 569,309,312
-
Rankings:
- Downloads: 0.085%
- Dependent repos count: 0.221%
- Docker downloads count: 0.229%
- Dependent packages count: 2.484%
- Average: 3.969%
- Forks count: 9.679%
- Stargazers count: 11.117%
- Maintainers (2)
ubuntu-24.04: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-06T15:58:30.147Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Documentation: https://packages.debian.org/buster/ruby-declarative
- Licenses:
- Latest release: 0.0.10-1 (published 3 months ago)
- Last Synced: 2026-03-13T20:01:46.427Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-13T22:41:30.734Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-14T02:20:34.102Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Documentation: https://packages.debian.org/bullseye/ruby-declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-14T06:21:59.049Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-11T14:11:41.872Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Documentation: https://packages.debian.org/trixie/ruby-declarative
- Licenses: mit
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-14T15:02:26.709Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.10: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-09T17:08:18.962Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-declarative
- Homepage: https://github.com/apotonick/declarative
- Documentation: https://packages.debian.org/bookworm/ruby-declarative
- Licenses:
- Latest release: 0.0.10-2 (published 3 months ago)
- Last Synced: 2026-03-13T03:28:42.901Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- minitest >= 0 development
- minitest-line >= 0 development
- rake >= 0 development
- actions/checkout v4 composite
- ruby/setup-ruby v1 composite
Score: 26.367356664432453