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-0.13 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.13.5dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.13.4dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.13.3dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.13.2dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.13.1dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.12.1 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.13.0dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-0.12 plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.27dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.26dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.25dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.24dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.23dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.22dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.21dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.20dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.19dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.18dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb
redcar-dev-0.12.17dev plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb