Sha256: e626df6b90eeb197975fe01f9090a124c4fe73b91128f63f090a2b8339e762c2

Contents?: true

Size: 541 Bytes

Versions: 6

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

module Neptuno
  module TTY
    # Wrapper class for TTY gem
    module Config
      TTY = ::TTY::Config.new
      TTY.filename = 'neptuno'

      ABORT_MESSAGE = 'fatal: there are no registered services. Add one with: neptuno services add'

      def config
        TTY
      end

      def services
        s = config.fetch('services')
        abort ABORT_MESSAGE if s.count.zero?
        s.sort
      end

      def configured_services
        config.fetch('configured_services')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
neptuno-1.0.6 lib/neptuno/tty/config.rb
neptuno-1.0.5 lib/neptuno/tty/config.rb
neptuno-1.0.3 lib/neptuno/tty/config.rb
neptuno-1.0.2 lib/neptuno/tty/config.rb
neptuno-1.0.1 lib/neptuno/tty/config.rb
neptuno-1.0.0 lib/neptuno/tty/config.rb