Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
Merge pull request #19 from eonu/master
Browse files Browse the repository at this point in the history
Remove stabby lambda definition from static_router setting
  • Loading branch information
eonu authored Jan 2, 2019
2 parents a382772 + fbf93e9 commit 6e65431
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions lib/eucalypt/core/helpers/static.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/eucalypt/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Eucalypt
VERSION = '0.5.3'
VERSION = '0.5.4'
end

0 comments on commit 6e65431

Please sign in to comment.