Sha256: 79c6f5677b81e8f271c6f05db2548beee1ae862c4c5a276e5120b03bfc0b9f60
Contents?: true
Size: 635 Bytes
Versions: 24
Compression:
Stored size: 635 Bytes
Contents
# frozen_string_literal: true class HandlebarsHelperDirector < KDirector::Directors::BaseDirector default_builder_type(HandlebarsHelperBuilder) def helper(**opts, &block) helper = HandlebarsHelperChild.new(self, **opts) helper.instance_eval(&block) if block_given? self end def build_helpers builder.helpers.each do |helper| cd(:lib) add("helpers/#{helper[:category]}/#{helper[:name]}.rb", template_file: 'helper.rb', helper: helper) cd(:spec) add("helpers/#{helper[:category]}/#{helper[:name]}_spec.rb", template_file: 'helper_spec.rb', helper: helper) end self end end
Version data entries
24 entries across 24 versions & 1 rubygems