{"id":23284195,"url":"https://github.com/agilecreativity/filename_cleaner","last_synced_at":"2025-08-21T16:32:32.778Z","repository":{"id":16512393,"uuid":"19265406","full_name":"agilecreativity/filename_cleaner","owner":"agilecreativity","description":"Batch cleanup/rename bad filenames from a given directory recursively using simple rules.","archived":false,"fork":false,"pushed_at":"2015-11-24T20:25:49.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-13T19:09:16.501Z","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/agilecreativity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-29T05:55:19.000Z","updated_at":"2016-01-17T01:18:21.000Z","dependencies_parsed_at":"2022-09-09T01:00:32.178Z","dependency_job_id":null,"html_url":"https://github.com/agilecreativity/filename_cleaner","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Ffilename_cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Ffilename_cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Ffilename_cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Ffilename_cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilecreativity","download_url":"https://codeload.github.com/agilecreativity/filename_cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230523775,"owners_count":18239437,"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-12-20T01:38:37.782Z","updated_at":"2024-12-20T01:38:38.399Z","avatar_url":"https://github.com/agilecreativity.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## filename_cleaner\n\n[![Gem Version](https://badge.fury.io/rb/filename_cleaner.svg)][gem]\n[![Dependency Status](https://gemnasium.com/agilecreativity/filename_cleaner.png)][gemnasium]\n[![Code Climate](https://codeclimate.com/github/agilecreativity/filename_cleaner.png)][codeclimate]\n[![Build Status](https://travis-ci.org/agilecreativity/filename_cleaner.svg?branch=master)][travis-ci]\n[![Coverage Status](https://coveralls.io/repos/agilecreativity/filename_cleaner/badge.png?branch=master)][coveralls]\n\n[gem]: http://badge.fury.io/rb/filename_cleaner\n[gemnasium]: https://gemnasium.com/agilecreativity/filename_cleaner\n[codeclimate]: https://codeclimate.com/github/agilecreativity/filename_cleaner\n[travis-ci]: https://travis-ci.org/agilecreativity/filename_cleaner\n[coveralls]: https://coveralls.io/r/agilecreativity/filename_cleaner?branch=master\n\nQuickly rename list of files with extension and replace any special characters with\nwith any given string.\n\nCurrently any string that are not one of letters (a..z, A..Z),\nnumbers (0..9), _ (underscore), - (dash), and ' ' spaces string\nare first squeezed into one string and then replaced by any given string/char [default to . (a single dot)].\n\nOptionally, you could also\n\n- capitalized each word in the output\n- make each word in output lower case\n- use more than one character as the separator string if you prefer\n\n### Installation\n\n```sh\ngem install filename_cleaner\n```\n\n#### Use as command line interface (CLI)\n\nJust type `filename_cleaner` without any options to see the list of help\n\n```\nUsage:\n  filename_cleaner\n\nOptions:\n  -b, [--base-dir=BASE_DIR]                # Base directory\n                                           # Default: . (current directory)\n  -e, [--exts=one two three]               # List of extensions to search for\n  -r, [--recursive], [--no-recursive]      # Search for files recursively\n                                           # Default: true\n  -s, [--sep-char=SEP_CHAR]                # Separator char to use\n                                           # Default: _\n  -d, [--downcase], [--no-downcase]        # Convert each word int the filename to lowercase\n                                           # Default: --no-downcase\n  -t, [--capitalize], [--no-capitalize]    # Capitalize each word in the filename\n                                           # Default: --no-capitalize\n  -c, [--commit], [--no-commit]            # Commit your changes\n                                           # Default: --no-commit\n  -v, [--version], [--no-version]          # Display version information\n                                           # Default: --no-version\n\nSanitize and rename file with special characters\n```\n\nTo perform the dry-run without make any changes to the file system:\n\n```\ncd ~/projects/files\nfilename_cleaner --base-dir . --exts java rb --recursive --sep-char _\n```\n\nTo make your change permanent:\n\n```\ncd ~/projects/files\nfilename_cleaner --base-dir . --exts java rb --recursive --sep-char _ --commit\n```\n\n#### Us as library in your project\n\nAdd this line to your application's Gemfile:\n\n```\ngem 'filename_cleaner'\n```\n\nAnd then execute:\n\n```\n$bundle\n```\n\nExample Usage:\n\n- Use the default separator string '.'\n\n```ruby\nrequire 'filename_cleaner'\n# Treat the input as having extension (e.g. at least one dot within the input)\nnew_name = FilenameCleaner.sanitize('some b@d fil$name.txt', '_', true)\nputs new_name # =\u003e 'some_b_d_fil_name.txt'\n\n# Treat the input as having no extension (ignore the meaning of within the input)\nnew_name = FilenameCleaner.sanitize('some b@d fil$name.txt', '_', false)\nputs new_name # =\u003e 'some_b_d_fil_name_txt'\n```\n\n### Contributing\n\nBug reports and suggestions for improvements are always welcome,\nGitHub pull requests are even better!.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n[rubocop]: https://github.com/bbatsov/rubocop\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Ffilename_cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilecreativity%2Ffilename_cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Ffilename_cleaner/lists"}