New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

item/@item is not available in Nanoc::Filter.define #932

Closed
werthen opened this Issue Aug 21, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@werthen
Contributor

werthen commented Aug 21, 2016

Summary

item or @item is not available in new Nanoc::Filter.define syntax

Expected behavior

item and @item should be available using this syntax.

Example

This works currently:

class IcalFilter < Nanoc::Filter
  identifier :ical

  def run(_content, _params = {})
    cal = Icalendar::Calendar.new
    cal.add_event(event_for(item))
    cal.to_ical
  end
end

This should work as well:

Nanoc::Filter.define(:ical) do |_content, _params|
  cal = Icalendar::Calendar.new
  cal.add_event(event_for(item))
  cal.to_ical
end

@ddfreyne ddfreyne modified the milestone: 4.3.1 Aug 22, 2016

ddfreyne added a commit that referenced this issue Aug 22, 2016

Merge pull request #934 from nanoc/gh-932-filter-define-assigns
Fix assigns in filters defined with Filter.define
@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Aug 22, 2016

Member

Fixed in #934.

Member

ddfreyne commented Aug 22, 2016

Fixed in #934.

@ddfreyne ddfreyne closed this Aug 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment