Sha256: 94670648d0800e790375dca5470dde249ebe4e46dc57fd1ad345a4c9a2ec36f7

Contents?: true

Size: 706 Bytes

Versions: 9

Compression:

Stored size: 706 Bytes

Contents

module MetricFu::Templates
  class Configuration

    FILE_PREFIX = 'file:/'

    def initialize
      @options = {}
      @options[:template_class] = AwesomeTemplate
      @options[:darwin_txmt_protocol_no_thanks] = true
      # turning off syntax_highlighting may avoid some UTF-8 issues
      @options[:syntax_highlighting] = true
      @options[:link_prefix] = FILE_PREFIX
    end

    [:template_class, :link_prefix, :syntax_highlighting, :darwin_txmt_protocol_no_thanks].each do |option|
      define_method("#{option}=") do |arg|
        @options[option] = arg
      end
    end

    def option(name)
      @options.fetch(name.to_sym) { raise "No such template option: #{name}" }
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
metric_fu-4.10.0 lib/metric_fu/templates/configuration.rb
metric_fu-4.9.0 lib/metric_fu/templates/configuration.rb
metric_fu-4.8.0 lib/metric_fu/templates/configuration.rb
metric_fu-4.7.4 lib/metric_fu/templates/configuration.rb
metric_fu-4.7.3 lib/metric_fu/templates/configuration.rb
metric_fu-4.7.2 lib/metric_fu/templates/configuration.rb
metric_fu-4.7.1 lib/metric_fu/templates/configuration.rb
metric_fu-4.7.0 lib/metric_fu/templates/configuration.rb
metric_fu-4.6.0 lib/metric_fu/templates/configuration.rb