Sha256: bbb52ff3a625b1016d8764abaf434bb1071256158ee2b6cac64b938e13598280
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
class DevSystem::GeneratorDslMainPart < Liza::Part insertion do def self.call args log :higher, "Called #{self}.#{__method__} with args #{args}" name = args.shift || raise("args[0] should contain NAME") name = name.downcase memo.each do |label, bl| log "Generating #{label}" g = new label, name, args g.instance_exec &bl g.call end puts log "done" end def self.memo()= @memo ||= {} def self.generate(label, &block)= memo[label] = block attr_reader :label, :name, :args def initialize label, name, args @label, @name, @args = label, name, args end def call TextShell.write "#{folder}/#{filename}", "#{content}\n" end %w|folder filename content|.each do |s| class_eval <<-CODE, __FILE__, __LINE__ + 1 attr_reader :#{s} def #{s} #{s} = nil if #{s} @#{s} = #{s} else @#{s} end end CODE end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lizarb-1.0.3 | lib/dev_system/dev/controllers/generator_dsl_main_part.rb |