diff --git a/CHANGELOG.md b/CHANGELOG.md index 67e7540..4bc5dcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 0.5.4 + +#### Major changes + +- (**`core/helpers/static.rb`**): Remove stabby lambda definition from `static_router` setting to prevent a new `Static::Router` object from being initialized every time the setting is called. + +#### Minor changes + +- (**`core/helpers/static.rb`**): Remove `:<<` alias method for `Static::Router#route` instance method. + # 0.5.3 #### Major changes diff --git a/lib/eucalypt/core/helpers/static.rb b/lib/eucalypt/core/helpers/static.rb index 85dff84..5c8781c 100644 --- a/lib/eucalypt/core/helpers/static.rb +++ b/lib/eucalypt/core/helpers/static.rb @@ -16,13 +16,11 @@ def route(file, aliases: []) raise ArgumentError.new("Invalid keyword argument #{aliases} for 'aliases' - Expected Array of route names (preceded by /)") unless aliases.all?{|a| a.start_with? '/'} @routes << {file: file, aliases: aliases} end - - alias_method :<<, :route end end class ApplicationController < Sinatra::Base - set :static_router, ->{ Eucalypt::Static::Router.new settings.public_folder } + set :static_router, Eucalypt::Static::Router.new(settings.public_folder) def self.static(file = nil, aliases: []) if settings.static_router.is_a? Eucalypt::Static::Router diff --git a/lib/eucalypt/version.rb b/lib/eucalypt/version.rb index 0045a7c..ab191e2 100644 --- a/lib/eucalypt/version.rb +++ b/lib/eucalypt/version.rb @@ -1,3 +1,3 @@ module Eucalypt - VERSION = '0.5.3' + VERSION = '0.5.4' end \ No newline at end of file