Module: Avm::EacRubyBase1::Sources::Base::Bundler
- Defined in:
- lib/avm/eac_ruby_base1/sources/base/bundler.rb
Constant Summary collapse
- CONFIGURED_GEMFILE_PATH_ENTRY_KEY =
'ruby.gemfile_path'
- DEFAULT_GEMFILE_PATH =
'Gemfile'
Instance Method Summary collapse
- #bundle(*args) ⇒ Avm::EacRubyBase1::Sources::Base::BundleCommand
- #bundle_update ⇒ Avm::EacRubyBase1::Sources::BundleUpdate
- #configured_gemfile_path ⇒ String
- #default_gemfile_path ⇒ String
- #gemfile_lock_content ⇒ Bundler::LockfileParser
- #gemfile_lock_gem_version(gem_name) ⇒ Object
- #gemfile_lock_path ⇒ Pathname
- #gemfile_path ⇒ Pathname
Instance Method Details
#bundle(*args) ⇒ Avm::EacRubyBase1::Sources::Base::BundleCommand
17 18 19 20 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 17 def bundle(*args) ::Avm::EacRubyBase1::Sources::Base::BundleCommand.new(self, %w[bundle] + args) .envvar_gemfile end |
#bundle_update ⇒ Avm::EacRubyBase1::Sources::BundleUpdate
23 24 25 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 23 def bundle_update ::Avm::EacRubyBase1::Sources::BundleUpdate.new(self) end |
#configured_gemfile_path ⇒ String
28 29 30 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 28 def configured_gemfile_path configuration_entry(CONFIGURED_GEMFILE_PATH_ENTRY_KEY).value end |
#default_gemfile_path ⇒ String
33 34 35 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 33 def default_gemfile_path DEFAULT_GEMFILE_PATH end |
#gemfile_lock_content ⇒ Bundler::LockfileParser
38 39 40 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 38 def gemfile_lock_content ::Bundler::LockfileParser.new(::Bundler.read_file(gemfile_lock_path)) end |
#gemfile_lock_gem_version(gem_name) ⇒ Object
42 43 44 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 42 def gemfile_lock_gem_version(gem_name) gemfile_lock_content.specs.find { |gem| gem.name == gem_name }.if_present(&:version) end |
#gemfile_lock_path ⇒ Pathname
47 48 49 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 47 def gemfile_lock_path gemfile_path.basename_sub { |b| "#{b}.lock" } end |
#gemfile_path ⇒ Pathname
52 53 54 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 52 def gemfile_path path.join(configured_gemfile_path || default_gemfile_path) end |