Module: Changit

Defined in:
lib/changit.rb,
lib/changit/lexer.rb,
lib/changit/version.rb,
lib/changit/config_merger.rb,
lib/changit/config_reader.rb,
lib/changit/config_writer.rb,
lib/changit/git_dir_finder.rb,
lib/changit/lexer/section_token.rb,
lib/changit/lexer/key_value_token.rb

Defined Under Namespace

Classes: ConfigMerger, ConfigReader, ConfigWriter, GitDirFinder, Lexer

Constant Summary collapse

VERSION =
'0.2.2'

Class Method Summary collapse

Class Method Details

.runObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/changit.rb', line 11

def self.run
  # File to copy from
  config = ConfigReader.new.read

  # First, search directories inside the current pwd and make sure they contain a .git dir
  files_to_write_to = GitDirFinder.new.find_all

  # Then, copy the gitconfig file content to each .git/config file in these directories
  ConfigWriter.new(config, files_to_write_to).write
end