Sha256: 5b738e625a1a73ad2257f262db0fe99c91748117ecaf7c276d2420f863d329f5

Contents?: true

Size: 1.66 KB

Versions: 16

Compression:

Stored size: 1.66 KB

Contents

require 'thor'
require 'thor/group'

module Utter
  module Generators
    class Container < Thor::Group
      include Thor::Actions

      desc 'Generate an utter project skleton'
      def create_container params={}
	path = params[:path]
	module_name = params[:module_name]
	api_version = params[:api_version]
	service_name = params[:service_name]

	# config.ru
	@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
	# end of config.ru
	############################	
	# Gemfile 
	@file = <<-FOO
source 'https://rubygems.org'
gem 'utter'
	FOO
	create_file "#{path}/Gemfile"
	append_to_file "#{path}/Gemfile", @file
	# end of Gemfile
	############################	
	# Dockerfile 
	@file = <<-FOO
Docker stuff here
	FOO
	create_file "#{path}/Dockerfile"
	append_to_file "#{path}/Dockerfile", @file
	# end of Dockerfile
	############################	
	# README.md for the utter container 
	@file = <<-FOO
Abou this utter project. 1.Microservice 2.Domain
	FOO
	create_file "#{path}/README.md"
	append_to_file "#{path}/README.md", @file
	# end of README.md 
	############################	
	# Log for the utter container 
	@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 of log 
	############################	
	#TODO container_name.gemspec
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
utter-1.9.0 lib/generators/project_container_gem_generator.rb
utter-1.8.0 lib/generators/project_container_gem_generator.rb
utter-1.7.0 lib/generators/project_container_gem_generator.rb
utter-1.6.0 lib/generators/project_container_gem_generator.rb
utter-1.5.0 lib/generators/project_container_gem_generator.rb
utter-1.4.0 lib/generators/project_container_gem_generator.rb
utter-1.3.2 lib/generators/project_container_gem_generator.rb
utter-1.3.1 lib/generators/project_container_gem_generator.rb
utter-1.3.0 lib/generators/project_container_gem_generator.rb
utter-1.2.0 lib/generators/project_container_gem_generator.rb
utter-1.1.0 lib/generators/project_container_gem_generator.rb
utter-1.0.23 lib/generators/project_container_gem_generator.rb
utter-1.0.21 bin/generators/container.rb
utter-1.0.20 bin/generators/container.rb
utter-1.0.19 bin/generators/container.rb
utter-1.0.18 bin/generators/container.rb