{"id":16115239,"url":"https://github.com/pvande/differ","last_synced_at":"2025-05-16T18:07:49.189Z","repository":{"id":533597,"uuid":"162732","full_name":"pvande/differ","owner":"pvande","description":"A simple gem for generating string diffs","archived":false,"fork":false,"pushed_at":"2011-07-31T19:18:22.000Z","size":222,"stargazers_count":347,"open_issues_count":11,"forks_count":49,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T16:59:20.991Z","etag":null,"topics":["diff","ruby"],"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/pvande.png","metadata":{"files":{"readme":"README.rdoc","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":"2009-03-29T23:40:14.000Z","updated_at":"2024-12-17T07:51:28.000Z","dependencies_parsed_at":"2022-07-16T14:30:33.399Z","dependency_job_id":null,"html_url":"https://github.com/pvande/differ","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2Fdiffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2Fdiffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2Fdiffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2Fdiffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvande","download_url":"https://codeload.github.com/pvande/differ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253989929,"owners_count":21995766,"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":["diff","ruby"],"created_at":"2024-10-09T20:18:10.360Z","updated_at":"2025-05-16T18:07:49.173Z","avatar_url":"https://github.com/pvande.png","language":"Ruby","readme":"= Differ\n\n    As streams of text swirled before the young man's eyes, his mind swam with\n  thoughts of many things. They would have to wait, however, as he focussed his\n  full concentration on the shifting patterns ahead of him. A glint of light\n  reflecting off a piece of buried code caught his eye and any hope he had was\n  lost. For the very moment he glanced aside, the landscape became Different.\n    The young man gave a small sigh and trudged onward in solemn resignation,\n  fated to wander the desolate codebanks in perpetuity.\n\nDiffer is a flexible, pure-Ruby diff library, suitable for use in both command\nline scripts and web applications.  The flexibility comes from the fact that\ndiffs can be built at completely arbitrary levels of granularity (some common\nones are built-in), and can be output in a variety of formats.\n\n== Installation\n\n  sudo gem install differ\n\n== Usage\n\nThere are a number of ways to use Differ, depending on your situation and needs.\n\n  @original = \"Epic lolcat fail!\"\n  @current  = \"Epic wolfman fail!\"\n\nYou can call the Differ module directly.\n\n  require 'differ'\n\nThere are a number of built-in diff methods to choose from...\n\n  @diff = Differ.diff_by_line(@current, @original)\n    # =\u003e \"{\"Epic lolcat fail!\" \u003e\u003e \"Epic wolfman fail!\"}\"\n\n  @diff = Differ.diff_by_word(@current, @original)\n    # =\u003e \"Epic {\"lolcat\" \u003e\u003e \"wolfman\"} fail!\"\n\n  @diff = Differ.diff_by_char(@current, @original)\n    # =\u003e \"Epic {+\"wo\"}l{-\"olcat \"}f{+\"m\"}a{+\"n fa\"}il!\"\n\n... or call #diff directly and supply your own boundary string!\n\n  @diff = Differ.diff(@current, @original)  # implicitly by line!\n    # =\u003e \"{\"Epic lolcat fail!\" \u003e\u003e \"Epic wolfman fail!\"}\"\n\n  @diff = Differ.diff(@current, @original, 'i')\n    # =\u003e \"Epi{\"c lolcat fa\" \u003e\u003e \"c wolfman fa\"}il\"\n\nIf you would like something a little more inline...\n\n  require 'differ/string'\n\n  @diff = @current.diff(@original)  # implicitly by line!\n    # =\u003e \"{\"Epic lolcat fail!\" \u003e\u003e \"Epic wolfman fail!\"}\"\n\n... or a lot more inline...\n\n  @diff = (@current - @original)    # implicitly by line!\n    # =\u003e \"{\"Epic lolcat fail!\" \u003e\u003e \"Epic wolfman fail!\"}\"\n\n  $; = ' '\n  @diff = (@current - @original)\n    # =\u003e \"Epic {\"lolcat\" \u003e\u003e \"wolfman\"} fail!\"\n\n... we've pretty much got you covered.\n\n=== Output Formatting\n\nNeed a different output format?  We've got a few of those too.\n\n  Differ.format = :ascii  # \u003c- Default\n  Differ.format = :color\n  Differ.format = :html\n\n  Differ.format = MyCustomFormatModule\n\nDon't want to change the system-wide default for only a single diff output?\nYeah, me either.\n\n  @diff = (@current - @original)\n  @diff.format_as(:color)\n\n== Copyright\n\nCopyright (c) 2009 Pieter Vande Bruggen.\n\n(The GIFT License, v1)\n\nPermission is hereby granted to use this software and/or its source code for\nwhatever purpose you should choose. Seriously, go nuts. Use it for your personal\nRSS feed reader, your wildly profitable social network, or your mission to Mars.\n\nI don't care, it's yours. Change the name on it if you want -- in fact, if you\nstart significantly changing what it does, I'd rather you did! Make it your own\nlittle work of art, complete with a stylish flowing signature in the corner. All\nI really did was give you the canvas.  And my blessing.\n\n  Know always right from wrong, and let others see your good works.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvande%2Fdiffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvande%2Fdiffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvande%2Fdiffer/lists"}