{"id":21519319,"url":"https://github.com/alexwayfer/example_file","last_synced_at":"2025-04-09T22:08:43.127Z","repository":{"id":39657655,"uuid":"254989799","full_name":"AlexWayfer/example_file","owner":"AlexWayfer","description":"Class helper for example files","archived":false,"fork":false,"pushed_at":"2025-04-04T12:46:11.000Z","size":131,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T22:08:37.304Z","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/AlexWayfer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-04-12T01:51:17.000Z","updated_at":"2024-04-22T19:41:59.000Z","dependencies_parsed_at":"2023-02-13T22:00:25.501Z","dependency_job_id":"d70f888e-4ffe-4fad-8070-c5f416703503","html_url":"https://github.com/AlexWayfer/example_file","commit_stats":{"total_commits":108,"total_committers":2,"mean_commits":54.0,"dds":0.4814814814814815,"last_synced_commit":"40f8c773179e89bf75c90a946be2a6f547e1fb9c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fexample_file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fexample_file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fexample_file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexWayfer%2Fexample_file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexWayfer","download_url":"https://codeload.github.com/AlexWayfer/example_file/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119294,"owners_count":21050755,"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-11-24T00:57:25.753Z","updated_at":"2025-04-09T22:08:43.104Z","avatar_url":"https://github.com/AlexWayfer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example File\n\n![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/example_file?style=flat-square)\n[![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/example_file/main.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/example_file)\n[![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/example_file.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/example_file)\n![Depfu](https://img.shields.io/depfu/AlexWayfer/example_file?style=flat-square)\n[![Inline docs](https://inch-ci.org/github/AlexWayfer/example_file.svg?branch=main)](https://inch-ci.org/github/AlexWayfer/example_file)\n[![Gem](https://img.shields.io/gem/v/example_file.svg?style=flat-square)](https://rubygems.org/gems/example_file)\n[![License](https://img.shields.io/github/license/AlexWayfer/example_file.svg?style=flat-square)](LICENSE.txt)\n\nClass helper for example files. Usually it's the alternative\nto environment variables (and `.env` files).\n\nYou can have git-controlled example files and git-ignored real files.\nFor example, configuration, especially with sensitive data.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'example_file'\n```\n\nAnd then execute:\n\n```shell\nbundle install\n```\n\nOr install it yourself as:\n\n```shell\ngem install example_file\n```\n\n## Usage\n\n```ruby\nrequire 'example_file'\n\nExampleFile.new('some_file.example.conf').actualize_regular_file\n```\n\nFor `some_file.example.conf` example file there is `some_file.conf`\nregular file.\n\nEditor below is `$EDITOR` environment variable.\nYou should set it to your preferred editor, console or GUI\n(console is more comfortable usually for such scenarios).\nOtherwise the whole program will be aborted with a message about this.\n\nIt'll act in these ways:\n\n*   If there is no regular file:\n    *   create it with content from example and open the editor.\n*   If there is example file with file modified time after regular file:\n    *   If there is no difference between their contents:\n        *   touch regular file for updating its modified time.\n    *   If there is a difference between their contents:\n        *   ask for a further action:\n            *   open the editor;\n            *   just update regular without changes;\n            *   replace regular file with a content from new example file;\n            *   or replace and then open the editor.\n*   If there is regular file with file modified time after example file:\n    *   do nothing.\n\nYou should add example files to git control:\n\n```shell\ngit add some_file.example.conf\n```\n\nAnd ignore regular ones in `.gitignore`:\n\n```gitignore\nsome_file.conf\n```\n\nRecursively it'd be like:\n\n```gitignore\nconfig/**/*\n!config/**/*.example*\n```\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies.\n\nThen, run `toys rspec` to run the tests.\n\nTo install this gem onto your local machine, run `toys gem install`.\n\nTo release a new version, run `toys gem release %version%`.\nSee how it works [here](https://github.com/AlexWayfer/gem_toys#release).\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/example_file).\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwayfer%2Fexample_file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexwayfer%2Fexample_file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwayfer%2Fexample_file/lists"}