lib/slideshow/config.rb in slideshow-0.9.1 vs lib/slideshow/config.rb in slideshow-0.9.2
- old
+ new
@@ -37,32 +37,47 @@
#
# using nested key
# textile:
# extnames: [ .textile, .t ]
- @hash[ 'textile' ][ 'extnames' ] + @hash[ 'builtin' ][ 'textile' ][ 'extnames' ]
+ (@hash[ 'textile' ][ 'extnames' ] || []) + @hash[ 'builtin' ][ 'textile' ][ 'extnames' ]
end
def known_markdown_extnames
- @hash[ 'markdown' ][ 'extnames' ] + @hash[ 'builtin' ][ 'markdown' ][ 'extnames' ]
+ (@hash[ 'markdown' ][ 'extnames' ] || []) + @hash[ 'builtin' ][ 'markdown' ][ 'extnames' ]
end
def known_markdown_libs
# returns an array of known markdown engines e.g.
# [ rdiscount, rpeg-markdown, maruku, bluecloth, kramdown ]
- @hash[ 'markdown' ][ 'libs' ] + @hash[ 'builtin' ][ 'markdown' ][ 'libs' ]
+ (@hash[ 'markdown' ][ 'libs' ] || []) + @hash[ 'builtin' ][ 'markdown' ][ 'libs' ]
end
def known_extnames
# ruby check: is it better self. ?? or more confusing
# possible conflict only with write access (e.g. prop=)
known_textile_extnames + known_markdown_extnames
end
def text_filters
- @hash[ 'builtin' ][ 'filters' ] + @hash[ 'filters' ]
+ @hash[ 'builtin' ][ 'filters' ] + ( @hash[ 'filters' ] || [] )
+ end
+
+ def helper_renames
+ @hash[ 'builtin' ][ 'helper' ][ 'renames' ] + ( @hash[ 'helper' ][ 'renames' ] || [] )
+ end
+
+ def helper_unparsed
+ # use unparsed params (passed along a single string)
+ @hash[ 'builtin' ][ 'helper' ][ 'unparsed' ]
+ end
+
+ def helper_exprs
+ # allow expression as directives (no need for %end block)
+ # by default directives are assumed statements (e.g. %mydir %end)
+ @hash[ 'builtin' ][ 'helper' ][ 'exprs' ] + ( @hash[ 'helper' ][ 'exprs' ] || [] )
end
def google_analytics_code
@hash[ 'analytics' ][ 'google' ]
end
\ No newline at end of file