Sha256: 33285e4fa0ecd5dff7d9635106b987ed6b2e5402144be84487703718df791064

Contents?: true

Size: 956 Bytes

Versions: 8

Compression:

Stored size: 956 Bytes

Contents

# -*- encoding : utf-8 -*-
module Lolcommits
  #
  # Methods to handle enabling and disabling of lolcommits
  #
  class Installation
    def self.backend
      if GitInfo.repo_root?
        InstallationGit
      elsif MercurialInfo.repo_root?
        InstallationMercurial
      else
        fatal "You don't appear to be in the base directory of a supported vcs project."
        exit 1
      end
    end

    #
    # IF --ENABLE, DO ENABLE
    #
    def self.do_enable
      path = backend.do_enable

      info 'installed lolcommit hook to:'
      info "  -> #{File.expand_path(path)}"
      info '(to remove later, you can use: lolcommits --disable)'
      # we dont symlink, but rather install a small stub that calls the one from path
      # that way, as gem version changes, script updates even if new file thus breaking symlink
    end

    #
    # IF --DISABLE, DO DISABLE
    #
    def self.do_disable
      backend.do_disable
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lolcommits-0.9.0 lib/lolcommits/installation.rb
lolcommits-0.8.1 lib/lolcommits/installation.rb
lolcommits-0.8.0 lib/lolcommits/installation.rb
lolcommits-0.7.0 lib/lolcommits/installation.rb
lolcommits-0.6.7 lib/lolcommits/installation.rb
lolcommits-0.6.6 lib/lolcommits/installation.rb
lolcommits-0.6.6.pre1 lib/lolcommits/installation.rb
lolcommits-0.6.5 lib/lolcommits/installation.rb