Sha256: 1e46f4a51d9a3a0b45b5d7563317739f8c89a12bc6bd92bd9adca6570f35c694

Contents?: true

Size: 697 Bytes

Versions: 37

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

require 'avm/data/instance/unit'
require 'eac_ruby_utils/core_ext'
require 'open-uri'

module Avm
  module Stereotypes
    module EacRedmineBase0
      class DataUnit < ::Avm::Data::Instance::Unit
        common_constructor :instance

        EXTENSION = '.tar'

        def do_dump(data_path)
          ::File.open(data_path, 'wb') do |file|
            file << URI.parse(export_url).read
          end
        end

        def export_url
          uri = ::Addressable::URI.parse(instance.read_entry('web.url')) + '/backup/export'
          uri.query_values = { key: instance.read_entry('admin.api_key') }
          uri.to_s
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
avm-tools-0.61.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.60.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.59.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.58.1 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.58.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.57.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.56.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.55.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.54.2 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.54.1 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.54.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.53.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.52.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.51.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.50.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.49.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.48.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.47.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.46.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
avm-tools-0.45.0 lib/avm/stereotypes/eac_redmine_base0/data_unit.rb