Sha256: de3baad0f0554edf7e31a7fc25ef5a5a9a3dae03e2ddca4d06fc30a59b894db1
Contents?: true
Size: 923 Bytes
Versions: 21
Compression:
Stored size: 923 Bytes
Contents
# -*- encoding : utf-8 -*- require "generators/card" class Card module Generators class SetGenerator < NamedBase source_root File.expand_path("../templates", __FILE__) argument :set_pattern, required: true argument :anchors, required: true, type: :array class_option "core", type: :boolean, aliases: "-c", default: false, group: :runtime, desc: "create set files in Card gem" def create_files template "set_template.erb", set_path template "set_spec_template.erb", set_path("spec") end private def set_path modifier=nil suffix = modifier ? "_#{modifier}" : nil filename = "#{anchors.last}#{suffix}.rb" dirs = anchors[0..-2] path_parts = [mod_path, modifier, "set", set_pattern, dirs, filename] File.join(*path_parts.compact) end end end end
Version data entries
21 entries across 21 versions & 1 rubygems