Create a folder to store git hook templates
# ~/.gitconfig
[init]
  templatedir = ~/.git_templates
The following files are in ~/.git_templates/hooks/
| require 'base64' | |
| require 'uri' | |
| require 'faraday' | |
| module FaradayMiddleware | |
| class BasicAuthOverwrite < Faraday::Middleware | |
| KEY = "Authorization".freeze | |
| def call(env) | |
| rewrite_request(env) | 
Create a folder to store git hook templates
# ~/.gitconfig
[init]
  templatedir = ~/.git_templates
The following files are in ~/.git_templates/hooks/
| #!/bin/sh | |
| # Put this file into your .git/hooks directory and make it | |
| # executable. | |
| # | |
| # A hook script to verify what is about to be committed. | |
| # Called by "git commit" with no arguments. The hook exits | |
| # with non-zero status if the Rubocop check fails. | |
| # Redirect output to stderr. | |
| exec 1>&2 | 
| #!/usr/bin/env ruby | |
| # <bitbar.title>Windfinder </bitbar.title> | |
| # <bitbar.version>v1.0</bitbar.version> | |
| # <bitbar.author>Gergő Sulymosi</bitbar.author> | |
| # <bitbar.author.github>trekdemo</bitbar.author.github> | |
| # <bitbar.desc>Show the 3 day forecast from Windfinder</bitbar.desc> | |
| # <bitbar.image></bitbar.image> | |
| # <bitbar.dependencies>ruby</bitbar.dependencies> | |
| # <bitbar.abouturl></bitbar.abouturl> | 
| class CreatePost | |
| # An interactor to create a post. | |
| # Initialize with a request object that implements the request interface for this interactor. | |
| def initialize(request) | |
| RequestInterface.required_on! request | |
| @user = {:title => request.title} | |
| end | |
| def result | 
| # frozen_string_literal: true | |
| require 'bundler/inline' | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| gem 'rails', '~> 7.1.0' | |
| gem 'sqlite3' | |
| end |