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
- #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
16 17 18 19 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 16 def bundle(*args) ::Avm::EacRubyBase1::Sources::Base::BundleCommand.new(self, %w[bundle] + args) .envvar_gemfile end |
#configured_gemfile_path ⇒ String
22 23 24 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 22 def configured_gemfile_path configuration.entry(CONFIGURED_GEMFILE_PATH_ENTRY_KEY).value end |
#default_gemfile_path ⇒ String
27 28 29 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 27 def default_gemfile_path DEFAULT_GEMFILE_PATH end |
#gemfile_lock_content ⇒ Bundler::LockfileParser
32 33 34 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 32 def gemfile_lock_content ::Bundler::LockfileParser.new(::Bundler.read_file(gemfile_lock_path)) end |
#gemfile_lock_gem_version(gem_name) ⇒ Object
36 37 38 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 36 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
41 42 43 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 41 def gemfile_lock_path gemfile_path.basename_sub { |b| "#{b}.lock" } end |
#gemfile_path ⇒ Pathname
46 47 48 |
# File 'lib/avm/eac_ruby_base1/sources/base/bundler.rb', line 46 def gemfile_path path.join(configured_gemfile_path || default_gemfile_path) end |