{"id":16079220,"url":"https://github.com/pat/inkan","last_synced_at":"2025-09-17T16:32:43.181Z","repository":{"id":66006506,"uuid":"1079286","full_name":"pat/inkan","owner":"pat","description":"Unique file markers for tracking whether files have been changed.","archived":false,"fork":false,"pushed_at":"2024-03-02T00:08:05.000Z","size":21,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T19:29:41.250Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pat.png","metadata":{"files":{"readme":"README.textile","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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2010-11-14T08:22:18.000Z","updated_at":"2024-05-30T06:10:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd4efd5d-187a-4744-b4e9-054460cf7345","html_url":"https://github.com/pat/inkan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat%2Finkan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat%2Finkan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat%2Finkan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pat%2Finkan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pat","download_url":"https://codeload.github.com/pat/inkan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233408231,"owners_count":18671814,"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-09T10:41:28.698Z","updated_at":"2025-09-17T16:32:37.882Z","avatar_url":"https://github.com/pat.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. inkan\n\nInspired by coming features for \"Ben Hoskings'\":http://benhoskin.gs/ \"Babushka\":http://babushka.me/, *inkan* is a library for writing out (generated) files and then checking whether they've had (manual) changes made to them.\n\nThis is particularly useful for generating configuration files and then wanting to check whether people have edited it before overwriting, but you may find other uses for it.\n\nAll it actually does is generate a SHA hash of the file's contents, and adds it as a comment at the top of the file. If the file's contents are changed, the SHA won't match, and then you can decide whether you want to overwrite the file.\n\nThe name *inkan* comes from \"the Japanese word for a document seal\":http://en.wikipedia.org/wiki/Inkan#Japanese_usage.\n\nh2. Installing\n\n\u003cpre\u003e\u003ccode\u003egem install inkan\u003c/code\u003e\u003c/pre\u003e\n\nh2. Usage\n\nh3. Reading\n\nTo write the files\n\n\u003cpre\u003e\u003ccode\u003einkan = Inkan.new('path/to/file.txt')\ninkan.print 'foo'\ninkan.seal\u003c/code\u003e\u003c/pre\u003e\n\nOr:\n\n\u003cpre\u003e\u003ccode\u003eInkan.seal('path/to/file.txt') { |inkan|\n  inkan.print 'foo'\n}\u003c/code\u003e\u003c/pre\u003e\n\nh3. Writing\n\n\u003cpre\u003e\u003ccode\u003eInkan.legitimate?('/path/to/file.txt')\u003c/code\u003e\u003c/pre\u003e\n\nh3. Customising\n\nYou can customise the header comment using the following settings:\n\n\u003cpre\u003e\u003ccode\u003einkan = Inkan.new('/path/to/file.txt')\ninkan.comment_prefix = '/*'            # Default is '#'.\ninkan.comment_suffix = '*/'            # Default is ''.\ninkan.credit         = 'My Magic Code' # Default is 'Generated by Inkan'\u003c/code\u003e\u003c/pre\u003e\n\nh2. Note on Patches/Pull Requests\n\nThe process is (ideally):\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so things don't break in future versions.\n* When committing, please don't mess with Rakefile or VERSION file. Unless, of course, you want your own version, but it'd be nice if you keep custom changes in a branch to be easily merged in.\n* Send a pull request. Bonus points for topic branches.\n\nh2. Copyright\n\nCopyright (c) 2010 Pat Allan, released under an MIT licence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpat%2Finkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpat%2Finkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpat%2Finkan/lists"}