Class: Avm::EacRedmineBase0::Sources::CoreUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/eac_redmine_base0/sources/core_update.rb

Constant Summary collapse

GITIGNORE_ADD =
%w[/public/assets/**/* /config/install.sh /config/secrets_key.txt
/log/**/*].freeze
GITIGNORE_DEL =
%w[/Gemfile.lock /plugins/* /public/themes/*].freeze
TARGET_KEEP =
::Avm::Sources::Base::Configuration::CONFIGURATION_FILENAMES
.map { |b| "/#{b}" } + %w[/Gemfile.lock].freeze

Instance Method Summary collapse

Instance Method Details

#assert_source_packageObject



36
37
38
39
40
41
# File 'lib/avm/eac_redmine_base0/sources/core_update.rb', line 36

def assert_source_package
  infom 'Asserting source package...'
  source_package.assert
  infov 'Package cache path', source_package.path
  infov 'Package size', source_package.path.size
end

#fs_object_idObject



43
44
45
# File 'lib/avm/eac_redmine_base0/sources/core_update.rb', line 43

def fs_object_id
  [source.path, version].join('_').variableize
end

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/avm/eac_redmine_base0/sources/core_update.rb', line 23

def run
  ::EacRubyUtils::Fs::Temp.on_directory do |dir|
    @tempdir = dir
    assert_source_package
    extract_package_to_tempdir
    sync_content
    change_git_ignore
    validate_empty_dir
  end
  git_commit
  success 'Done!'
end