Sha256: 041e8f03de43386225fa19e6c4a65f85f0aa737d5437c07517b4791ddd0eb0c9

Contents?: true

Size: 862 Bytes

Versions: 15

Compression:

Stored size: 862 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

15 entries across 15 versions & 2 rubygems

Version Path
redcar-dev-0.12.8dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.7dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.6dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.4dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.3dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.1dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.0dev-java plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.11 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.11.0dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.10 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.9.2 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.9.1 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.9.0 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.8.1 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.8 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb