{"id":20081925,"url":"https://github.com/eval/lemme-pry","last_synced_at":"2025-03-02T13:41:42.970Z","repository":{"id":66250940,"uuid":"86564354","full_name":"eval/lemme-pry","owner":"eval","description":"(mirror) Start a pry-session with specific gems or a (remote) script loaded. ","archived":false,"fork":false,"pushed_at":"2017-06-19T10:42:37.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T01:44:30.477Z","etag":null,"topics":["pry","repl","ruby"],"latest_commit_sha":null,"homepage":"https://gitlab.com/eval/lemme-pry/blob/master/README.md#lemme-pry","language":"Ruby","has_issues":false,"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/eval.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-03-29T09:37:54.000Z","updated_at":"2019-08-06T21:21:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"f45c2de7-7d63-4ee7-828c-580507594a6a","html_url":"https://github.com/eval/lemme-pry","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Flemme-pry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Flemme-pry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Flemme-pry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eval%2Flemme-pry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eval","download_url":"https://codeload.github.com/eval/lemme-pry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241515953,"owners_count":19975140,"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":["pry","repl","ruby"],"created_at":"2024-11-13T15:40:56.234Z","updated_at":"2025-03-02T13:41:42.952Z","avatar_url":"https://github.com/eval.png","language":"Ruby","readme":"# lemme-pry\n\nStart a pry-session with specific gems or a (remote) script preloaded.  \nFor the idea behind this gem see [this blogpost](https://www.gertgoet.com/2017/06/12/lemme-pry.html).\n\n## Usage\n\nThis gem allows you to get a pry-session with either...\n\n1. gems preloaded\n2. a script preloaded\n\n### pry-session with gems pre-loaded\n\nThis requires lemme-pry to be [installed system-wide](#system-wide).\n\n```bash\n# to get the latest version of ActiveSupport\n$ lemme-pry activesupport\nFetching gem metadata from https://rubygems.org/.........\nFetching version metadata from https://rubygems.org/.\nResolving dependencies...\nUsing concurrent-ruby 1.0.5\nUsing i18n 0.8.1\nUsing minitest 5.10.1\nUsing thread_safe 0.3.6\nUsing coderay 1.1.1\nUsing method_source 0.8.2\nUsing slop 3.6.0\nUsing bundler 1.14.5\nUsing tzinfo 1.2.2\nUsing pry 0.10.4\nUsing activesupport 5.0.2\n[2] pry(main)\u003e 1.second\n=\u003e 1 second\n```\n    \nUse a specific version:\n\n```bash\n# any version notation that is accepted in a Gemfile will work \n$ lemme-pry activesupport '~\u003e 4.2'\n...\n[2] pry(main)\u003e\n```\n        \nMultiple gems:\n    \n```bash\n$ lemme-pry activesupport '~\u003e 4.2' redis\n...\n[2] pry(main)\u003e\n```\n\n### pry-session with script preloaded\n\nAnything piped to lemme-pry will be evaluated before the pry-session starts:\n\n```bash\n$ echo '@a = 1' | lemme-pry\n[1] pry(main)\u003e @a\n=\u003e 1\n```\n\n```bash\n# handy when sharing code with others:\n$ curl https://gist.githubusercontent.com/eval/76955c57512c1e4ac01cdd913b76c92d/raw/bf714a15789eca3e968c3544f85b9b786b8eae8f/hello.rb | lemme-pry\n\n# or via the gist command:\n$ gist -r 76955c57512c1e4ac01cdd913b76c92d | lemme-pry\n```\n    \n**NOTE:** curl-pipe-runtime is [not without risk](https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/). A tool like [vipe](https://github.com/madx/moreutils/blob/master/vipe) ([npm variant](https://github.com/juliangruber/vipe#vipe)) allows you to inspect the fetched script before handing it over to lemme-pry.\n\n#### within a (Rails-)project\n\nWhen the script needs to be evaluated within a project (i.e. use the gems of your project), make sure lemme-pry is [part of your project](#within-project).\n\nA script for a Rails project would typically look like this:\n\n```ruby\n# script.rb\nrequire './config/environment' # load Rails-application\n@user = User.first\n```\n\nEvaluate via:\n```\ncat script.rb | bundle exec lemme-pry\n...\n[1] pry(main)\u003e @user\n#\u003cUser id: 1, username: ...\n```\n\n## Installation\n\n### System-wide\n\n```bash\n$ gem install lemme-pry\n```\n\n### Within project\n\nAdd the following to `Gemfile`:\n    \n```ruby\n# Gemfile\ngem 'lemme-pry', group: :development\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\nThen run the tool via:\n\n```\n$ ruby -Ilib exe/lemme-pry activesupport\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\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feval%2Flemme-pry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feval%2Flemme-pry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feval%2Flemme-pry/lists"}