Sha256: de21759f36ba1fbf6fd8b28f52c3bcb90f344304ef8f8800e07e92c1923891df

Contents?: true

Size: 739 Bytes

Versions: 14

Compression:

Stored size: 739 Bytes

Contents

# frozen_string_literal: true

namespace :manifest do
  def gemmable_files
    `git ls-files -z`.split("\x0").reject do |file|
      file.match(%r{^(bin|spec)/}) ||
        file.end_with?("/.keep") ||
        file.start_with?(".") ||
        %w(Manifest.txt Gemfile Rakefile publify_core.gemspec).include?(file)
    end
  end

  def manifest_files
    File.open("Manifest.txt").readlines.map(&:chomp)
  end

  desc "Create manifest"
  task :create do
    File.open("Manifest.txt", "w") do |manifest|
      gemmable_files.each { |file| manifest.puts file }
    end
  end

  desc "Check manifest"
  task :check do
    unless gemmable_files == manifest_files
      raise "Manifest check failed, try recreating the manifest"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
publify_core-10.0.2 lib/tasks/manifest.rake
publify_core-10.0.1 lib/tasks/manifest.rake
publify_core-10.0.0 lib/tasks/manifest.rake
publify_core-9.2.10 lib/tasks/manifest.rake
publify_core-9.2.9 lib/tasks/manifest.rake
publify_core-9.2.8 lib/tasks/manifest.rake
publify_core-9.2.7 lib/tasks/manifest.rake
publify_core-9.2.6 lib/tasks/manifest.rake
publify_core-9.2.5 lib/tasks/manifest.rake
publify_core-9.2.4 lib/tasks/manifest.rake
publify_core-9.2.3 lib/tasks/manifest.rake
publify_core-9.2.2 lib/tasks/manifest.rake
publify_core-9.2.1 lib/tasks/manifest.rake
publify_core-9.2.0 lib/tasks/manifest.rake