class Tset::Commands::Generate

Constants

GENERATOR_NAMESPACE

Attributes

cli[R]
framework[R]
name[R]
source[R]
target[R]
type[R]

Public Class Methods

new(type, name, framework, cli) click to toggle source
# File lib/tset/commands/generate.rb, line 14
def initialize(type, name, framework, cli)
  @type = type
  @name = name.downcase
  @framework = framework

  @cli = cli
  @source = Pathname.new(::File.dirname(__FILE__) + "/../generators/#{ @type }_test").realpath
  @target = Pathname.pwd.realpath
end

Public Instance Methods

start() click to toggle source
# File lib/tset/commands/generate.rb, line 24
def start
  generator.start
end

Private Instance Methods

generator() click to toggle source
# File lib/tset/commands/generate.rb, line 30
def generator
  require "tset/generators/#{ @type }_test"
  class_name = @type.classify
  Object.const_get(GENERATOR_NAMESPACE % class_name).new(self)
end