Class: Util::Git
- Inherits:
-
Object
- Object
- Util::Git
- Defined in:
- lib/utilities/utils.rb
Overview
-
GIT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Instance Method Summary collapse
-
#init(path) ⇒ Object
3.2.
-
#install(path, repository, target, dest) ⇒ Object
3.1.
-
#remote(path, remote) ⇒ Object
3.3.
Instance Method Details
#init(path) ⇒ Object
3.2. GIT INIT ————————————————————
211 212 213 214 215 216 217 218 219 |
# File 'lib/utilities/utils.rb', line 211 def init(path) FileUtils.cd(path) do `git init` end end |
#install(path, repository, target, dest) ⇒ Object
3.1. GIT INSTALL ———————————————————
197 198 199 200 201 202 203 204 205 |
# File 'lib/utilities/utils.rb', line 197 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
3.3. GIT REMOTE ———————————————————-
225 226 227 228 229 230 231 232 233 |
# File 'lib/utilities/utils.rb', line 225 def remote(path, remote) FileUtils.cd(path) do `git remote add origin #{remote}` end end |