{"id":13880248,"url":"https://github.com/jdan/rubycards","last_synced_at":"2025-04-07T06:07:07.570Z","repository":{"id":8133848,"uuid":"9551612","full_name":"jdan/rubycards","owner":"jdan","description":"Ruby playing cards library","archived":false,"fork":false,"pushed_at":"2016-03-13T22:58:15.000Z","size":469,"stargazers_count":147,"open_issues_count":2,"forks_count":23,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T04:07:35.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rubydoc.info/github/jdan/rubycards/master/frames","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/jdan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-19T18:17:05.000Z","updated_at":"2025-02-01T16:55:47.000Z","dependencies_parsed_at":"2022-08-21T01:50:16.061Z","dependency_job_id":null,"html_url":"https://github.com/jdan/rubycards","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Frubycards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Frubycards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Frubycards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Frubycards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdan","download_url":"https://codeload.github.com/jdan/rubycards/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"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":[],"created_at":"2024-08-06T08:02:53.600Z","updated_at":"2025-04-07T06:07:07.548Z","avatar_url":"https://github.com/jdan.png","language":"Ruby","readme":"# Rubycards\n\n[![Build Status](https://travis-ci.org/jdan/rubycards.png)](https://travis-ci.org/jdan/rubycards) [![Coverage Status](https://coveralls.io/repos/prezjordan/rubycards/badge.png?branch=master)](https://coveralls.io/r/prezjordan/rubycards)\n\nRubycards is a library to emulate playing cards (cards, hands, decks). As an added bonus, you can display the cards as tiny pictures. I'm mainly doing this as an exercise to learn better Ruby organization, as well as documentation and testing. More importantly it's just fun.\n\n**See the extended documentation**: [http://rubydoc.info/github/jdan/rubycards](http://rubydoc.info/github/jdan/rubycards/master/frames)\n\n![rubycards](https://i.cloudup.com/mlUF8NxTxC-3000x3000.png)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'rubycards'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rubycards\n\n## Example\n\nHere's a trivial example of declaring a new deck, shuffling, and drawing 5 cards into a hand:\n\n```ruby\nrequire 'rubycards'\ninclude RubyCards\n\nhand = Hand.new\ndeck = Deck.new\n\ndeck.shuffle!\n\nhand.draw(deck, 5)\n\nputs hand\n```\n\nWhich produces the image at the top of this README.\n\nHere's a second example showing 2 decks, with the 2 and Jacks removed, shuffling, and drawing 10 cards into a hand:\n\n```ruby\nrequire 'rubycards'\ninclude RubyCards\n\nhand = Hand.new\ndeck = Deck.new(number_decks: 2, exclude_rank: [2, 'Jack'])\n\ndeck.shuffle!\n\nhand.draw(deck, 10)\n\nputs hand\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Frubycards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdan%2Frubycards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Frubycards/lists"}