Sha256: e784ff6d4f5363e49d24f47321f23927227a818b0ce7ae0b45a0b7f09ca5fc4e

Contents?: true

Size: 971 Bytes

Versions: 6

Compression:

Stored size: 971 Bytes

Contents

module Rubycritic
  class Configuration
    attr_reader :root
    attr_accessor :source_control_system, :mode, :format, :deduplicate_symlinks,
                  :suppress_ratings, :open_with, :no_browser

    def set(options)
      self.mode = options[:mode] || :default
      self.root = options[:root] || 'tmp/rubycritic'
      self.format = options[:format] || :html
      self.deduplicate_symlinks = options[:deduplicate_symlinks] || false
      self.suppress_ratings = options[:suppress_ratings] || false
      self.open_with = options[:open_with]
      self.no_browser = options[:no_browser]
    end

    def root=(path)
      @root = File.expand_path(path)
    end
  end

  module Config
    def self.configuration
      @configuration ||= Configuration.new
    end

    def self.set(options = {})
      configuration.set(options)
    end

    def self.method_missing(method, *args, &block)
      configuration.public_send(method, *args, &block)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubycritic-2.9.2 lib/rubycritic/configuration.rb
rubycritic-2.9.1 lib/rubycritic/configuration.rb
rubycritic-2.9.0 lib/rubycritic/configuration.rb
rubycritic-2.8.0 lib/rubycritic/configuration.rb
rubycritic-2.7.1 lib/rubycritic/configuration.rb
rubycritic-2.7.0 lib/rubycritic/configuration.rb