class AbleGitHooks::Generators::InstallGenerator

Public Instance Methods

copy_eslint_defaults() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 34
def copy_eslint_defaults
  copy_file "eslintrc.json", ".eslintrc.json"
end
copy_prettier_defaults() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 38
def copy_prettier_defaults
  copy_file "prettierrc", ".prettierrc"
end
copy_rubocop_defaults() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 25
def copy_rubocop_defaults
  template "rubocop.yml", "config/rubocop.yml"
end
copy_stylelint_defaults() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 49
def copy_stylelint_defaults
  if options["with_stylelint"]
    copy_file "stylelintrc", ".stylelintrc"
  end
end
install_eslint_hooks() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 29
def install_eslint_hooks
  copy_file "eslint-check.js", "hooks/pre-commit/eslint-check.js"
  chmod "hooks/pre-commit/eslint-check.js", 0755
end
install_git_hooks() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 10
def install_git_hooks
  copy_file "_do_hook", ".git/hooks/_do_hook"
  chmod ".git/hooks/_do_hook", 0755

  AbleGitHooks::SCRIPTS.each do |hook|
    create_link ".git/hooks/#{hook}", "_do_hook"
    chmod       ".git/hooks/#{hook}", 0755
  end
end
install_rubocop_hooks() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 20
def install_rubocop_hooks
  copy_file "rubocop.rb", "hooks/pre-commit/rubocop.rb"
  chmod "hooks/pre-commit/rubocop.rb", 0755
end
install_stylelint_hooks() click to toggle source
# File lib/able_git_hooks/generators/install_generator.rb, line 42
def install_stylelint_hooks
  if options["with_stylelint"]
    copy_file "stylelint-check.js", "hooks/pre-commit/stylelint-check.js"
    chmod "hooks/pre-commit/stylelint-check.js", 0755
  end
end