Sha256: fda2bbc780fe99c2ece7b911b51ef06006232056bf4d3281c88242cdfac5806b

Contents?: true

Size: 243 Bytes

Versions: 21

Compression:

Stored size: 243 Bytes

Contents

module Sitepress
  # Route constraint for rails routes.rb file.
  class RouteConstraint
    def initialize(site: Sitepress.site)
      @site = site
    end

    def matches?(request)
      !!@site.resources.get(request.path)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sitepress-rails-2.0.0 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta11 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta10 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta9 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta8 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta7 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta6 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta5 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta4 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta3 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta2 lib/sitepress/route_constraint.rb
sitepress-rails-2.0.0.beta1 lib/sitepress/route_constraint.rb
sitepress-rails-1.0.1 lib/sitepress/route_constraint.rb
sitepress-rails-1.0.0 lib/sitepress/route_constraint.rb
sitepress-rails-0.1.29 lib/sitepress/route_constraint.rb
sitepress-rails-0.1.28 lib/sitepress/route_constraint.rb
sitepress-rails-0.1.27 lib/sitepress/route_constraint.rb
sitepress-rails-0.1.26 lib/sitepress/route_constraint.rb
sitepress-rails-0.1.25 lib/sitepress/route_constraint.rb
sitepress-rails-0.1.24 lib/sitepress/route_constraint.rb