Sha256: 33bfe6ca2b97e9cfc09b2aa670a34cdfa7da6b43ba35612289948dec00a74f5d

Contents?: true

Size: 1000 Bytes

Versions: 9

Compression:

Stored size: 1000 Bytes

Contents

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

    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')
      @runtime_file = 'gorgon-runtime-file.json'
    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

9 entries across 9 versions & 1 rubygems

Version Path
gorgon-0.11.0 lib/gorgon/settings/files_content.rb
gorgon-0.10.5 lib/gorgon/settings/files_content.rb
gorgon-0.10.4 lib/gorgon/settings/files_content.rb
gorgon-0.10.3 lib/gorgon/settings/files_content.rb
gorgon-0.10.2 lib/gorgon/settings/files_content.rb
gorgon-0.10.1 lib/gorgon/settings/files_content.rb
gorgon-0.10.0 lib/gorgon/settings/files_content.rb
gorgon-0.9.0 lib/gorgon/settings/files_content.rb
gorgon-0.8.4 lib/gorgon/settings/files_content.rb