Class: Utter::Generators::Domain

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/generators/domain_gem_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_domain(params = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/domain_gem_generator.rb', line 10

def create_domain params={}
	path = params[:path]
	# config.ru
	create_file "#{path}/domain/main.rb"
	@file = <<-FOO
require 'utter'
Dir[File.dirname(__FILE__) + '/**/*.rb'].each {|file| require_relative file }
#TODO require all extentions in the domain/extentions dir
#TODO require a relevant domain-specific framework
#TODO write some domain-specific rules here thus that the 
#recievied rules{}from the microservices gets evaluated based on them. 
	FOO
	append_to_file "#{path}/domain/main.rb", @file

	#open("#{path}/domain/main.rb", 'a') do |f|
	#  f.puts @file
	#end
	# end of config.ru
	############################	
	# create domain/extensions
	#empty_directory "#{path}/domain/extensions"
end