Sha256: 8d0622fe8c3c73e136b32180ce31fd0d363845812b9e480e6884968aa4d97309

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

require "dry/validation"

require "copypasta/parameter_definition"

module Copypasta
  class Settings
    attr_reader :parameter_definitions

    def initialize
      @parameter_definitions = {}
    end

    def self.from_file(path)
      require "copypasta/settings_dsl"
      raise "#{path} doesn't exist." unless File.exist?(path)

      dsl = Copypasta::SettingsDSL.new
      dsl.instance_eval File.read(path), path
      dsl.settings
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
copypasta-0.1.1 lib/copypasta/settings.rb
copypasta-0.1.0 lib/copypasta/settings.rb