This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'git' | |
root_path = ARGV[0] | |
raise 'Specify root path as first parameter e.g. \'/Users/myname\'' unless root_path | |
# Find all folders wich are git repositories | |
Dir[File.join(root_path, '*/.git')].each do |git_path| | |
path = git_path.gsub('.git', '') | |
git = Git.open(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caffeinate -t 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/cli' | |
require 'git' | |
require 'octokit' | |
BRANCH_NAME = 'branch' | |
COMMIT_MESSAGE = 'Commit Message' | |
# ASSIGNEE = 'pengwynn' # update to assing pull request | |
git = Git.open(Dir.pwd) | |
github = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/cli' | |
require 'git' | |
require 'octokit' | |
BRANCH_NAME = 'gem-updates' | |
COMMIT_MESSAGE = 'Update gems' | |
# ASSIGNEE = 'pengwynn' # update to assing pull request | |
git = Git.open(Dir.pwd) | |
github = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/all' | |
require 'fileutils' | |
require 'pathname' | |
root = Pathname.pwd | |
code_folder = root.join('lib') | |
spec_folder = root.join('spec') | |
code = Dir[code_folder.join('**/*.rb')].map { |file| file[(code_folder.to_s.length+1)..-('.rb'.length+1)] } | |
specs = Dir[spec_folder.join('**/*_spec.rb')].map { |file| file[(spec_folder.to_s.length+1)..-('_spec.rb'.length+1)] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
def client | |
Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) | |
end | |
def create_pull_request(repo, head, options = {}) | |
ref = client.ref(repo, "heads/#{head}") | |
commit = client.commit(repo, ref.object.sha) | |
title = options[:title] || commit.commit.message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
TITLE = 'example title' | |
LABEL = 'ready to merge' | |
COMMENT = '+B' | |
client = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) | |
pulls = client.list_issues.select { |issue| | |
issue.pull_request && |
NewerOlder