Sha256: 8ba106eb47d42f29401447e1049d46201dcd43440f2cd46bcba3edb67772e5cf

Contents?: true

Size: 796 Bytes

Versions: 9

Compression:

Stored size: 796 Bytes

Contents

require 'mattock/tasklib'

module Corundum
  class GemspecSanity < Mattock::TaskLib
    default_namespace :gemspec_sanity

    setting(:gemspec)

    def default_configuration(toolkit)
      self.gemspec = toolkit.gemspec
    end

    def define
      in_namespace do
        task :has_files do
          if gemspec.files.nil? or gemspec.files.empty?
            fail "No files mentioned in gemspec - do you intend an empty gem?"
          end
        end

        task :files_exist do
          missing = gemspec.files.find_all do |path|
            not File::exists?(path)
          end

          fail "Files mentioned in gemspec are missing: #{missing.join(", ")}" unless missing.empty?
        end
      end

      task :preflight => in_namespace(:files_exist, :has_files)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
corundum-0.0.24 lib/corundum/gemspec_sanity.rb
corundum-0.0.23 lib/corundum/gemspec_sanity.rb
corundum-0.0.22 lib/corundum/gemspec_sanity.rb
corundum-0.0.20 lib/corundum/gemspec_sanity.rb
corundum-0.0.19 lib/corundum/gemspec_sanity.rb
corundum-0.0.18 lib/corundum/gemspec_sanity.rb
corundum-0.0.17 lib/corundum/gemspec_sanity.rb
corundum-0.0.16 lib/corundum/gemspec_sanity.rb
corundum-0.0.15 lib/corundum/gemspec_sanity.rb