{"id":16134003,"url":"https://github.com/noah2610/profile.rb","last_synced_at":"2026-04-27T20:33:15.305Z","repository":{"id":99630509,"uuid":"114582007","full_name":"Noah2610/profile.rb","owner":"Noah2610","description":"Second version of my config files profiling script.","archived":false,"fork":false,"pushed_at":"2018-12-26T17:18:18.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T15:51:09.224Z","etag":null,"topics":["ruby"],"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/Noah2610.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-12-18T01:21:16.000Z","updated_at":"2018-12-26T17:18:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad56eefe-1626-40c7-9116-60773b247509","html_url":"https://github.com/Noah2610/profile.rb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Noah2610/profile.rb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah2610%2Fprofile.rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah2610%2Fprofile.rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah2610%2Fprofile.rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah2610%2Fprofile.rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Noah2610","download_url":"https://codeload.github.com/Noah2610/profile.rb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Noah2610%2Fprofile.rb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ruby"],"created_at":"2024-10-09T22:46:53.884Z","updated_at":"2026-04-27T20:33:15.262Z","avatar_url":"https://github.com/Noah2610.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProfileRB v2\nby Noah Rosenzweig\n\n---\n\n## Table Of Contents\n* [Description](#description)\n* [Installation](#installation)\n* [Configuration](#configuration)\n  * [Quick Summary](#quick-summary)\n* [Usage](#usage)\n  * [Default Syntax](#default-syntax)\n  * [Command-Line Usage](#command-line-usage)\n    * [Synopsis](#synopsis)\n    * [Examples](#examples)\n* [License](#license)\n\n---\n\n## Description\nThis is the second version of my small profiling script written in Ruby.  \nIt's main use is for configs / dotfiles.  \nIf you use multiple machines which share the same configs but with differences between configs then this script could be useful.  \n  \nThe base concept of this script is to have markers in your configs (as comments)  \nthat tell the script which profile this config snippet is associated to.  \nWhen the script is executed, it will then either **comment out** or **uncomment** those snippets,  \naccording to what profile you want to use.\n\n## Installation\nThe only dependency is **Ruby**.  \nIt should work with versions 2.0.0 and up.  \nI haven't tested the script with Windows, but you're probably not using  \ndotfiles if you're running Windows anyway.\n  \nAs long as Ruby is installed, you should have no issues using this script  \nafter cloning the repo:\n```\n$ git clone https://github.com/Noah2610/profile.rb.git ./ProfileRB; cd ./ProfileRB/\n```\n\n## Configuration\nThe script checks for a YAML config file in the following locations and order:\n* `~/.config/profilerb/config.yml`\n* `~/.profilerb.yml`\n* `\u003cPROJECT-ROOT\u003e/config.yml`\n  \nThe default config.yml file (`./config.yml`) is pretty well documented  \nin form of comments inside the file itself, so check it out for a more  \ndetailed explanation and documentation of the config syntax.\n\n### Quick Summary\nI'll give a quick explanation here:  \n  \nThe config file has four sections:\n* `file_aliases`  \n  In here you can associate strings with filepaths, so you  \n  don't need to type the whole path out in the `files` section,  \n  and can easily activate and deactivate them.  \n  They can also be directories, in which case all files inside the directory will be processed.\n* `files`  \n  Here are the files that you want to have processed by default.  \n  You can use `file_aliases` here.\n* `hostname_profiles`  \n  Here you can associate a list of profiles to use by default  \n  according to the machine's hostname.\n* `keywords`  \n  In here the syntax you use inside the files is defined.  \n  The default config is configured to use the syntax described below under __Default Syntax__.\n\n## Usage\n### Default Syntax\nBy default you can use syntax like this in the files you want to have _profiled_ (your dotfiles):\n```sh\n#PROFILE = desktop \u0026\u0026 main\nset -o vi    # For profiles desktop AND main, only effects next line (this line)\n\n#PROFILE_START = laptop || default\n# Everything between PROFILE_START and PROFILE_END is effected\nexport PATH=\"$HOME/bin:$PATH\"\nexport EDITOR=\"vim\"\n#PROFILE_END\n\n#PROFILE = main \u0026\u0026 !(desktop || laptop)\nexport SOMETHING=\"foobarbaz\"  # main but NOT desktop and NOT laptop\n```\nThe syntax is defined as _Regular Expressions_ in the config file.  \n  \nYou can use Ruby operators in expressions, they are \u003cu\u003eeval\u003c/u\u003euated.  \n  \n\n### Command-Line Usage\n#### Synopsis\n```\n./profile.rb [PROFILE1,PROFILE2,... [FILE1,FILE2,...]]\n```\n#### Examples\n```sh\n$ # Will use default profiles and files, as defined in your config:\n$ ./profile.rb\n$ # Use profile 'desktop' but NOT 'main' and NOT 'laptop' (negations not recommended) and default files:\n$ ./profile.rb desktop,\\!main,~laptop\n$ # Use profile 'desktop' and files ~/.bashrc (alias), ~/path/to/config:\n$ ./profile.rb desktop bashrc,~/path/to/config\n```\n\nI plan to expand the CL usage with some options using my Ruby [Argument Parser](https://github.com/Noah2610/ArgumentParser).\n\n---\n\n# License\nThis project is licensed under the MIT-license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoah2610%2Fprofile.rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoah2610%2Fprofile.rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoah2610%2Fprofile.rb/lists"}