10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/generators/project_container_gem_generator.rb', line 10
def create_container params={}
path = params[:path]
module_name = params[:module_name]
api_version = params[:api_version]
service_name = params[:service_name]
@file = <<-FOO
Dir[File.dirname(__FILE__) + '/microservice/**/*.rb'].each {|file| require_relative file }
Dir[File.dirname(__FILE__) + '/domain/**/*.rb'].each {|file| require_relative file }
map "/" do
run #{module_name.capitalize}::#{api_version.capitalize}::#{service_name.capitalize}
end
FOO
create_file "#{path}/config.ru"
append_to_file "#{path}/config.ru", @file
@file = <<-FOO
source 'https://rubygems.org'
gem 'utter'
FOO
create_file "#{path}/Gemfile"
append_to_file "#{path}/Gemfile", @file
@file = <<-FOO
Docker stuff here
FOO
create_file "#{path}/Dockerfile"
append_to_file "#{path}/Dockerfile", @file
@file = <<-FOO
Abou this utter project. 1.Microservice 2.Domain
FOO
create_file "#{path}/README.md"
append_to_file "#{path}/README.md", @file
@file = <<-FOO
Abou this log directory
FOO
empty_directory "#{path}/log"
create_file "#{path}/log/README.md"
append_to_file "#{path}/log/README.md", @file
end
|