Sha256: 0ba6b9349c375a2d76aba08062215fa4c3750b25385a413bbc184b514ae3d26f
Contents?: true
Size: 850 Bytes
Versions: 53
Compression:
Stored size: 850 Bytes
Contents
# -*- encoding : utf-8 -*- require "generators/card" class Card module Generators class FormatGenerator < NamedBase source_root File.expand_path("../templates", __FILE__) argument :module_name, required: true class_option "core", type: :boolean, aliases: "-c", default: false, group: :runtime, desc: "create format files in Card gem" def create_files template "format_template.erb", format_path template "format_spec_template.erb", format_path("spec") end private def format_path modifier=nil suffix = modifier ? "_#{modifier}" : nil filename = "#{module_name}_format#{suffix}.rb" path_parts = [mod_path, modifier, "format", filename].compact File.join(*path_parts) end end end end
Version data entries
53 entries across 53 versions & 1 rubygems