Skip to content

Commit 65cc04c

Browse files
livkisssamvincent
authored andcommitted
DRY up monkey patch of Jekyll::Layout
This uses an method alias instead of copying the whole code of #initialize.
1 parent 261f7dc commit 65cc04c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/jekyll-haml/ext/convertible.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Re-open Layout class to convert our HAML Layout content.
2-
# This solution redeclares the Layout class in a way that
3-
# don't risks Jekyll API updates anymore.
4-
52
module Jekyll
6-
class << Layout
3+
class Layout
74
alias old_initialize initialize
5+
86
def initialize(*args)
97
old_initialize(*args)
10-
self.content = self.transform
8+
self.transform
119
end
1210
end
1311
end

0 commit comments

Comments
 (0)