Class: DockerizeStack::Command

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions, ThorActionsExtend
Defined in:
lib/dockerize_stack.rb

Constant Summary

Constants included from ThorActionsExtend

ThorActionsExtend::CONFIG

Instance Method Summary collapse

Methods included from ThorActionsExtend

#fetch_template_variables, #run

Instance Method Details

#gatsbyObject



56
57
58
59
60
61
62
63
# File 'lib/dockerize_stack.rb', line 56

def gatsby
  @type = :gatsby
  run(options, @type)
  all_file_paths(@type).each do |file_path|
    file_name = file_path.gsub("/templates/#{@type}", '')
    template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
  end
end

#railsObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dockerize_stack.rb', line 20

def rails
  run(options, :rails)
  all_file_paths(:rails).each do |file_path|
    if file_path =~ %r{./templates/rails/kubernetes} && !@kubernetes
      return false
    end
    file_name = file_path.gsub('/templates/rails', '')
    template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
  end

  puts 'Update your database.yml based in database-docker.yml'
end

#reactObject



40
41
42
43
44
45
46
# File 'lib/dockerize_stack.rb', line 40

def react
  run(options, :react)
  all_file_paths(:react).each do |file_path|
    file_name = file_path.gsub('/templates/react', '')
    template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
  end
end

#strapiObject



73
74
75
76
77
78
79
80
# File 'lib/dockerize_stack.rb', line 73

def strapi
  @type = :strapi
  run(options, @type)
  all_file_paths(@type).each do |file_path|
    file_name = file_path.gsub("/templates/#{@type}", '')
    template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
  end
end