Sha256: a08a22e1f622a13821fede501b89b63ec1badbdf0417e1009fb53cd0afed89a4

Contents?: true

Size: 921 Bytes

Versions: 3

Compression:

Stored size: 921 Bytes

Contents

module Settings
  class FilesContent
    attr_accessor :amqp_host, :file_server_host, :sync_exclude, :files, :originator_log_file,
      :callbacks

    TEST_UNIT_GLOB = "test/**/*_test.rb"
    RSPEC_GLOB = "spec/**/*_spec.rb"

    def initialize
      @files = []
      @files << FilesContent::TEST_UNIT_GLOB if Dir.exist?('test')
      @files << FilesContent::RSPEC_GLOB if Dir.exist?('spec')
    end

    DEFAULT_HOST = 'localhost'
    def self.get_amqp_host
      puts "What's the AMQP host name? (leave blank to use '#{DEFAULT_HOST}') "
      return get_input_or_default(DEFAULT_HOST)
    end

    def self.get_file_server_host
      puts "What's the File Server host name? (leave blank to use '#{DEFAULT_HOST}') "
      return get_input_or_default(DEFAULT_HOST)
    end

    private

    def self.get_input_or_default(default)
      input = $stdin.gets.chomp
      (input == '') ? default : input
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gorgon-0.8.3 lib/gorgon/settings/files_content.rb
gorgon-0.8.2 lib/gorgon/settings/files_content.rb
gorgon-0.8.1 lib/gorgon/settings/files_content.rb