module GitHooks

Copyright (C) 2013 Carl P. Corliss

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright (C) 2013 Carl P. Corliss

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright (C) 2013 Carl P. Corliss

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Constants

BIN_PATH
FAILURE_SYMBOL
GEM_PATH
HOOK_NAME
LIB_PATH
SCRIPT_NAME
SCRIPT_PATH
SKIPPED_SYMBOL
SUCCESS_SYMBOL
UNKNOWN_SYMBOL
VERSION
WARNING_SYMBOL

Attributes

debug[R]
hooks_root[R]
ignore_script[R]
verbose[R]

Public Class Methods

debug=(value) click to toggle source
# File lib/githooks.rb, line 53
def debug=(value)
  @debug = !!value
end
debug?() click to toggle source
# File lib/githooks.rb, line 46
def debug?
  return true if ENV['GITHOOKS_DEBUG']
  return true if ARGV.include?('--debug')
  return true if ARGV.include?('-d')
  debug
end
hook_name() click to toggle source
# File lib/githooks.rb, line 72
def hook_name
  case GitHooks::HOOK_NAME.to_s
    when 'githooks', 'irb', '', nil then 'pre-commit'
    else GitHooks::HOOK_NAME
  end
end
hooks_root=(value) click to toggle source
# File lib/githooks.rb, line 79
def hooks_root=(value)
  @hooks_root = Pathname.new(value)
end
ignore_script=(value) click to toggle source
# File lib/githooks.rb, line 68
def ignore_script=(value)
  @ignore_script = !!value
end
quieted() { || ... } click to toggle source
# File lib/githooks.rb, line 38
def quieted
  od, ov = @debug, @verbose
  @debug, @verbose = false, false
  yield
ensure
  @debug, @verbose = od, ov
end
verbose=(value) click to toggle source
# File lib/githooks.rb, line 64
def verbose=(value)
  @verbose = !!value
end
verbose?() click to toggle source
# File lib/githooks.rb, line 57
def verbose?
  return true if ENV['GITHOOKS_VERBOSE']
  return true if ARGV.include?('--verbose')
  return true if ARGV.include?('-v')
  verbose
end