Class: Quandl::Sandbox::Repository::Script
- Inherits:
-
Object
- Object
- Quandl::Sandbox::Repository::Script
- Defined in:
- lib/quandl/sandbox/repository.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
- #before_execute ⇒ Object
- #bundle ⇒ Object
- #checkout ⇒ Object
- #clone ⇒ Object
- #execute ⇒ Object
-
#initialize(repo) ⇒ Script
constructor
A new instance of Script.
- #pull ⇒ Object
- #r ⇒ Object
Constructor Details
#initialize(repo) ⇒ Script
Returns a new instance of Script.
32 33 34 |
# File 'lib/quandl/sandbox/repository.rb', line 32 def initialize(repo) self.repository = repo end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
30 31 32 |
# File 'lib/quandl/sandbox/repository.rb', line 30 def repository @repository end |
Instance Method Details
#before_execute ⇒ Object
36 37 38 |
# File 'lib/quandl/sandbox/repository.rb', line 36 def before_execute [ clone, checkout, pull, bundle ].join("\n") end |
#bundle ⇒ Object
57 58 59 |
# File 'lib/quandl/sandbox/repository.rb', line 57 def bundle "cd #{r.full_path}; bundle update" end |
#checkout ⇒ Object
48 49 50 51 |
# File 'lib/quandl/sandbox/repository.rb', line 48 def checkout %Q{ cd #{r.full_path} git checkout -b "#{r.ref}"} end |
#clone ⇒ Object
44 45 46 |
# File 'lib/quandl/sandbox/repository.rb', line 44 def clone %Q{git clone "#{r.git}" "#{r.full_path}"} end |
#execute ⇒ Object
40 41 42 |
# File 'lib/quandl/sandbox/repository.rb', line 40 def execute "cd #{r.full_path}; bundle exec ruby import.rb" end |
#pull ⇒ Object
53 54 55 |
# File 'lib/quandl/sandbox/repository.rb', line 53 def pull %Q{ cd #{r.full_path}; git pull origin "#{r.ref}" } end |
#r ⇒ Object
61 62 63 |
# File 'lib/quandl/sandbox/repository.rb', line 61 def r repository end |