Sha256: ae4ed86c1c9d15c740a11e994eb8fb40542588855aaa813be4ad71e8616412bf

Contents?: true

Size: 408 Bytes

Versions: 1

Compression:

Stored size: 408 Bytes

Contents

# frozen_string_literal: true

require 'yaml'

module GistUpdater
  class Config
    def initialize(file)
      @file = file
    end

    def each
      return enum_for(:each) unless block_given?

      config.each do |c|
        yield(gist_id: c.first, file_paths: c.drop(1))
      end
    end

    private

    attr_reader :file

    def config
      @config ||= YAML.load(IO.read(file))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gist_updater-0.3.0 lib/gist_updater/config.rb