Class: JekyllSupport::JekyllBlockNoArgParsing

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

Instance Attribute Summary collapse

Attributes inherited from JekyllBlock

#text

Instance Method Summary collapse

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.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 7

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 Attribute Details

#argument_stringObject (readonly)

Returns the value of attribute argument_string.



5
6
7
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 5

def argument_string
  @argument_string
end

#helperObject (readonly)

Returns the value of attribute helper.



5
6
7
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 5

def helper
  @helper
end

#line_numberObject (readonly)

Returns the value of attribute line_number.



5
6
7
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 5

def line_number
  @line_number
end

#loggerObject (readonly)

Returns the value of attribute logger.



5
6
7
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 5

def logger
  @logger
end

#pageObject (readonly)

Returns the value of attribute page.



5
6
7
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 5

def page
  @page
end

#siteObject (readonly)

Returns the value of attribute site.



5
6
7
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 5

def site
  @site
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)


22
23
24
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 22

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


29
30
31
# File 'lib/block/jekyll_plugin_support_block_noarg.rb', line 29

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