{"id":23498212,"url":"https://github.com/sonota88/mrtable","last_synced_at":"2025-04-22T23:24:43.723Z","repository":{"id":56884689,"uuid":"106705249","full_name":"sonota88/mrtable","owner":"sonota88","description":"Mrtable implementation for Ruby","archived":false,"fork":false,"pushed_at":"2019-04-14T22:32:36.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T02:17:11.560Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","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/sonota88.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-10-12T14:41:41.000Z","updated_at":"2021-02-02T07:26:29.000Z","dependencies_parsed_at":"2022-08-20T23:40:59.888Z","dependency_job_id":null,"html_url":"https://github.com/sonota88/mrtable","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonota88%2Fmrtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonota88%2Fmrtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonota88%2Fmrtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonota88%2Fmrtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonota88","download_url":"https://codeload.github.com/sonota88/mrtable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250338882,"owners_count":21414263,"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":["ruby"],"created_at":"2024-12-25T05:29:07.396Z","updated_at":"2025-04-22T23:24:43.706Z","avatar_url":"https://github.com/sonota88.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mrtable\n\nMachine readable table.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mrtable'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mrtable\n\n## Example\n\n```ruby\nrequire 'pp'\nrequire 'mrtable'\n\nmrtable_text = \u003c\u003c'EOB'\n| c1  | c2  | c3  | c4  |\n| --- | --- | --- | --- |\n| \"123\" | \"abc\" | \"日本語\" |    |\n|  123  |  abc  |  日本語  |    |\n| \"\" | \" \" | \"  \" |  |\n| \"\\\\\\t\\r\\n\\\"\" |  |  |  |\n|  \\\\\\t\\r\\n\\\"  |  |  |  |\n| \"a\" | \" a\" | \"a \" | \" a \" |\n|  a  |   a  |  a   |   a   |\n| \"\\|\" | \"1 \\| 2\" |  |  |\n|  \\|  |  1 \\| 2  |  |  |\n| \"null\" | \"NULL\" |  |  |\n|  null  |  NULL  |  |  |\nEOB\n\nheader, rows = Mrtable.parse(mrtable_text)\npp header, rows\n\n=begin\n\n[\"c1\", \"c2\", \"c3\", \"c4\"]\n[[\"123\", \"abc\", \"日本語\", nil],\n [\"123\", \"abc\", \"日本語\", nil],\n [\"\", \" \", \"  \", nil],\n [\"\\\\\\t\\r\\n\" + \"\\\"\", nil, nil, nil],\n [\"\\\\\\t\\r\\n\" + \"\\\"\", nil, nil, nil],\n [\"a\", \" a\", \"a \", \" a \"],\n [\"a\", \"a\", \"a\", \"a\"],\n [\"|\", \"1 | 2\", nil, nil],\n [\"|\", \"1 | 2\", nil, nil],\n [\"null\", \"NULL\", nil, nil],\n [\"null\", \"NULL\", nil, nil]]\n\n=end\n\nputs Mrtable.generate(header, rows)\n\n=begin\n\n| c1         | c2     | c3     | c4    |\n| ---------- | ------ | ------ | ----- |\n|        123 | abc    | 日本語 |       |\n|        123 | abc    | 日本語 |       |\n| \"\"         | \" \"    | \"  \"   |       |\n| \\\\\\t\\r\\n\\\" |        |        |       |\n| \\\\\\t\\r\\n\\\" |        |        |       |\n| a          | \" a\"   | \"a \"   | \" a \" |\n| a          | a      | a      | a     |\n| \\|         | 1 \\| 2 |        |       |\n| \\|         | 1 \\| 2 |        |       |\n| null       | NULL   |        |       |\n| null       | NULL   |        |       |\n\n=end\n```\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonota88%2Fmrtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonota88%2Fmrtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonota88%2Fmrtable/lists"}