{"id":17066288,"url":"https://github.com/kern/marble","last_synced_at":"2026-04-17T11:31:47.973Z","repository":{"id":56882756,"uuid":"1497649","full_name":"kern/marble","owner":"kern","description":"Ruby object builder","archived":false,"fork":false,"pushed_at":"2011-05-01T20:41:12.000Z","size":130,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-01-13T21:53:58.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/CapnKernul/marble","language":"Ruby","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/kern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-18T19:28:54.000Z","updated_at":"2014-02-04T17:54:52.000Z","dependencies_parsed_at":"2022-08-20T22:31:01.853Z","dependency_job_id":null,"html_url":"https://github.com/kern/marble","commit_stats":null,"previous_names":["capnkernul/marble"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kern/marble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kern%2Fmarble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kern%2Fmarble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kern%2Fmarble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kern%2Fmarble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kern","download_url":"https://codeload.github.com/kern/marble/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kern%2Fmarble/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31927713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:35:34.458Z","status":"ssl_error","status_checked_at":"2026-04-17T10:35:09.472Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T11:06:32.815Z","updated_at":"2026-04-17T11:31:47.956Z","avatar_url":"https://github.com/kern.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# marble [![StillMaintained Status](http://stillmaintained.com/CapnKernul/marble.png)](http://stillmaintained.com/CapnKernul/marble) [![Build Status](http://travis-ci.org/CapnKernul/marble.png)](http://travis-ci.org/CapnKernul/marble) #\n\nMarble is a Ruby object builder. It makes generating complex Ruby objects, and\nby extension JSON and YAML, much more readable. It's especially useful for Rails\nJSON API templates.\n\n## Installation ##\n\nMarble works both with and without Rails. Installation is as simple as adding\nthis line to your `Gemfile`:\n\n    gem 'marble'\n\nIf you'd like to use marble without bundler, you can also directly install the\ngem:\n\n    gem install marble\n\n## Usage ##\n\nFirst, require marble and create a builder.\n\n    require 'marble'\n    builder = Marble.new\n\nThis builder can build any Ruby object using the `#build` method. The yielded\nvalue is the current builder:\n\n    builder.build do |m|\n      ['foo']\n    end # =\u003e ['foo']\n\nHowever, this isn't very useful. The `#array` and `#hash` methods are far more\ninteresting. They allow you to build complex arrays and hashes in a minimal\namount of lines:\n\n    builder.array do |m|\n      m.item 'foo'\n    end # =\u003e ['foo']\n    \n    builder.hash do |m|\n      m.foo 'bar'\n    end # =\u003e { 'foo' =\u003e 'bar' }\n\nThe returned value can be converted to JSON and YAML, giving you a really\nconcise way of creating JSON and YAML templates for API's.\n\nSee the `Marble` documentation for more details.\n\n## Usage with Rails ##\n\nMarble provides a template handler for Rails. It supports object literal, JSON,\nand YAML output formats. Name your view template with the extension `marble`.\nThe template creates a builder with the name `marble` for you to use. You can\nrename it using the block parameter. For example, in order to generate a JSON\nview:\n\n    # view_name.json.marble\n    marble.hash do |m|\n      m.foo 'bar'\n    end\n    \n    # Renders: {\"foo\": \"bar\"}\n\nSee the `Marble::RailsTemplateHandler` documentation for more details.\n\n## Note on Patches/Pull Requests ##\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a future version unintentionally.\n* Commit, but do not mess with the `Rakefile`. If you want to have your own version, that is fine but bump the version in a commit by itself in another branch so I can ignore it when I pull.\n* Send me a pull request. Bonus points for git flow feature branches.\n\n## Resources ##\n\n* [GitHub Repository](https://github.com/CapnKernul/marble)\n* [Documentation](http://rubydoc.info/github/CapnKernul/marble)\n\n## License ##\n\nMarble is licensed under the MIT License. See `LICENSE` for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkern%2Fmarble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkern%2Fmarble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkern%2Fmarble/lists"}