├── .all-contributorsrc ├── .devcontainer ├── Dockerfile ├── devcontainer.json └── postCreate.sh ├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-plugin.yml │ ├── bug.yml │ ├── config.yml │ ├── feature-request.yml │ └── plugin-support.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── ci.yml │ ├── pages.yml │ ├── release.yml │ └── update-snapshots.yml ├── .gitignore ├── .gitpod.yml ├── .overcommit.yml ├── .rspec ├── .rubocop.yml ├── .vscode └── settings.json ├── .yardopts ├── CHANGELOG.md ├── CODEOWNERS ├── CONTRIBUTING.md ├── CREDITS.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Makefile ├── README.md ├── RELEASE_NOTES ├── Rakefile ├── bin ├── rake └── rspec ├── demos ├── .gitkeep ├── demo.gif ├── github-plugin.gif └── gitlab-plugin.gif ├── exe └── repofetch ├── lib ├── repofetch.rb └── repofetch │ ├── DEFAULT_CONFIG │ ├── VERSION │ ├── bitbucketcloud.rb │ ├── bitbucketcloud │ ├── ASCII │ └── stats.rb │ ├── cli.rb │ ├── config.rb │ ├── env.rb │ ├── exceptions.rb │ ├── github.rb │ ├── github │ └── ASCII │ ├── gitlab.rb │ ├── gitlab │ └── ASCII │ ├── plugin.rb │ ├── stat.rb │ ├── theme.rb │ ├── timespan_stat.rb │ ├── util.rb │ └── version.rb ├── repofetch.gemspec ├── scripts └── release.sh ├── spec ├── repofetch │ ├── __snapshots__ │ │ ├── cli_stdout_snapshot_1.snap │ │ ├── cli_unix_snapshot_1.snap │ │ ├── cli_windows_snapshot_1.snap │ │ ├── plugin_to_s_less_ascii_lines.snap │ │ ├── plugin_to_s_more_ascii_lines.snap │ │ ├── repofetch_bitbucketcloud_1.snap │ │ ├── repofetch_github_1.snap │ │ ├── repofetch_gitlab_1.snap │ │ └── repofetch_gitlab_2.snap │ ├── bitbucket_cloud_snapshot_spec.rb │ ├── bitbucket_cloud_spec.rb │ ├── cli_spec.rb │ ├── cli_unix_spec.rb │ ├── cli_windows_spec.rb │ ├── config_spec.rb │ ├── env_spec.rb │ ├── github_snapshot_spec.rb │ ├── github_spec.rb │ ├── gitlab_snapshot_spec.rb │ ├── gitlab_spec.rb │ ├── plugin_snapshot_spec.rb │ ├── plugin_spec.rb │ ├── stat_spec.rb │ ├── timespan_stat_spec.rb │ └── util_spec.rb ├── repofetch_spec.rb └── spec_helper.rb └── tapes ├── demo.tape ├── github-plugin.tape └── gitlab-plugin.tape /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "repofetch", 3 | "projectOwner": "spenserblack", 4 | "files": [ 5 | "CREDITS.md" 6 | ], 7 | "commitConvention": "atom", 8 | "contributorsSortAlphabetically": true, 9 | "contributors": [ 10 | { 11 | "login": "0323pin", 12 | "name": "pin", 13 | "avatar_url": "https://avatars.githubusercontent.com/u/90570748?v=4", 14 | "profile": "https://github.com/0323pin", 15 | "contributions": [ 16 | "platform" 17 | ] 18 | }, 19 | { 20 | "login": "orhun", 21 | "name": "Orhun Parmaksız", 22 | "avatar_url": "https://avatars.githubusercontent.com/u/24392180?v=4", 23 | "profile": "http://orhun.dev", 24 | "contributions": [ 25 | "bug", 26 | "code" 27 | ] 28 | }, 29 | { 30 | "login": "mmdbalkhi", 31 | "name": "komeil Parseh", 32 | "avatar_url": "https://avatars.githubusercontent.com/u/65954744?v=4", 33 | "profile": "https://github.com/mmdbalkhi", 34 | "contributions": [ 35 | "platform" 36 | ] 37 | } 38 | ], 39 | "contributorsPerLine": 7 40 | } 41 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VARIANT="2.7-buster" 2 | FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT} 3 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "dockerfile": "Dockerfile", 4 | "args": { "VARIANT": "2.7-buster" } 5 | }, 6 | "extensions": [ 7 | "EditorConfig.EditorConfig", 8 | "ms-vscode.live-server", 9 | "rebornix.Ruby" 10 | ], 11 | "portsAttributes": { 12 | "3000": { 13 | "label": "Coverage", 14 | "onAutoForward": "silent" 15 | } 16 | }, 17 | "postCreateCommand": ".devcontainer/postCreate.sh", 18 | "remoteUser": "vscode" 19 | } 20 | -------------------------------------------------------------------------------- /.devcontainer/postCreate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | bundle install 3 | bundle exec overcommit --install 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = LF 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.ascii] 12 | charset = latin1 13 | trim_trailing_whitespace = false 14 | 15 | [**/ASCII] 16 | charset = latin1 17 | trim_trailing_whitespace = false 18 | 19 | [*.snap] 20 | indent_style = unset 21 | indent_size = unset 22 | end_of_line = unset 23 | charset = unset 24 | trim_trailing_whitespace = unset 25 | insert_final_newline = unset 26 | 27 | [Dockerfile] 28 | indent_style = space 29 | indent_size = 4 30 | 31 | [Makefile] 32 | indent_style = tab 33 | indent_size = unset 34 | 35 | [*.sh] 36 | indent_style = tab 37 | indent_size = unset 38 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | bin/* linguist-vendored -diff 2 | *.snap -whitespace linguist-language=Text 3 | lib/repofetch/DEFAULT_CONFIG linguist-language=YAML 4 | **/ASCII -whitespace 5 | 6 | RELEASE_NOTES linguist-language=Markdown 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-plugin.yml: -------------------------------------------------------------------------------- 1 | name: Plugin Bug Report 2 | description: File this report if you know that a specific plugin is causing the issue 3 | title: "[Bug]: " 4 | labels: ["plugin:bug"] 5 | body: 6 | - type: input 7 | id: plugin-name 8 | attributes: 9 | label: Plugin 10 | description: Tell us which plugin it is 11 | placeholder: ex. Repofetch::Github 12 | validations: 13 | required: true 14 | - type: textarea 15 | id: what-happened 16 | attributes: 17 | label: What happened? 18 | description: Describe what happened, including steps to recreate the issue. 19 | placeholder: This happened when I did this... 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: what-should-happen 24 | attributes: 25 | label: What should have happened? 26 | description: Describe the behavior that you expected. 27 | placeholder: It should have... 28 | validations: 29 | required: true 30 | - type: textarea 31 | id: additional-info 32 | attributes: 33 | label: Additional info 34 | description: Is there anything else that we should know? 35 | validations: 36 | required: false 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a general bug report 3 | title: "[Bug]: " 4 | labels: ["bug"] 5 | body: 6 | - type: textarea 7 | id: what-happened 8 | attributes: 9 | label: What happened? 10 | description: Describe what happened, including steps to recreate the issue. 11 | placeholder: This happened when I did this... 12 | validations: 13 | required: true 14 | - type: textarea 15 | id: what-should-happen 16 | attributes: 17 | label: What should have happened? 18 | description: Describe the behavior that you expected. 19 | placeholder: It should have... 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: additional-info 24 | attributes: 25 | label: Additional info 26 | description: Is there anything else that we should know? 27 | validations: 28 | required: false 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Ask a question 4 | url: https://github.com/spenserblack/repofetch/discussions/new?category=q-a 5 | about: Ask any questions here. 6 | - name: Show and tell 7 | url: https://github.com/spenserblack/repofetch/discussions/new?category=show-and-tell 8 | about: Did you make something cool and want to show it off? Start with a "show and tell" discussion! 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Request a new feature for repofetch 3 | title: "[FEATURE]: " 4 | labels: ["enhancement"] 5 | body: 6 | - type: textarea 7 | id: feature-request 8 | attributes: 9 | label: What feature would you like to be implemented? 10 | description: Describe what you would like repofetch to do and why. 11 | placeholder: It should do this thing because it's awesome... 12 | validations: 13 | required: true 14 | - type: textarea 15 | id: proposed-implementation 16 | attributes: 17 | label: Proposed Implementation 18 | description: Have an idea on how this should be done? Share it! 19 | placeholder: It should be done by... 20 | validations: 21 | required: false 22 | - type: textarea 23 | id: additional-info 24 | attributes: 25 | label: Additional info 26 | description: Is there anything else that we should know? 27 | validations: 28 | required: false 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/plugin-support.yml: -------------------------------------------------------------------------------- 1 | name: Plugin Support 2 | description: Request a feature that would make it easier for you to author a plugin 3 | title: "[Feature Request]: " 4 | labels: ["plugin-support", "enhancement"] 5 | body: 6 | - type: input 7 | id: plugin 8 | attributes: 9 | label: Your Plugin 10 | description: A name or link to your plugin, if it exists. 11 | validations: 12 | required: false 13 | - type: textarea 14 | id: attempted-usage 15 | attributes: 16 | label: What are you trying to do? 17 | description: Tell us what your plugin needs to be able to do. 18 | validations: 19 | required: true 20 | - type: textarea 21 | id: proposed-change 22 | attributes: 23 | label: Proposed solution 24 | description: Tell us what we can do to make it easier for you to author your plugin. 25 | validations: 26 | required: true 27 | - type: textarea 28 | id: additional-info 29 | attributes: 30 | label: Additional info 31 | description: Is there anything else that we should know? 32 | validations: 33 | required: false 34 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: bundler 4 | directory: "/" 5 | groups: 6 | rspec: 7 | patterns: 8 | - "rspec" 9 | - "rspec-*" 10 | rubocop: 11 | patterns: 12 | - "rubocop" 13 | - "rubocop-*" 14 | simplecov: 15 | patterns: 16 | - "simplecov" 17 | - "simplecov-*" 18 | schedule: 19 | interval: monthly 20 | open-pull-requests-limit: 10 21 | - package-ecosystem: github-actions 22 | directory: "/" 23 | schedule: 24 | interval: daily 25 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## To do checklist 2 | 3 | - [ ] Update/create `RELEASE_NOTES` file if necessary 4 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: ['main'] 6 | pull_request: 7 | branches: ['main'] 8 | 9 | jobs: 10 | test: 11 | name: Test (${{ matrix.os }}, Ruby ${{ matrix.ruby-version }}) 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | os: 17 | - ubuntu-latest 18 | - macos-latest 19 | - windows-latest 20 | ruby-version: 21 | - '2.7' 22 | - '3.0' 23 | - '3.1' 24 | - '3.2' 25 | exclude: 26 | # TODO: Figure out why Windows breaks on these 27 | - os: windows-latest 28 | ruby-version: '2.7' 29 | - os: windows-latest 30 | ruby-version: '3.0' 31 | 32 | steps: 33 | - uses: actions/checkout@v4 34 | - name: Setup Ruby ${{ matrix.ruby-version }} 35 | uses: ruby/setup-ruby@v1 36 | with: 37 | ruby-version: ${{ matrix.ruby-version }} 38 | bundler-cache: true 39 | 40 | - name: Run Tests and Generate Coverage 41 | run: ruby bin/rake spec 42 | - name: Upload Coverage 43 | uses: codecov/codecov-action@v3 44 | with: 45 | token: ${{ secrets.CODECOV_TOKEN }} 46 | flags: ${{ matrix.os }},ruby-${{ matrix.ruby-version }} 47 | 48 | lint: 49 | name: Check Style 50 | runs-on: ubuntu-latest 51 | 52 | steps: 53 | - uses: actions/checkout@v4 54 | - name: Setup Ruby 55 | uses: ruby/setup-ruby@v1 56 | with: 57 | ruby-version: '2.7' 58 | bundler-cache: true 59 | 60 | - name: Check Style 61 | run: bundle exec rubocop 62 | 63 | docs: 64 | name: Check Docs 65 | runs-on: ubuntu-latest 66 | 67 | steps: 68 | - uses: actions/checkout@v4 69 | - name: Setup Ruby 70 | uses: ruby/setup-ruby@v1 71 | with: 72 | ruby-version: '2.7' 73 | bundler-cache: true 74 | 75 | - name: Check Docs 76 | run: bundle exec yard stats --fail-on-warning 77 | -------------------------------------------------------------------------------- /.github/workflows/pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy docs to GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | workflow_dispatch: 7 | 8 | permissions: 9 | contents: read 10 | pages: write 11 | id-token: write 12 | 13 | # Allow one concurrent deployment 14 | concurrency: 15 | group: "pages" 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | deploy: 20 | environment: 21 | name: github-pages 22 | url: ${{ steps.deployment.outputs.page_url }} 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v4 27 | - name: Setup Ruby 28 | uses: ruby/setup-ruby@v1 29 | with: 30 | ruby-version: '2.7' 31 | bundler-cache: true 32 | - name: Build Docs 33 | run: bundle exec yardoc 34 | - name: Setup Pages 35 | uses: actions/configure-pages@v4 36 | - name: Upload artifact 37 | uses: actions/upload-pages-artifact@v3 38 | with: 39 | path: doc 40 | - name: Deploy to GitHub Pages 41 | id: deployment 42 | uses: actions/deploy-pages@v4 43 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: [ 'v*.*.*' ] 6 | 7 | jobs: 8 | release: 9 | runs-on: ubuntu-latest 10 | permissions: 11 | contents: write 12 | steps: 13 | - uses: actions/checkout@v4 14 | with: 15 | ref: ${{ github.ref }} 16 | - name: Publish GitHub Release 17 | uses: spenserblack/actions-tag-to-release@v3 18 | 19 | publish: 20 | name: Publish 21 | runs-on: ubuntu-latest 22 | permissions: 23 | packages: write 24 | contents: read 25 | 26 | steps: 27 | - uses: actions/checkout@v4 28 | - name: Setup Ruby 29 | uses: ruby/setup-ruby@v1 30 | with: 31 | ruby-version: '2.7' 32 | - run: bundle install 33 | - name: Set Up Credentials 34 | env: 35 | GITHUB_GEM_TOKEN: "Bearer ${{ secrets.GITHUB_TOKEN }}" 36 | RUBYGEMS_TOKEN: ${{ secrets.RUBYGEMS_TOKEN }} 37 | run: | 38 | mkdir -p $HOME/.gem 39 | touch $HOME/.gem/credentials 40 | chmod 0600 $HOME/.gem/credentials 41 | printf -- "---\n:rubygems_api_key: ${RUBYGEMS_TOKEN}\n:github: ${GITHUB_GEM_TOKEN}\n" > $HOME/.gem/credentials 42 | - run: gem build 43 | - name: Publish to GitHub 44 | env: 45 | OWNER: ${{ github.repository_owner }} 46 | run: gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem 47 | - name: Publish to RubyGems 48 | run: gem push *.gem 49 | -------------------------------------------------------------------------------- /.github/workflows/update-snapshots.yml: -------------------------------------------------------------------------------- 1 | name: Update Snapshots 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | os: 7 | required: true 8 | type: choice 9 | options: 10 | - windows-latest 11 | - macos-latest 12 | - ubuntu-latest 13 | 14 | jobs: 15 | update-snapshots: 16 | name: Update Snapshots 17 | runs-on: ${{ inputs.os }} 18 | permissions: 19 | contents: write 20 | 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Set up Ruby 24 | uses: ruby/setup-ruby@v1 25 | with: 26 | ruby-version: '3.1' 27 | bundler-cache: true 28 | - name: Update Snapshots 29 | env: 30 | UPDATE_SNAPSHOTS: 1 31 | run: ruby bin/rake spec 32 | - name: Push Changes 33 | uses: stefanzweifel/git-auto-commit-action@v5 34 | with: 35 | commit_message: Update snapshots 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | /.bundle/ 3 | /coverage/ 4 | 5 | # Bundler Binstubs 6 | /bin/* 7 | !/bin/rake 8 | !/bin/rspec 9 | 10 | # Yard output 11 | /.yardoc/ 12 | /doc/ 13 | 14 | # Vendored files 15 | /vendor/bundle 16 | 17 | # Legacy ignores from Rust version 18 | /target 19 | **/*.rs.bk 20 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | github: 6 | prebuilds: 7 | addComment: true 8 | vscode: 9 | extensions: 10 | - 'EditorConfig.EditorConfig' 11 | - 'rebornix.Ruby' 12 | tasks: 13 | - init: .devcontainer/postCreate.sh 14 | -------------------------------------------------------------------------------- /.overcommit.yml: -------------------------------------------------------------------------------- 1 | PreCommit: 2 | RuboCop: 3 | enabled: true 4 | on_warn: fail # Treat all warnings as failures 5 | 6 | TrailingWhitespace: 7 | enabled: true 8 | exclude: 9 | - '**.ascii' 10 | - '**.txt' 11 | - '**/ASCII' 12 | - '**/__snapshots__/**' 13 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop-rake 3 | - rubocop-rspec 4 | AllCops: 5 | NewCops: enable 6 | Exclude: 7 | - 'bin/*' 8 | - 'vendor/**/*' 9 | Include: 10 | - 'exe/*' 11 | - '**/*.rb' 12 | - '**/*.gemfile' 13 | - '**/*.gemspec' 14 | - '**/*.rake' 15 | - '**/*.ru' 16 | - '**/Gemfile' 17 | - '**/Rakefile' 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ruby.useBundler": true, 3 | "ruby.useLanguageServer": true, 4 | "ruby.lint": { 5 | "rubocop": { 6 | "useBundler": true 7 | }, 8 | }, 9 | "ruby.format": "rubocop" 10 | } 11 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --no-private 2 | --protected 3 | --title "Repofetch" 4 | --asset demos 5 | lib/**/*.rb - 6 | CONTRIBUTING.md 7 | CREDITS.md 8 | LICENSE 9 | README.md 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | :warning: Further updates will be tracked in the [release notes](https://github.com/spenserblack/repofetch/releases). 4 | 5 | ## [Unreleased] 6 | 7 | ### Other 8 | 9 | - NetBSD installation option (@0323pin) 10 | 11 | ## [0.3.3] 12 | 13 | ### Fixed 14 | 15 | - Crash caused by `-r`/`--repository` type mismatch (@orhun) 16 | - GitHub repository names not being detected when they didn't have the optional 17 | `.git` suffix 18 | 19 | ## [0.3.2] 20 | 21 | Internal changes only 22 | 23 | ## [0.3.1] 24 | 25 | ### Changed 26 | 27 | - CLI help to be colored 28 | - Order of CLI help 29 | 30 | ## [0.3.0] 31 | 32 | ### Added 33 | 34 | - GitHub ASCII art 35 | - Option to select local repository to detect remote owner and repository 36 | 37 | ### Changed 38 | 39 | - Date created and updated to be human-readable durations 40 | 41 | ## [0.2.1] 42 | 43 | ### Added 44 | 45 | - config option for a personal access token 46 | 47 | ## [0.2.0] 48 | 49 | ### Added 50 | 51 | - Issues counts 52 | - Pull Requests counts 53 | - Count of available issues with the `help wanted` label 54 | - Count of available issues with the `good first issue` label 55 | - Customizable behavior via `repofetch.yml` config file 56 | 57 | ## 0.1.0 58 | Initial version :tada: 59 | 60 | [Unreleased]: https://github.com/spenserblack/repofetch/compare/v0.3.3...HEAD 61 | [0.3.3]: https://github.com/spenserblack/repofetch/compare/v0.3.2...v0.3.3 62 | [0.3.2]: https://github.com/spenserblack/repofetch/compare/v0.3.1...v0.3.2 63 | [0.3.1]: https://github.com/spenserblack/repofetch/compare/v0.3.0...v0.3.1 64 | [0.3.0]: https://github.com/spenserblack/repofetch/compare/v0.2.1...v0.3.0 65 | [0.2.1]: https://github.com/spenserblack/repofetch/compare/v0.2.0...v0.2.1 66 | [0.2.0]: https://github.com/spenserblack/repofetch/compare/v0.1.0...v0.2.0 67 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @spenserblack 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Contributing to repofetch 4 | 5 | ### Initializing your repository 6 | 7 | This will install dependencies and also set up git to run code quality checks 8 | when you attempt to make a commit. If you are using a codespace, this should 9 | run automatically. 10 | 11 | ```bash 12 | bundle install 13 | bundle exec overcommit --install 14 | ``` 15 | 16 | ### Demo Animations 17 | 18 | The demo animations are created using [vhs]. If you are going to create or 19 | update the demo animations, please follow the installation instructions for 20 | [vhs]. 21 | 22 | ## Writing a 3rd-party plugin 23 | 24 | 3rd-party plugins are Ruby gems that users can install and activate in their 25 | configuration files. 26 | 27 | You can view an officially supported plugin, like `Repofetch::Github`, as an 28 | example for writing a plugin. Some information for writing a plugin is provided 29 | below, but you can view more information from the generated documentation. Versioned 30 | documentation is deployed to [rdoc.info](https://rubydoc.info/gems/repofetch), and 31 | bleeding-edge documentation is deployed to 32 | [GitHub Pages](https://spenserblack.github.io/repofetch/). 33 | 34 | The easiest way to set up a plugin is to inherit from `Repofetch::Plugin`, which 35 | will provide several helper methods that repofetch relies on to construct the 36 | output. A few methods need to be implemented to complete your plugin: 37 | 38 | ### Required Plugin Class Methods 39 | 40 | #### Detecting if repofetch should use a plugin 41 | 42 | When a user does *not* explicitly choose their plugin from the command-line, 43 | repofetch must select the plugin by matching it against a directory. `matches_repo?` 44 | is a class method that takes a [`Git::Base`][git-base] instance and returns `true` 45 | if repofetch should use the plugin for that repository, and `false` if repofetch should 46 | not use the plugin (e.g. a GitHub plugin would return `false` for a GitLab repository). 47 | 48 | #### Constructing the Plugin Instance 49 | 50 | When repofetch selects a plugin using `matches_repo?`, it will then try to create an 51 | instance of that plugin by calling `from_git`. From git will receive the 52 | [`Git::Base`][git-base] instance, an array of CLI args that the plugin can use, and 53 | an instance of `Repofetch::Config`. 54 | 55 | If the user explicitly chooses the plugin to use via `repofetch --plugin `, then 56 | repofetch will pick that plugin and call its `from_args` class method. `from_args` takes 57 | an array of CLI args and an instance of `Repofetch::Config`. 58 | 59 | ### Required Plugin Instance Methods 60 | 61 | The following requirements assume you are *not* manually implementing a plugin's 62 | `to_s` method, and you are inheriting from `Repofetch::Plugin`. 63 | 64 | - `ascii` should return a string for the ASCII art 65 | - `header` should return the header text or an array of header text that will be above the `---` separator on the right side. 66 | - `stats` should return an array of values that implement `to_s`. These will be 67 | the stats displayed to the right of the ASCII art. You can use`Repofetch::Stat` and 68 | `Repofetch::TimespanStat` to create a pretty stat. 69 | 70 | ### Optional Plugin Instance Methods 71 | 72 | - `theme` can return an instance of `Repofetch::Theme` to use a different color scheme. 73 | - `primary_color` will set the color for the header and stat labels. 74 | 75 | ### Authoring ASCII Art 76 | 77 | The ASCII art should be no more than 40 characters wide or 20 characters tall. 78 | It can receive ANSI escape sequences for styling by using `%{