{"id":16747031,"url":"https://github.com/selfup/pryman","last_synced_at":"2025-10-26T07:06:05.476Z","repository":{"id":34557549,"uuid":"38502829","full_name":"selfup/pryman","owner":"selfup","description":"A way to snapshot and save a pry session.","archived":false,"fork":false,"pushed_at":"2015-12-06T07:25:21.000Z","size":11,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T14:44:46.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selfup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-03T17:02:02.000Z","updated_at":"2017-10-20T20:25:58.000Z","dependencies_parsed_at":"2022-09-08T15:00:55.055Z","dependency_job_id":null,"html_url":"https://github.com/selfup/pryman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/selfup/pryman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fpryman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fpryman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fpryman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fpryman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfup","download_url":"https://codeload.github.com/selfup/pryman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfup%2Fpryman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281069677,"owners_count":26438676,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T02:08:55.695Z","updated_at":"2025-10-26T07:06:05.459Z","avatar_url":"https://github.com/selfup.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pryman\nA way to save a snapshot of a pry session.\n\n# How it works\n\nPaste this into your **\".pryrc\"** file:\n\n```ruby\nPry::Commands.block_command \"batman\", \"Save the session\" do |filename|\n  filename ||= \"batman.rb\"\n  filename = Pathname.new filename\n\n  while File.exist? filename\n    no_ext      = filename.basename.sub_ext('').to_s\n    counter     = no_ext[/\\d+$/].to_i.next\n    incremented = Pathname.new(no_ext.sub /\\d*$/, counter.to_s)\n    filename    = filename.dirname + incremented.sub_ext(filename.extname)\n  end\n\n  inout = _pry_.input_array.to_a.zip(_pry_.output_array.to_a)\n  body  = inout.map { |input, output|\n    inspected_output = output.inspect.gsub(/^/, '  # ')\n    \"#{input}#{inspected_output}\"\n  }.join(\"\\n\")\n  File.write(filename, body)\nend\n```\n\n**1)** Say you are learning a new concept and testing it out in pry, but you want to save it to a **\".rb\"** file.\n\n**2)** Now you just type in (while in pry):\n\n    $ batman\n\nIt will write a file called **\"batman.rb\"\"**.\n\n**3)** If you run **\"batman\"** again, it will add **\"1\"** to **\"batman\"**. \n\nSo **\"batman1.rb\"**.\n\n**4)** If you call: \n\n    $ batman lol.rb\n\nIt will now make a file called **\"lol.rb\"** instead of \"batman.rb\"\n\n**5)** It will save the new file to your CURRENT WORKING directory.\n\n----------------------------------------------------------------------------------------\n\n\n#### Many Thanks to Josh Cheek from Turing for helping me out.\n\nCheck out his work: @JoshCheek\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfup%2Fpryman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfup%2Fpryman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfup%2Fpryman/lists"}