{"id":17003821,"url":"https://github.com/cldwalker/ripl-commands","last_synced_at":"2025-04-12T06:33:52.647Z","repository":{"id":1188568,"uuid":"1091810","full_name":"cldwalker/ripl-commands","owner":"cldwalker","description":"This ripl plugin adds commands to ripl that are similar to irb's","archived":false,"fork":false,"pushed_at":"2013-01-24T05:47:09.000Z","size":519,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-22T04:18:11.522Z","etag":null,"topics":[],"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/cldwalker.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-18T14:52:24.000Z","updated_at":"2013-12-06T08:14:20.000Z","dependencies_parsed_at":"2022-08-16T12:30:52.383Z","dependency_job_id":null,"html_url":"https://github.com/cldwalker/ripl-commands","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/cldwalker%2Fripl-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Fripl-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Fripl-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Fripl-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cldwalker","download_url":"https://codeload.github.com/cldwalker/ripl-commands/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219848662,"owners_count":16556332,"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-10-14T04:32:48.159Z","updated_at":"2024-10-14T04:32:48.616Z","avatar_url":"https://github.com/cldwalker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"== Description\nThis ripl plugin provides a core group of commands for any ripl shell. It aims to\nmatch and surpass functionality in {irb's commands}[http://tagaholic.me/2009/05/11/demystifying-irb-commands.html]. \n\n== Install\nInstall the gem with:\n\n    sudo gem install ripl-commands\n\n== Usage\n\nAdd to your ~/.riplrc\n\n    require 'ripl/commands'\n\nTry it out:\n\n    $ ripl\n\n    # set any ripl config dynamically\n    \u003e\u003e config :prompt, lambda { \"ripl(main):\" + Ripl.shell.line.to_s + \"\u003e \" }\n    =\u003e #\u003cProc:0x0063e2f0@(ripl):1\u003e\n    ripl(main):2\u003e  config :result_prompt, '\u003c\u003e '\n    \u003c\u003e \"\u003c\u003e \"\n\n    # Autocomplete available config keys\n    \u003e\u003e config :[TAB]\n    :binding  :color_error  :multi_line_prompt  :name  :prompt :result_prompt\n\n    # Jump around in different objects as irb does with subsessions and workspaces\n    \u003e\u003e jump 'dude'\n    =\u003e 'dude'\n    \u003e\u003e self\n    =\u003e 'dude'\n    # Autocomplet for the new current object\n    \u003e\u003e cap[TAB]\n    capitalize   capitalize!\n    \u003e\u003e capitalize\n    =\u003e 'Dude'\n\n    # To see where you've jumped\n    \u003e\u003e jumps\n    =\u003e [main, 'dude']\n\n    # Jumping to a number translates to jumping to an existing jump\n    \u003e\u003e jump 0\n    =\u003e main\n\n    # To list what commands ripl has\n    \u003e\u003e list\n    =\u003e [\"list\", \"config\", \"history\", \"editor\", \"jumps\", \"jump\"]\n\nThis plugin also comes with commands to see history and prototype code easily in an editor:\n\n    # Display last 10 inputs\n    \u003e\u003e history 10\n    10 : class Porque; def no; 'porque'; end; end\n    9 : Porque.no\n    8 : Porque.no\n    7: %w{can you -dig -this sir?}.inject([]) do |arr, e|\n    6: if e[/^-/] .. e[/^[^-]/]\n    5: break(arr) if e[/^[^-]/]\n    4: arr \u003c\u003c e\n    3: end\n    2: arr\n    1: end\n    =\u003e ...\n\n    # Edit last 7 inputs in an editor (specified by ENV['EDITOR']) and eval the edited text\n    \u003e\u003e editor 7\n    ....\n    =\u003e ['dig', '-this']\n\n    # If a previous edit exists, opens it in an editor, otherwise opens a new file\n    \u003e\u003e editor\n\n== Extending Commands\n\nExtending commands is done by including a module into Ripl::Commands. Say we wanted to extend jumps\nto look nicer:\n\n    # In ~/.riplrc\n    require 'ripl/commands'\n    module Ripl::Commands::NicerJump\n      def jumps\n        super.each_with_index {|e,i| puts \"#{i}: #{e.inspect}\" }\n      end\n    end\n    Ripl::Commands.send :include, Ripl::Commands::NicerJump\n\nThe above jump session then looks like:\n\n    \u003e\u003e jumps\n    0: main\n    1: \"dude\"\n\n== Credits\n* janlelis for bug fix\n* postmodern for command tweaks\n\n== Contributing\n{See here}[http://tagaholic.me/contributing.html]\n\n== Todo\n* Add exit for a jump\n* Fix stacktrace interference caused by jumps\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldwalker%2Fripl-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldwalker%2Fripl-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldwalker%2Fripl-commands/lists"}