Sha256: 9a10955ad36fd5cc10cd29b6a946456d899ad92b552fbce19fb0feef68df3956
Contents?: true
Size: 1.73 KB
Versions: 3
Compression:
Stored size: 1.73 KB
Contents
# frozen_string_literal: true require "parallel" module Miteru class Configuration # @return [Boolean] attr_accessor :auto_download # @return [Boolean] attr_accessor :ayashige # @return [Boolean] attr_accessor :directory_traveling # @return [String] attr_accessor :download_to # @return [Boolean] attr_accessor :post_to_slack # @return [Integer] attr_accessor :size # @return [Integer] attr_accessor :threads # @return [Boolean] attr_accessor :verbose attr_reader :valid_extensions attr_reader :valid_mime_types def initialize @auto_download = false @ayashige = false @directory_traveling = false @download_to = "/tmp" @post_to_slack = false @size = 100 @threads = Parallel.processor_count @verbose = false @valid_extensions = [".zip", ".rar", ".7z", ".tar", ".gz"].freeze @valid_mime_types = ["application/zip", "application/vnd.rar", "application/x-7z-compressed", "application/x-tar", "application/gzip"] end def auto_download? @auto_download end def ayashige? @ayashige end def directory_traveling? @directory_traveling end def post_to_slack? @post_to_slack end def verbose? @verbose end end class << self # @return [Miteru::Configuration] Miteru's current configuration def configuration @configuration ||= Configuration.new end # Set Miteru's configuration # @param config [Miteru::Configuration] attr_writer :configuration # Modify Miteru's current configuration # @yieldparam [Miteru::Configuration] config current Miteru config def configure yield configuration end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
miteru-0.14.7 | lib/miteru/configuration.rb |
miteru-0.14.6 | lib/miteru/configuration.rb |
miteru-0.14.5 | lib/miteru/configuration.rb |