Sha256: 0d1e59cbc448bf37fa281c13327fbbeffd41593ed4d116194884bd57672b8e5e

Contents?: true

Size: 573 Bytes

Versions: 94

Compression:

Stored size: 573 Bytes

Contents

class LandingPageConstraint
  def self.matches?
    { landing_page: Regexp.new(list.join('|')) }
  end

  def self.list
    landing_pages("#{Rails.configuration.docs_base_path}/custom/landing_pages/") +
      landing_pages("#{Rails.configuration.docs_base_path}/config/landing_pages/")
  end

  def self.landing_pages(root)
    Dir["#{root}/**/*.yml"].map do |filename|
      name = File.join(File.dirname(filename), File.basename(filename, '.yml')).gsub(root, '')
      name[0] = '' if name[0] == '/' # Remove leading slash for subdirectories
      name
    end
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
station-0.5.16 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.15 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.14 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.13 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.12 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.11 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.10 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.9 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.8 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.7 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.6 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.5 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.4 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.3 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.2 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.1 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.5.0 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.4.9 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.4.8 lib/nexmo_developer/app/constraints/landing_page_constraint.rb
station-0.4.7 lib/nexmo_developer/app/constraints/landing_page_constraint.rb