Class: EacCli::RunnerWithSet

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_cli/runner_with_set.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultObject



8
9
10
# File 'lib/eac_cli/runner_with_set.rb', line 8

def default
  @default ||= new
end

Instance Method Details

#add_from_gems_registryObject



19
20
21
22
23
# File 'lib/eac_cli/runner_with_set.rb', line 19

def add_from_gems_registry
  ::EacRubyUtils::GemsRegistry.new('RunnerWith').registered.each do |registered_gem|
    add_namespace(registered_gem.registered_module)
  end
end

#add_namespace(namespace) ⇒ Object



13
14
15
16
17
# File 'lib/eac_cli/runner_with_set.rb', line 13

def add_namespace(namespace)
  namespace = sanitize_namespace(namespace)
  namespace_set << namespace unless namespace_set.include?(namespace)
  self
end

#item_to_module(item) ⇒ Object



25
26
27
# File 'lib/eac_cli/runner_with_set.rb', line 25

def item_to_module(item)
  item.is_a?(::Module) ? item : key_to_module(item)
end

#namespacesObject



29
30
31
# File 'lib/eac_cli/runner_with_set.rb', line 29

def namespaces
  namespace_set.dup
end