Module: BitScopeNew

Included in:
Takelage::BitScope
Defined in:
lib/takelage/bit/scope/new.rb

Overview

takelage bit scope new

Instance Method Summary collapse

Instance Method Details

#bit_scope_new(scope) ⇒ Int

Backend method for bit scope new.

Returns:

  • (Int)

    status of new command



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/takelage/bit/scope/new.rb', line 7

def bit_scope_new(scope)
  log.debug "Creating new bit remote scope \"#{scope}\""

  return false unless configured? %w[bit_ssh bit_remote]

  return false if _bit_scope_new_scope_exists? scope

  cmd_bit_ssh = config.active['bit_ssh']

  cmd_bit_scope_new = _bit_scope_new_cmd scope

  run "#{cmd_bit_ssh} '#{cmd_bit_scope_new}'"

  log.info "Created new bit remote scope \"#{scope}\""
end