Sha256: a530911f8e5a4aab4bbc05baa24cf1569a6a9dc09b8e2fccd02b193d93f19340

Contents?: true

Size: 410 Bytes

Versions: 26

Compression:

Stored size: 410 Bytes

Contents

module Datapimp
  module Util
    def self.load_config_file(at_path)
      at_path = Pathname(at_path)
      extension = at_path.extname.to_s.downcase

      raise 'No config file exists at: ' + at_path.to_s unless at_path.exist?

      if extension == '.yml' || extension == '.yaml'
        YAML.load_file(at_path)
      elsif extension == '.json'
        JSON.parse(at_path.read)
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
datapimp-1.2.11 lib/datapimp/util.rb
datapimp-1.2.10 lib/datapimp/util.rb
datapimp-1.2.9 lib/datapimp/util.rb
datapimp-1.2.8 lib/datapimp/util.rb
datapimp-1.2.7 lib/datapimp/util.rb
datapimp-1.2.6 lib/datapimp/util.rb
datapimp-1.2.5 lib/datapimp/util.rb
datapimp-1.2.4 lib/datapimp/util.rb
datapimp-1.2.3 lib/datapimp/util.rb
datapimp-1.2.2 lib/datapimp/util.rb
datapimp-1.2.1 lib/datapimp/util.rb
datapimp-1.2.0 lib/datapimp/util.rb
datapimp-1.1.1 lib/datapimp/util.rb
datapimp-1.1.0 lib/datapimp/util.rb
datapimp-1.0.29 lib/datapimp/util.rb
datapimp-1.0.28 lib/datapimp/util.rb
datapimp-1.0.27 lib/datapimp/util.rb
datapimp-1.0.26 lib/datapimp/util.rb
datapimp-1.0.25 lib/datapimp/util.rb
datapimp-1.0.24 lib/datapimp/util.rb