Class: JekyllSupport::JekyllBlockNoArgParsing

Inherits:
JekyllBlock
  • Object
show all
Includes:
JekyllSupportError, ToString
Defined in:
lib/jekyll_plugin_support.rb,
lib/block/jekyll_plugin_support_block_noarg.rb

Instance Attribute Summary

Attributes included from JekyllSupportError

#logger, #page

Attributes inherited from JekyllBlock

#argument_string, #helper, #highlighter_prefix, #highlighter_suffix, #jekyll_version, #line_number, #logger, #page, #raw_content, #site, #text

Instance Method Summary collapse

Methods included from ToString

#to_s

Methods included from JekyllSupportError

#exit_without_stack_trace, #format_error_message, #maybe_reraise_error, #remove_ansi_color, #warn_short_trace

Methods inherited from JekyllBlock

#render, #set_error_context

Constructor Details

#initialize(tag_name, argument_string, parse_context) ⇒ JekyllBlockNoArgParsing

Returns a new instance of JekyllBlockNoArgParsing.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 3

def initialize(tag_name, argument_string, parse_context)
  class << self
    include NoArgParsing
  end

  super
  @logger.debug { "#{self.class}: respond_to?(:o_arg_parsing) #{respond_to?(:no_arg_parsing) ? 'yes' : 'no'}." }
rescue StandardError => e
  e.shorten_backtrace
  @logger.error { e.full_message }
  ::JekyllSupport.error_short_trace(@logger, e)
end

Instance Method Details

#blank?Boolean

Liquid::Block subclasses do not render if there is no content within the tag This override fixes that

Returns:

  • (Boolean)


18
19
20
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 18

def blank?
  false
end

#render_implObject

Jekyll plugins must override this method, not render, so their plugin can be tested more easily The following variables are predefined:

@argument_string, @config, @envs, @helper, @layout, @logger, @mode, @page, @paginator, @site, @tag_name and @theme


25
26
27
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 25

def render_impl
  abort "#{self.class}.render_impl for tag #{@tag_name} must be overridden, but it was not."
end