Class: CobraCommander::Ruby::Bundle
- Inherits:
-
Object
- Object
- CobraCommander::Ruby::Bundle
- Defined in:
- lib/cobra_commander/ruby/bundle.rb
Overview
Calculates ruby bundler dependencies
Instance Method Summary collapse
-
#around_command ⇒ Object
Runs the command with the ambient Bundler environment stripped, so a nested ‘bundle` call resolves the package’s own bundle rather than cobra’s, and points BUNDLE_APP_CONFIG at the umbrella’s .bundle directory so that bundle config is read from the umbrella.
- #packages ⇒ Object
Instance Method Details
#around_command ⇒ Object
Runs the command with the ambient Bundler environment stripped, so a nested ‘bundle` call resolves the package’s own bundle rather than cobra’s, and points BUNDLE_APP_CONFIG at the umbrella’s .bundle directory so that bundle config is read from the umbrella. Only the ruby plugin isolates the bundle this way.
27 28 29 30 31 |
# File 'lib/cobra_commander/ruby/bundle.rb', line 27 def around_command ::Bundler.with_unbundled_env do yield({ "BUNDLE_APP_CONFIG" => path.join(".bundle").to_s }) end end |
#packages ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cobra_commander/ruby/bundle.rb', line 11 def packages specs.map do |spec| ::CobraCommander::Package.new( self, name: spec.name, path: Pathname.new(spec.loaded_from).dirname, dependencies: spec.dependencies.map(&:name) & specs.map(&:name) ) end end |