Sha256: e2d029bccc19cb1a7fea2b4222e8c61e6a724a9b05294293e64ef576d7c60a23

Contents?: true

Size: 570 Bytes

Versions: 24

Compression:

Stored size: 570 Bytes

Contents

require_relative "process_set"

module Eye::Patch

  class GroupSet < Hash

    def initialize(application, processes)
      @application = application

      Array(processes).group_by{ |item| item[:group] }.each do |group_name, items|
        name = group_name || "__default__"
        parse_group(name, items)
      end
    end

    private

    def parse_group(name, processes)
      self[name] = @application.merge(
        name: name,
        application: @application[:name])

      self[name][:processes] = ProcessSet.new(self[name], processes)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
eye-patch-0.5.1 lib/eye/patch/group_set.rb
eye-patch-0.5.0 lib/eye/patch/group_set.rb
eye-patch-0.4.2 lib/eye/patch/group_set.rb
eye-patch-0.4.1 lib/eye/patch/group_set.rb
eye-patch-0.4.0 lib/eye/patch/group_set.rb
eye-patch-0.3.1 lib/eye/patch/group_set.rb
eye-patch-0.3.0 lib/eye/patch/group_set.rb
eye-patch-0.2.2 lib/eye/patch/group_set.rb
eye-patch-0.2.1 lib/eye/patch/group_set.rb
eye-patch-0.2.0 lib/eye/patch/group_set.rb
eye-patch-0.1.8 lib/eye/patch/group_set.rb
eye-patch-0.1.7 lib/eye/patch/group_set.rb
eye-patch-0.1.6 lib/eye/patch/group_set.rb
eye-patch-0.1.5 lib/eye/patch/group_set.rb
eye-patch-0.1.4 lib/eye/patch/group_set.rb
eye-patch-0.1.3 lib/eye/patch/group_set.rb
eye-patch-0.1.2 lib/eye/patch/group_set.rb
eye-patch-0.1.1 lib/eye/patch/group_set.rb
eye-patch-0.1.0 lib/eye/patch/group_set.rb
eye-patch-0.0.9 lib/eye/patch/group_set.rb