-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Changit.run; system modules wrapper
Use it inside bin/changit to run the program
- Loading branch information
Showing
2 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
|
||
require 'changit' | ||
|
||
initial = Changit::Initial.new | ||
initial.hello | ||
Changit.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
require 'changit/version' | ||
require 'changit/git_dir_finder' | ||
require 'changit/config_reader' | ||
require 'changit/config_writer' | ||
|
||
module Changit | ||
class Initial | ||
def hello | ||
puts 'Hello vvorld' | ||
end | ||
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 | ||
end |