{"id":17791796,"url":"https://github.com/movitto/reterm","last_synced_at":"2025-03-16T16:31:34.323Z","repository":{"id":56892083,"uuid":"114305171","full_name":"movitto/reterm","owner":"movitto","description":"Ruby Enhanced Terminal","archived":false,"fork":false,"pushed_at":"2018-11-29T23:25:15.000Z","size":4270,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-29T10:20:31.678Z","etag":null,"topics":["interface","ncurses","ruby","terminal"],"latest_commit_sha":null,"homepage":null,"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/movitto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-14T23:14:00.000Z","updated_at":"2020-11-22T15:08:50.000Z","dependencies_parsed_at":"2022-08-21T01:20:13.383Z","dependency_job_id":null,"html_url":"https://github.com/movitto/reterm","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movitto%2Freterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movitto%2Freterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movitto%2Freterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movitto%2Freterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/movitto","download_url":"https://codeload.github.com/movitto/reterm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822293,"owners_count":20353499,"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":["interface","ncurses","ruby","terminal"],"created_at":"2024-10-27T10:55:53.060Z","updated_at":"2025-03-16T16:31:33.854Z","avatar_url":"https://github.com/movitto.png","language":"Ruby","readme":"# RETerm - Ruby Enhanced Terminal\n\nRETerm is a Text Based User Interface Framework built ontop of [ncurses](https://en.wikipedia.org/wiki/Ncurses)\n\n## Worth a thousand words...\n\n![Screenshot1](examples/sc1.gif)\n\n## Installation\n\nRETerm depends on the **ncursesw** rubygem, which in return depends on the '[ncursesw](https://www.gnu.org/software/ncurses/)' and terminfo libraries. These must be available for use locally via on means or another. Most Operating Systems and distributions have a binary / bundled version available, read the ncurses documentation for more information. The following packages should suffice to install on Linux:\n\n```\n  $ dnf install ruby-devel ncurses-devel (Fedora/RedHat)\n\n  $ apt-get install ruby-dev libncursesw5-dev libncurses5-dev libtinfo-dev (Ubuntu)\n```\n\nTo install the core RETerm framework and components, simply run:\n\n```\n  $ gem install reterm\n```\n\n## Optional Components\n\nRETerm ships with components that depend on additional gem dependencies. These features are completely optional and will not be required unless the corresponding components are\ninstantiated. To install all optional RETerm dependencies run:\n\n```\n  $ gem install artii drawille chunky_png cdk\n```\n\n## Usage\n\nSee the **examples/** directory for demos of many common components.\n\nThe following will instantiate a simple \"Hello World\" interface:\n\n```ruby\nrequire 'reterm'\ninclude RETerm\n\ninit_reterm {\n  win = Window.new :rows =\u003e 10,\n                   :cols =\u003e 30\n  win.border!\n  update_reterm\n\n  label = Components::Label.new :text =\u003e \"Hello world\"\n  win.component = label\n  label.draw!\n\n  sleep(3)\n}\n```\n\nFor something more interesting, create and activate layout and components. After\nwe are done, reading the user input is a cinch!\n\n```ruby\nresults = {}\n\ninit_reterm {\n  ColorPair.register :green, :black, :main\n\n  win = Window.new\n  win.colors = :main\n  win.border!\n\n  layout1 = Layouts::Horizontal.new\n  win.component = layout1\n\n  child1 = layout1.add_child :rows =\u003e 3,\n                             :cols =\u003e 20\n\n  dial = Components::Dial.new\n  child1.component = dial\n\n  child2 = layout1.add_child :rows =\u003e 15,\n                             :cols =\u003e 40\n\n  entry = Components::Entry.new :title =\u003e \"Enter: \", :label =\u003e \"Text:\"\n  child2.component = entry\n\n  ###\n\n  win.activate!\n\n  results[:dial]   = dial.value\n  results[:entry]  = entry.value\n}\n\nputs \"Input results: \"\nputs results\n```\n\nHow about a generic JSON schema representing a terminal interface?\n\n```json\n{\n  \"window\" : {\n    \"rows\"      : 10,\n    \"cols\"      : 50,\n    \"border\"    : true,\n    \"component\" : {\n      \"type\" : \"Entry\",\n      \"init\" : {\n        \"title\" : \"\u003cC\u003eDemo\",\n        \"label\" : \"Enter Text: \"\n      }\n    }\n  }\n}\n```\n\nAnd here's how to load it:\n\n```ruby\ninit_reterm {\n  load_reterm(File.read('path/to/schema.json')).activate!\n}\n```\n\n## Documentation\n\nFull reference documentation is available via [yard](http://www.rubydoc.info/gems/reterm)\n\n## Legaleese\n\nCopyright (C) 2017 Mo Morsi \u003cmo@morsi.org\u003e\n\nDistributed under the MIT licesnse\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovitto%2Freterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmovitto%2Freterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovitto%2Freterm/lists"}