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

Version Path
handlebarsjs-0.14.2 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.14.1 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.14.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.13.1 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.13.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.12.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.11.3 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.11.2 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.11.1 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.11.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.10.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.9.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.8.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.7.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.6.3 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.6.2 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.6.1 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.6.0 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.5.7 .builders/director/handlebars_helper_director.rb
handlebarsjs-0.5.6 .builders/director/handlebars_helper_director.rb