Class: AbleGitHooks::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- AbleGitHooks::Generators::InstallGenerator
- Defined in:
- lib/able_git_hooks/generators/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_rubocop_defaults ⇒ Object
22 23 24 |
# File 'lib/able_git_hooks/generators/install_generator.rb', line 22 def copy_rubocop_defaults template "rubocop.yml", "config/rubocop.yml" end |
#install_git_hooks ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/able_git_hooks/generators/install_generator.rb', line 7 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 ⇒ Object
17 18 19 20 |
# File 'lib/able_git_hooks/generators/install_generator.rb', line 17 def install_rubocop_hooks copy_file "rubocop_hook", "hooks/pre-commit/rubocop" chmod "hooks/pre-commit/rubocop", 0755 end |