Class: Command::Generator

Inherits:
Thor::Group
  • Object
show all
Includes:
GeneratorHelpers, Thor::Actions
Defined in:
lib/command/generate.rb

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

COMMON_TEMPLATE_FILES =
%w[
  Dockerfile
  entrypoint.sh
].freeze
POSTGRES_TEMPLATE_FILES =
%w[
  controlplane.yml
  templates/app.yml
  templates/postgres.yml
  templates/rails.yml
  release_script.sh
].freeze
SQLITE_TEMPLATE_FILES =
%w[
  controlplane.yml
  release_script.sh
  templates/app.yml
  templates/db.yml
  templates/rails.yml
  templates/storage.yml
].freeze
DEFAULT_RUBY_VERSION =

Fallback Ruby version when the repo doesn’t pin one via ‘.ruby-version`, `.tool-versions`, or the `Gemfile`. Keep this on a supported release line (www.ruby-lang.org/en/downloads/branches/).

"3.3"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



45
46
47
# File 'lib/command/generate.rb', line 45

def self.source_root
  Cpflow.root_path.join("lib")
end

Instance Method Details

#copy_filesObject



38
39
40
41
42
43
# File 'lib/command/generate.rb', line 38

def copy_files
  generated_paths = copy_template_files("generator_templates", base_template_files)
  generated_paths += copy_template_files("generator_templates_sqlite", SQLITE_TEMPLATE_FILES) if sqlite_project?
  substitute_template_variables(generated_paths)
  make_shell_scripts_executable(generated_paths)
end