Class: Rubypack::BundlerController
- Inherits:
-
Object
- Object
- Rubypack::BundlerController
- Defined in:
- lib/rubypack/bundler_controller.rb
Instance Method Summary collapse
-
#initialize(path:) ⇒ BundlerController
constructor
A new instance of BundlerController.
- #install ⇒ Object
- #package ⇒ Object
Constructor Details
#initialize(path:) ⇒ BundlerController
Returns a new instance of BundlerController.
4 5 6 |
# File 'lib/rubypack/bundler_controller.rb', line 4 def initialize(path:) @path = path end |
Instance Method Details
#install ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rubypack/bundler_controller.rb', line 22 def install begin Dir.chdir(@path) do IO.popen(['bundle', 'install', '--local', '--deployment', err: [:child, :out]]) do |out| yield(out) end fail("bundle install failed: #{$?.exitstatus}") unless $?.exitstatus == 0 true end rescue => error fail("Error executing bundle install: #{error.message}") end end |
#package ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rubypack/bundler_controller.rb', line 8 def package begin Dir.chdir(@path) do IO.popen(['bundle', 'package', '--all-platforms', '--all', err: [:child, :out]]) do |out| yield(out) end fail("bundle package failed: #{$?.exitstatus}") unless $?.exitstatus == 0 true end rescue => error fail("Error executing bundle package: #{error.message}") end end |