{"id":18103127,"url":"https://github.com/janlelis/ripl-multi_line","last_synced_at":"2025-04-13T19:01:32.258Z","repository":{"id":1170820,"uuid":"1064789","full_name":"janlelis/ripl-multi_line","owner":"janlelis","description":"This ripl plugin allows you to evaluate multiple lines of code.","archived":false,"fork":false,"pushed_at":"2013-04-23T12:02:19.000Z","size":1240,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T09:45:36.246Z","etag":null,"topics":["ripl","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/janlelis.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGELOG.rdoc","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":"2010-11-09T11:19:16.000Z","updated_at":"2016-12-21T10:54:04.000Z","dependencies_parsed_at":"2022-08-16T12:25:13.892Z","dependency_job_id":null,"html_url":"https://github.com/janlelis/ripl-multi_line","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fripl-multi_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fripl-multi_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fripl-multi_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlelis%2Fripl-multi_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janlelis","download_url":"https://codeload.github.com/janlelis/ripl-multi_line/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248348486,"owners_count":21088870,"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":["ripl","ruby"],"created_at":"2024-10-31T22:10:24.459Z","updated_at":"2025-04-13T19:01:32.214Z","avatar_url":"https://github.com/janlelis.png","language":"Ruby","readme":"== ripl-multi_line {\u003cimg src=\"https://travis-ci.org/janlelis/ripl-multi_line.png\" /\u003e}[https://travis-ci.org/janlelis/ripl-multi_line]\nThis {ripl}[https://github.com/cldwalker/ripl] plugin allows you to evaluate multiple lines of Ruby code.\n\n== Install\nInstall the gem with\n\n  gem install ripl-multi_line\n\n== Usage\nAdd the following line to your \u003ctt\u003e~/.riplrc\u003c/tt\u003e\n\n  require 'ripl/multi_line'\n\n\u003cb\u003eHint:\u003c/b\u003e In multi-line situations, you can press \u003ctt\u003ectrl+c\u003c/tt\u003e and the last line will be removed.\n\n== Options\nYou can customize your multi-line prompt with the \u003ctt\u003e:multi_line_prompt\u003c/tt\u003e option. For example, put this into your \u003ctt\u003e~/.riplrc\u003c/tt\u003e:\n\n  Ripl.config[:multi_line_prompt] = ' \u003e '\n\nIt also takes a proc as value.\n\nThen there is the \u003ctt\u003e:multi_line_history\u003c/tt\u003e option. The default value is \u003ctt\u003e:compact\u003c/tt\u003e which tries to squeeze your last multi-line block into one line (works best in mri, in about 98% of all cases).\n\n  \u003e\u003e def some_multi_line_block\n  |    42\n  |  end #=\u003e nil\n  # Press \u003cUP\u003e\n  \u003e\u003e def some_multi_line_block; 42; end\n\nAnother value is \u003ctt\u003e:block\u003c/tt\u003e, which joins the multi-line block with new-lines.\n\nTo leave the history untouched, set it to \u003ctt\u003e:plain\u003c/tt\u003e or a false value.\n\n== AutoIndent\nCheck out the {ripl-auto_indent}[https://github.com/janlelis/ripl-auto_indent] plugin to get ruby syntax indention.\n\n== MultiLine detection\nTo use your own multi-line detection engine, implement your version at \u003ctt\u003elib/ripl/multi_line/your_correct_detection.rb\u003c/tt\u003e in which you overwrite \u003ctt\u003eShell#multiline?\u003c/tt\u003e in a \u003ctt\u003eRipl::MultiLine\u003c/tt\u003e sub-module named \u003ctt\u003eYourCorrectDetection\u003c/tt\u003e and set \u003ctt\u003eRipl.config[:multi_line_engine]\u003c/tt\u003e to \u003ctt\u003e:your_correct_detection\u003c/tt\u003e. See \u003ctt\u003elib/ripl/multi_line/*.rb\u003c/tt\u003e for examples.\n\nCurrently available engines:\n* \u003ctt\u003e:live_error\u003c/tt\u003e (\u003cb\u003edefault\u003c/b\u003e) - Simply evaluate expression, if it throws a multi-line syntax error, fall back to multi-line input mode. Sounds scary, but works pretty well in practice.\n* \u003ctt\u003e:error_check\u003c/tt\u003e - Same principle as :live_error, but don't do it live\n* \u003ctt\u003e:ripper\u003c/tt\u003e - Analyze input with Ripper (comes with 1.9, but there is also a 1.8 gem).\n* \u003ctt\u003e:ruby_parser\u003c/tt\u003e - Use ruby_parser gem (1.8 only)\n* \u003ctt\u003e:irb\u003c/tt\u003e - You left irb, but you are still used to its multi-line behaviour? Use irb's RubyLex!\n\nNone of the above solutions is perfect, so... maybe it's time to roll your own ;)\n\n== Troubleshooting\n\u003ci\u003eProblem:\u003c/i\u003e \"I've required \u003ctt\u003eripl-multi_line\u003c/tt\u003e, but it doesn't work\"\n\n\u003ci\u003eAnswer:\u003c/i\u003e This is probably caused by a plugin, which overwrites \u003ctt\u003e:before_loop\u003c/tt\u003e, but does not call \u003ctt\u003esuper\u003c/tt\u003e (or you are using ripl-profiles older than 0.2.0). You can manually work around this issue with this snippet (but you should fix the general problem):\n\n  require 'ripl/multi_line/live_error.rb'\n  Ripl::MultiLine.engine = Ripl::MultiLine::LiveError\n  Ripl::Shell.include Ripl::MultiLine.engine\n\n== TODO\n* Write thousands of test cases\n\n== J-_-L\nContributions \u0026 influences by cldwalker and godfat.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlelis%2Fripl-multi_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanlelis%2Fripl-multi_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlelis%2Fripl-multi_line/lists"}