Sha256: b2c848fafed1e2620787725c83f6fffc62288fc0041030b7743b6b81d136ce48

Contents?: true

Size: 828 Bytes

Versions: 34

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true

# takelage bit check workspace
module BitCheckWorkspace
  # Backend method for bit check workspace.
  # @return [Boolean] is this a bit workspace?
  def bit_check_workspace
    log.debug 'Check if this is a bit workspace'

    status_repo = _bit_check_workspace_bit_repo
    return true if status_repo.exitstatus.zero?

    dir = _bit_check_workspace_dir
    log.debug "No bit workspace found in \"#{dir}\""
    false
  end

  private

  # Check bit repo.
  def _bit_check_workspace_bit_repo
    cmd_bit_repo =
      config.active['cmd_bit_check_workspace_bit_list']

    try cmd_bit_repo
  end

  # Get current working directory.
  def _bit_check_workspace_dir
    cmd_pwd =
      config.active['cmd_bit_check_workspace_pwd']

    stdout_str_dir = run cmd_pwd

    stdout_str_dir.strip
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
takelage-0.26.4 lib/takelage/bit/check/workspace.rb
takelage-0.26.3 lib/takelage/bit/check/workspace.rb
takelage-0.26.2 lib/takelage/bit/check/workspace.rb
takelage-0.25.10 lib/takelage/bit/check/workspace.rb
takelage-0.25.8 lib/takelage/bit/check/workspace.rb
takelage-0.24.0 lib/takelage/bit/check/workspace.rb
takelage-0.23.3 lib/takelage/bit/check/workspace.rb
takelage-0.23.2 lib/takelage/bit/check/workspace.rb
takelage-0.23.1 lib/takelage/bit/check/workspace.rb
takelage-0.23.0 lib/takelage/bit/check/workspace.rb
takelage-0.22.2 lib/takelage/bit/check/workspace.rb
takelage-0.22.1 lib/takelage/bit/check/workspace.rb
takelage-0.22.0 lib/takelage/bit/check/workspace.rb
takelage-0.21.1 lib/takelage/bit/check/workspace.rb
takelage-0.21.0 lib/takelage/bit/check/workspace.rb
takelage-0.20.2 lib/takelage/bit/check/workspace.rb
takelage-0.20.1 lib/takelage/bit/check/workspace.rb
takelage-0.20.0 lib/takelage/bit/check/workspace.rb
takelage-0.19.2 lib/takelage/bit/check/workspace.rb
takelage-0.19.1 lib/takelage/bit/check/workspace.rb