{"id":19885688,"url":"https://github.com/asmod4n/mruby-linenoise","last_synced_at":"2025-03-01T03:47:17.131Z","repository":{"id":76216468,"uuid":"61238250","full_name":"Asmod4n/mruby-linenoise","owner":"Asmod4n","description":"mruby wrapper for https://github.com/antirez/linenoise, a line editing library","archived":false,"fork":false,"pushed_at":"2018-08-28T16:23:35.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T18:47:27.802Z","etag":null,"topics":["mruby","readline"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Asmod4n.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-15T20:19:37.000Z","updated_at":"2017-04-14T11:07:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3882c19-a19d-4257-8dae-fe6067b23e68","html_url":"https://github.com/Asmod4n/mruby-linenoise","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/Asmod4n%2Fmruby-linenoise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asmod4n%2Fmruby-linenoise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asmod4n%2Fmruby-linenoise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asmod4n%2Fmruby-linenoise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Asmod4n","download_url":"https://codeload.github.com/Asmod4n/mruby-linenoise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241313181,"owners_count":19942417,"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":["mruby","readline"],"created_at":"2024-11-12T17:35:18.487Z","updated_at":"2025-03-01T03:47:17.107Z","avatar_url":"https://github.com/Asmod4n.png","language":"C","readme":"# mruby-linenoise\nmruby wrapper for https://github.com/antirez/linenoise\n\n```ruby\nLinenoise.completion do |buf|\n  if buf[0] == 'h'\n    ['hello', 'hello there']\n    # you can also just return a String\n  end\nend\n\nLinenoise.hints do |buf|\n  if buf == \"hello\"\n    Linenoise::Hint.new(\" World\", 35, true) # this is a Struct with the folowing fields: to_str, color, bold\n    # you can also just return a String\n  end\nend\n\nbegin\nLinenoise::History.load('history.txt')\nrescue\nend\n\nwhile (line = linenoise(\"hallo\u003e \"))\n  unless line.empty?\n    puts \"echo: #{line}\"\n    Linenoise::History.add(line)\n    Linenoise::History.save(\"history.txt\")\n  end\nend\n```\n\nOther functions\n===============\n\n```ruby\nLinenoise.clear_screen # clears the screen\nLinenoise.multi_line= # enables or disables multi line mode\n\nLinenoise.print_key_codes # a special mode which shows key codes\n\nLinenoise::History.max_len= # changes the max lines the history keeps, defaults to 100\n```\n\nAcknowledgements\n================\n\nThis is using code from https://github.com/antirez/linenoise\n\nCopyright (c) 2010-2014, Salvatore Sanfilippo \u003cantirez at gmail dot com\u003e\nCopyright (c) 2010-2013, Pieter Noordhuis \u003cpcnoordhuis at gmail dot com\u003e\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmod4n%2Fmruby-linenoise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasmod4n%2Fmruby-linenoise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmod4n%2Fmruby-linenoise/lists"}