Sha256: e7dd965435c089c47df64fdd09f45fc3daf7901de1cdc39b77085af8d6360a32

Contents?: true

Size: 1.06 KB

Versions: 34

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module EacRubyBase1
    module Sources
      class Update
        require_sub __FILE__
        enable_simple_cache
        enable_speaker
        common_constructor :source do
          perform
        end

        def bundle_update
          infom 'Running "bundle update"...'
          source.bundle('update').execute!
          infom 'Running "bundle install"...'
          source.bundle('install').execute!
        end

        protected

        def perform
          update_gemfile_lock
          update_subs
        end

        def update_gemfile_lock
          source.scm.commit_if_change(-> { update_gemfile_lock_commit_message }) do
            bundle_update
          end
        end

        def update_gemfile_lock_commit_message
          i18n_translate(__method__, __locale: source.locale)
        end

        def update_subs
          source.subs.each do |sub|
            ::Avm::EacRubyBase1::Sources::Update::SubUpdate.new(self, sub)
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
avm-eac_ruby_base1-0.18.0 lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.21.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
avm-eac_ruby_base1-0.17.0 lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.20.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
avm-eac_ruby_base1-0.16.0 lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.19.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.18.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
avm-eac_ruby_base1-0.15.0 lib/avm/eac_ruby_base1/sources/update.rb
avm-eac_ruby_base1-0.13.0 lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.17.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.16.1 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.16.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.15.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.14.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
avm-eac_ruby_base1-0.12.0 lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.13.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.12.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.11.1 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.11.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb
eac_tools-0.10.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb