Class: Nabokov::Setup

Inherits:
Runner
  • Object
show all
Defined in:
lib/nabokov/commands/setup.rb

Overview

Command to setup the project repo to use nabokov It setups the pre commit hook to start Nabokov::LocalizationsRepoSyncer

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Runner

#ui

Constructor Details

#initialize(argv) ⇒ Setup

Returns a new instance of Setup.



17
18
19
20
21
22
23
# File 'lib/nabokov/commands/setup.rb', line 17

def initialize(argv)
  @pre_commit_file = argv.option("pre_commit_file")
  @pre_commit_file ||= default_pre_commit_file
  @git_path = argv.option("git_path")
  @git_path ||= default_git_path
  super
end

Instance Attribute Details

#pre_commit_fileObject (readonly)

Returns the value of attribute pre_commit_file.



15
16
17
# File 'lib/nabokov/commands/setup.rb', line 15

def pre_commit_file
  @pre_commit_file
end

Instance Method Details

#runObject



25
26
27
28
29
30
31
# File 'lib/nabokov/commands/setup.rb', line 25

def run
  ensure_pre_commit_file_exists
  ensure_pre_commit_file_is_executable
  ensure_hook_is_installed
  ui.important "nabokov pre commit git hook is installed"
  self
end