Sha256: 658dec90d749bac7398750880e68b064130cdb7f928e417cdc9dc6719cc759dc
Contents?: true
Size: 1.31 KB
Versions: 14
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true # This module provides classes for the Makit gem. module Makit # This class provide methods for working with the system Environment. # class Git def self.is_git_repo Dir.exist? ".git" end def self.detached `git status`.include?("detached") end def self.is_read_only !is_git_repo || detached end def self.is_clean `git status --porcelain`.empty? end def self.integrate if is_git_repo && !detached "git add .".run "git commit -m \"integrate\"".run unless is_clean end end def self.sync if is_git_repo && !detached "git pull".try "git push origin".try end end def self.zip_source_files(zipfilename) "git archive --format zip --output #{zipfilename} HEAD".run end def self.branch `git branch --show-current`.strip end def self.commitsha `git rev-parse HEAD`.strip end def self.commitmsg `git log -1 --pretty=%B`.strip end def self.commitdate `git log -1 --pretty=%cd`.strip end def self.commitauthor `git log -1 --pretty=%an`.strip end def self.commitemail `git log -1 --pretty=%ae`.strip end end end
Version data entries
14 entries across 14 versions & 1 rubygems