{"id":16688025,"url":"https://github.com/danielpclark/env_compat","last_synced_at":"2025-03-13T17:27:23.423Z","repository":{"id":62558128,"uuid":"52636838","full_name":"danielpclark/env_compat","owner":"danielpclark","description":"Your tool for converting special characters to ENV compatible variables.","archived":false,"fork":false,"pushed_at":"2016-03-08T01:49:37.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-25T10:22:28.671Z","etag":null,"topics":["conversion","converting-special-characters","env","environment-variables","ruby"],"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/danielpclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-26T22:26:27.000Z","updated_at":"2016-02-27T13:20:59.000Z","dependencies_parsed_at":"2022-11-03T06:45:42.540Z","dependency_job_id":null,"html_url":"https://github.com/danielpclark/env_compat","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/danielpclark%2Fenv_compat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fenv_compat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fenv_compat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fenv_compat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielpclark","download_url":"https://codeload.github.com/danielpclark/env_compat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243447642,"owners_count":20292455,"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":["conversion","converting-special-characters","env","environment-variables","ruby"],"created_at":"2024-10-12T15:26:31.105Z","updated_at":"2025-03-13T17:27:23.398Z","avatar_url":"https://github.com/danielpclark.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EnvCompat\n\nYour tool for converting special characters to ENV friendly variables.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'env_compat', '~\u003e 0.1'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install env_compat\n\n## Usage\n\nThree methods are provided `:auto`, `:encode`, and `:decode`.  Provide a tag for\n`:auto` and it will use that to determine whether or not to encode or decode.  You\ncan see this example tag usage in the Bundler library.\n\n```ruby\n\nEnvCompat.auto :bundle, \"https://github.com/company/private-repo.git\"\n# =\u003e \"BUNDLE_HTTPS_CFF_GITHUB_D_COM_F_COMPANY_F_PRIVATE_M_REPO_D_GIT\" \n\nEnvCompat.auto :bundle, \"BUNDLE_HTTPS_CFF_GITHUB_D_COM_F_COMPANY_F_PRIVATE_M_REPO_D_GIT\" \n# =\u003e \"HTTPS://GITHUB.COM/COMPANY/PRIVATE-REPO.GIT\"\n\nEnvCompat.encode \"https://github.com/company/private-repo.git\"\n# =\u003e \"HTTPS_CFF_GITHUB_D_COM_F_COMPANY_F_PRIVATE_M_REPO_D_GIT\" \n\nEnvCompat.decode \"HTTPS_CFF_GITHUB_D_COM_F_COMPANY_F_PRIVATE_M_REPO_D_GIT\" \n# =\u003e HTTPS://GITHUB.COM/COMPANY/PRIVATE-REPO.GIT\n```\n\nTo define your own custom special character mappings feel free to overwrite\nthe EnvCompat module instance method of `:mapping`.  **NOTE:** When changing\nmapping the underscore symbol must be mapped.\n\n```ruby\ndef EnvCompat.mapping\n  {\n    '1' =\u003e '/', # Forward Slash\n    '2' =\u003e ':', # Colon\n    '3' =\u003e '-', # Minus\n    '4' =\u003e '_', # Underscore\n    '5' =\u003e '.'  # Dot\n  }\nend\n\nEnvCompat.encode \"https://github.com/company/private-repo.git\"\n# =\u003e \"HTTPS_211_GITHUB_5_COM_1_COMPANY_1_PRIVATE_3_REPO_5_GIT\"\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/danielpclark/env_compat.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpclark%2Fenv_compat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielpclark%2Fenv_compat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpclark%2Fenv_compat/lists"}