Class: Trek::Generators::Install::LefthookGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Helpers
Defined in:
lib/generators/trek/install/lefthook_generator.rb

Constant Summary collapse

NPM_DEPENDENCIES =
{
  lefthook: "^1.4.2"
}

Instance Method Summary collapse

Instance Method Details

#copy_lefthook_configObject



18
19
20
# File 'lib/generators/trek/install/lefthook_generator.rb', line 18

def copy_lefthook_config
  copy_file_at_root "lefthook.yml"
end

#install_dependenciesObject

This is after copying the config, because it installs the hooks as a postinstall script.



23
24
25
# File 'lib/generators/trek/install/lefthook_generator.rb', line 23

def install_dependencies
  install_npm_dependencies(NPM_DEPENDENCIES, dev: true)
end