Sha256: 8e1aa6be6f7f82989818a72d462a9852e5fc134c483da0e03044255efbfc4669

Contents?: true

Size: 861 Bytes

Versions: 28

Compression:

Stored size: 861 Bytes

Contents

module Redcar
  class Runnables
    class RunnableTypeGroup < RunnableGroup
      def initialize(name)
        name_parts = name.split("/")
        @text = name_parts.first
        @runnables = []
        @subgroups = {}
      end

      # Return the type group that corresponds to the passed name-path, or self, if name is empty
      # If a child with the specified path does not exist, create it and clear the children cache
      def type_group(name)
        return super unless name.empty?
        self
      end

      # Add a runnable to the children
      # Tries to avoid re-building the children array
      def add_runnable(runnable)
        @children << runnable unless @children.nil?
        return @runnables << runnable
      end

      def icon
        File.join(Redcar.icons_directory, "folder-open-small-gears.png")
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
redcar-dev-0.12.16dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.15dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.14dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.13dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.12dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.11dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.10dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.9dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb