Class: Qas::Grab
- Inherits:
-
Object
- Object
- Qas::Grab
- Defined in:
- lib/qas/grab.rb
Overview
Grab FLOSS Projects
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(project) ⇒ Grab
constructor
A new instance of Grab.
- #pull ⇒ Object
-
#run ⇒ Object
Cloning/Pulling FLOSS Project.
Constructor Details
#initialize(project) ⇒ Grab
Returns a new instance of Grab.
10 11 12 |
# File 'lib/qas/grab.rb', line 10 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
8 9 10 |
# File 'lib/qas/grab.rb', line 8 def project @project end |
Instance Method Details
#clone ⇒ Object
21 22 23 24 25 |
# File 'lib/qas/grab.rb', line 21 def clone Utils.spin(project.name) do Git.clone project.url, project.folder end end |
#pull ⇒ Object
14 15 16 17 18 19 |
# File 'lib/qas/grab.rb', line 14 def pull Utils.spin(project.name) do repo = Git.open project.folder repo.pull 'origin', repo.current_branch end end |
#run ⇒ Object
Cloning/Pulling FLOSS Project
28 29 30 |
# File 'lib/qas/grab.rb', line 28 def run project.folder.join('.git').exist? ? pull : clone end |