diff --git a/build.gradle b/build.gradle index c86569e..c707b71 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'no.datek' -version '0.18.0' +version '0.18.1' final String JRUBY_VERSION = '9.4.5.0'; repositories { diff --git a/src/main/resources/ruby/load_slim.rb b/src/main/resources/ruby/load_slim.rb index 0d26da4..da72e8c 100644 --- a/src/main/resources/ruby/load_slim.rb +++ b/src/main/resources/ruby/load_slim.rb @@ -7,8 +7,10 @@ rescue Exception => e Java::OrgApacheCommonsLogging::LogFactory.getLog('no.datek.slim').error(e.to_s) - def render_slim(template, model_map, rendering_context) - "

Whoops!

Failed to load SLIM template framework.

" + module SlimRenderer + def self.render(template, model_map, rendering_context) + "

Whoops!

Failed to load SLIM template framework.

" + end end end diff --git a/src/main/resources/ruby/slim_helper.rb b/src/main/resources/ruby/slim_helper.rb index 7290885..4f93962 100644 --- a/src/main/resources/ruby/slim_helper.rb +++ b/src/main/resources/ruby/slim_helper.rb @@ -107,7 +107,7 @@ def formatDateTime(date_time, format = 'yyyy-MM-dd HH:mm:ss', timeZoneId: TimeZo DateUtils.formatLocalDateTime(local_date_time, format, timeZoneId) end - def formatDate(date, format = '%d.%m.%Y') + def formatDate(date, format = '%Y-%m-%d') if date.nil? return '' end diff --git a/src/main/resources/ruby/slim_renderer.rb b/src/main/resources/ruby/slim_renderer.rb index 933be84..135a82d 100644 --- a/src/main/resources/ruby/slim_renderer.rb +++ b/src/main/resources/ruby/slim_renderer.rb @@ -21,7 +21,7 @@ require_relative 'request_context' require 'application_setup' -class SlimRenderer +module SlimRenderer extend LocaleHelper extend ClassPatcher include Log