Sha256: c2a9c9047cffcc883022514f793c8ebe18416607f496a7064bed73c24c1f6bc5
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
# typed: strict # frozen_string_literal: true module Tapioca module Generators class Base extend T::Sig extend T::Helpers class FileWriter < Thor include Thor::Actions end include Thor::Base include CliHelper abstract! sig { params(default_command: String, file_writer: Thor::Actions).void } def initialize(default_command:, file_writer: FileWriter.new) @file_writer = file_writer @default_command = default_command end sig { abstract.void } def generate; end private sig do params( path: T.any(String, Pathname), content: String, force: T::Boolean, skip: T::Boolean, verbose: T::Boolean ).void end def create_file(path, content, force: true, skip: false, verbose: true) @file_writer.create_file(path, force: force, skip: skip, verbose: verbose) { content } end sig do params( path: T.any(String, Pathname), verbose: T::Boolean ).void end def remove_file(path, verbose: true) @file_writer.remove_file(path, verbose: verbose) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
tapioca-0.6.4 | lib/tapioca/generators/base.rb |
tapioca-0.6.3 | lib/tapioca/generators/base.rb |
tapioca-0.6.2 | lib/tapioca/generators/base.rb |