{"id":16445767,"url":"https://github.com/mslinn/insert_after","last_synced_at":"2026-02-06T20:02:24.715Z","repository":{"id":206535577,"uuid":"717113546","full_name":"mslinn/insert_after","owner":"mslinn","description":"Inserts a line into a file after a line matching a regular expression.","archived":false,"fork":false,"pushed_at":"2024-12-21T16:21:21.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T21:51:53.663Z","etag":null,"topics":["bash","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/insert_after","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/mslinn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-11-10T15:32:22.000Z","updated_at":"2024-12-21T16:21:25.000Z","dependencies_parsed_at":"2024-11-11T05:42:21.193Z","dependency_job_id":"9a79f774-6984-4257-871f-24f50085f612","html_url":"https://github.com/mslinn/insert_after","commit_stats":null,"previous_names":["mslinn/insert_after"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mslinn/insert_after","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Finsert_after","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Finsert_after/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Finsert_after/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Finsert_after/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mslinn","download_url":"https://codeload.github.com/mslinn/insert_after/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Finsert_after/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29174332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T19:56:27.068Z","status":"ssl_error","status_checked_at":"2026-02-06T19:56:18.934Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bash","ruby"],"created_at":"2024-10-11T09:45:21.924Z","updated_at":"2026-02-06T20:02:24.696Z","avatar_url":"https://github.com/mslinn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Insert_after` [![Gem Version](https://badge.fury.io/rb/insert_after.svg)](https://badge.fury.io/rb/insert_after)\n\nInserts a line into a file after a line matching a regular expression.\nString comparisons are case-insensitive.\nWorks on very large files because it reads the file line by line instead of reading the entire file into memory.\n\nCan be used on the command line or in a Ruby program.\n\n\n## Command-line Installation\n\n```ruby\n$ gem install insert_after\n```\n\n\n## Installation For Use In a Ruby Program\n\nEither add this line to your application\u0026rsquo;s `Gemfile`:\n\n```ruby\ngem 'insert_after'\n```\n\n... or add the following to your application\u0026rsquo;s `.gemspec`:\n\n```ruby\nspec.add_dependency 'insert_after'\n```\n\nAnd then execute:\n\n```shell\n$ bundle\n```\n\n\n## Command-line Usage\n\n```shell\n# Inserts 'Inserted 1' after the first line containing 'line' into demo/my_file.txt:\n$ insert_after line 'Inserted 1' demo/my_file.txt\n\n# Inserts 'Inserted 1' after every line containing 'line' into demo/my_file.txt:\n$ insert_after -a line 'Inserted 1' demo/my_file.txt\n\n# Inserts an empty line after the first line containing 'line 1' into demo/my_file.txt:\n$ insert_after 'line 1' '' demo/my_file.txt\n\n# Inserts an empty line after every line containing 'line 1' into demo/my_file.txt:\n$ insert_after -a 'line 1' '' demo/my_file.txt\n\n# Inserts 'Inserted 2' after the first line starting with 'line 2' into demo/my_file.txt:\n$ insert_after '^line 2' 'Inserted 2' demo/my_file.txt\n\n# Inserts 'Inserted 2' after every line starting with 'line 2' into demo/my_file.txt:\n$ insert_after -a '^line 2' 'Inserted 2' demo/my_file.txt\n\n# Inserts 'Inserted 3' after the first line containing an 'e' followed by a '2' into demo/my_file.txt:\n$ insert_after 'e.*2' 'Inserted 3' demo/my_file.txt\n\n# Inserts 'Inserted 3' after every line containing an 'e' followed by a '2' into demo/my_file.txt:\n$ insert_after -a 'e.*2' 'Inserted 3' demo/my_file.txt\n```\n\n\n## Ruby Program Usage\n\nThe `demo/demo.rb` program is an example of how to use `insert_after` in a Ruby program:\n\n```ruby\nrequire 'insert_after'\n\nInsertAfer.insert_after  'line 2', 'New line',               'my_file.txt'\nInsertAfter.insert_after 'line',   'Another line from Ruby', 'my_file.txt', all: true\n```\n\n\n## Development\n\nAfter checking out this git repository, install dependencies by typing:\n\n```shell\n$ bin/setup\n```\n\nYou should do the above before running Visual Studio Code.\n\n\n### Run the Tests\n\n```shell\n$ bundle exec rspec\n```\n\n\n### Interactive Session\n\nThe following will allow you to experiment:\n\n```shell\n$ bin/console\n```\n\n\n### Local Installation\n\nTo install this gem onto your local machine, type:\n\n```shell\n$ bundle exec rake install\n```\n\n\n### To Release A New Version\n\nTo create a git tag for the new version, push git commits and tags,\nand push the new version of the gem to https://rubygems.org, type:\n\n```shell\n$ bundle exec rake release\n```\n\n\n## Contributing\n\nBug reports and pull requests are welcome at https://github.com/mslinn/insert_after.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslinn%2Finsert_after","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmslinn%2Finsert_after","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslinn%2Finsert_after/lists"}