Sha256: 3c046f729ed0d2fbaf699425436efe9b4a79e999bf4944b5b9db0b9a8a82eeb5

Contents?: true

Size: 1.49 KB

Versions: 68

Compression:

Stored size: 1.49 KB

Contents

# frozen_string_literal: true

require 'avm/eac_rails_base1/instances/base'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacRedmineBase0
    module Instances
      class Base < ::Avm::EacRailsBase1::Instances::Base
        module Gitolite
          GITOLITE_ENTRY_KEYS_PREFIX = 'gitolite'
          DEFAULT_HOSTNAME = 'localhost'
          DEFAULT_PATH_PARENT = '/var/lib'
          DEFAULT_SCHEME = 'file'
          DEFAULT_USERNAME = 'git'

          common_concern do
            uri_components_entries_values GITOLITE_ENTRY_KEYS_PREFIX
          end

          # @return [Avm::Instances::Data::FilesUnit]
          def gitolite_data_unit
            ::Avm::Instances::Data::FilesUnit.new(self, gitolite_repositories_path,
                                                  sudo_user: entry('gitolite.username').value!)
          end

          def gitolite_hostname_default_value
            DEFAULT_HOSTNAME
          end

          def gitolite_path_default_value
            read_entry_optional([GITOLITE_ENTRY_KEYS_PREFIX, 'username']).if_present do |v|
              ::File.join(DEFAULT_PATH_PARENT, v)
            end
          end

          # @return [Pathname]
          def gitolite_repositories_path
            entry('gitolite.path').value!.to_pathname.join('repositories')
          end

          def gitolite_scheme_default_value
            DEFAULT_SCHEME
          end

          def gitolite_username_default_value
            DEFAULT_USERNAME
          end
        end
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 2 rubygems

Version Path
eac_tools-0.48.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb
avm-eac_redmine_base0-0.18.0 lib/avm/eac_redmine_base0/instances/base/gitolite.rb
eac_tools-0.48.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb
eac_tools-0.47.2 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb
eac_tools-0.47.1 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb
eac_tools-0.47.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb
avm-eac_redmine_base0-0.17.0 lib/avm/eac_redmine_base0/instances/base/gitolite.rb
eac_tools-0.46.0 sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb