Module: Bait::BuildHelper
- Included in:
- Build
- Defined in:
- lib/bait/build_helper.rb
Instance Method Summary collapse
- #bait_dir ⇒ Object
- #cleanup! ⇒ Object
- #clone_path ⇒ Object
- #cloned? ⇒ Boolean
- #passed? ⇒ Boolean
- #queued? ⇒ Boolean
- #sandbox_directory ⇒ Object
- #script(name) ⇒ Object
Instance Method Details
#bait_dir ⇒ Object
15 16 17 |
# File 'lib/bait/build_helper.rb', line 15 def bait_dir File.join(clone_path, ".bait") end |
#cleanup! ⇒ Object
27 28 29 |
# File 'lib/bait/build_helper.rb', line 27 def cleanup! FileUtils.rm_rf(sandbox_directory) if Dir.exists?(sandbox_directory) end |
#clone_path ⇒ Object
11 12 13 |
# File 'lib/bait/build_helper.rb', line 11 def clone_path File.join(sandbox_directory, self.name) end |
#cloned? ⇒ Boolean
23 24 25 |
# File 'lib/bait/build_helper.rb', line 23 def cloned? Dir.exists? File.join(clone_path, ".git/") end |
#passed? ⇒ Boolean
7 8 9 |
# File 'lib/bait/build_helper.rb', line 7 def passed? self.reload.status == "passed" end |
#queued? ⇒ Boolean
3 4 5 |
# File 'lib/bait/build_helper.rb', line 3 def queued? self.reload.status == "queued" end |
#sandbox_directory ⇒ Object
31 32 33 |
# File 'lib/bait/build_helper.rb', line 31 def sandbox_directory File.join Bait.storage_dir, "tester", self.name, self.id end |
#script(name) ⇒ Object
19 20 21 |
# File 'lib/bait/build_helper.rb', line 19 def script name File.join(bait_dir, name) end |