Sha256: ed74fd993d755f6bdacc27e70e1b66febdf75058df2545d9e8cdfc6392490d0b

Contents?: true

Size: 736 Bytes

Versions: 76

Compression:

Stored size: 736 Bytes

Contents

namespace :documentation do
  desc 'Verify all pages have meta_title and description keys'
  task check_keys: :environment do
    documentation_path = "#{Rails.configuration.docs_base_path}/_documentation/**/*.md"
    documents = []

    Dir.glob(documentation_path).each do |filename|
      document = YAML.safe_load(File.read(filename))
      meta_title = document['meta_title']
      description = document['description']
      if meta_title.blank? || description.blank?
        documents.push(filename.split('/_documentation')[1])
      end
    end
    count = documents.count
    raise "The following #{count} documents are missing either a 'meta_title' or 'description' key:\n#{documents.join("\n")}" if count.positive?
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

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