Sha256: 72ef03dbb24e9a2753cc29b3bfdad6b54c24177346b4d69aed56ffd890285d89

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 Bytes

Contents

require_relative 'agent'
require_relative 'assigner'

module Deputy53
  # CommandLine Interface
  class CLI
    def delegate(subdomain)
      Agent.new(subdomain).delegate
    end

    def assign(subdomain, user = nil)
      subdomain = "#{subdomain}." unless subdomain.end_with? '.'
      user ||= subdomain.split('.').slice(0..-3).join('.')
      Assigner.new.assign(subdomain, user)
    end

    def policy(subdomain)
      subdomain = "#{subdomain}." unless subdomain.end_with? '.'
      Assigner.new.policy(subdomain)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
deputy53-0.13.5 lib/deputy53/cli.rb
deputy53-0.13.0 lib/deputy53/cli.rb