Module: Domakase

Defined in:
lib/domakase.rb,
lib/domakase/record.rb,
lib/domakase/version.rb,
lib/domakase/controller.rb,
lib/generators/domakase/domain/actions.rb,
lib/generators/domakase/domain_generator.rb,
lib/generators/domakase/domain/model_generator.rb,
lib/generators/domakase/domain/controller_generator.rb

Defined Under Namespace

Modules: Generators Classes: Controller, InvalidDomainPath, Record

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.register!(name) ⇒ Object

Raises:



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/domakase.rb', line 15

def register!(name)
  path = ::Rails.root.join("app/domains/#{name}")

  raise InvalidDomainPath, path unless Dir.exist?(path)

  domain_module = initialize_module(name)

  register("#{path}/controllers", domain_module)
  register("#{path}/controllers/concerns", domain_module)
  register("#{path}/jobs", domain_module)
  register("#{path}/models", domain_module)
  register("#{path}/models/concerns", domain_module)
end

.register_all!Object



7
8
9
10
11
12
13
# File 'lib/domakase.rb', line 7

def register_all!
  ::Rails.root.join("app/domains").children.each do |entry|
    next unless entry.directory?

    register!(entry.split.last)
  end
end