Class: Util::Git
- Inherits:
-
Object
- Object
- Util::Git
- Defined in:
- lib/utilities/git.rb
Overview
A.1. GIT COMMANDS ———————————————————————————————–
Instance Method Summary collapse
-
#add(path) ⇒ Object
A.1.4.
-
#init(path) ⇒ Object
A.1.2.
-
#install(path, repository, target, dest) ⇒ Object
A.1.1.
-
#remote(path, remote) ⇒ Object
A.1.3.
Instance Method Details
#add(path) ⇒ Object
A.1.4. GIT SCAFFOLD
62 63 64 65 66 67 68 69 70 |
# File 'lib/utilities/git.rb', line 62 def add(path) FileUtils.cd(path) do `git add *` end end |
#init(path) ⇒ Object
A.1.2. GIT INIT
34 35 36 37 38 39 40 41 42 |
# File 'lib/utilities/git.rb', line 34 def init(path) FileUtils.cd(path) do `git init` end end |
#install(path, repository, target, dest) ⇒ Object
A.1.1. GIT INSTALL
20 21 22 23 24 25 26 27 28 |
# File 'lib/utilities/git.rb', line 20 def install(path, repository, target, dest) `git clone #{repository} "#{path}/.tmp"` FileUtils.copy_entry("#{path}/.tmp/#{target}", "#{path}/#{dest}") FileUtils.rm_rf(Dir.glob("#{path}/.tmp")) end |
#remote(path, remote) ⇒ Object
A.1.3. GIT REMOTE
48 49 50 51 52 53 54 55 56 |
# File 'lib/utilities/git.rb', line 48 def remote(path, remote) FileUtils.cd(path) do `git remote add origin #{remote}` end end |