Sha256: aac0ff07ee199fa9df0c813cc456a431f87d1e6bcbacaa393be98b9c8620e473

Contents?: true

Size: 808 Bytes

Versions: 11

Compression:

Stored size: 808 Bytes

Contents

require 'mattock/tasklib'

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

    setting(:gemspec)

    def default_configuration(toolkit)
      super
      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

11 entries across 11 versions & 1 rubygems

Version Path
corundum-0.1.4 lib/corundum/gemspec_sanity.rb
corundum-0.1.3 lib/corundum/gemspec_sanity.rb
corundum-0.1.2 lib/corundum/gemspec_sanity.rb
corundum-0.1.0 lib/corundum/gemspec_sanity.rb
corundum-0.0.31 lib/corundum/gemspec_sanity.rb
corundum-0.0.30 lib/corundum/gemspec_sanity.rb
corundum-0.0.29 lib/corundum/gemspec_sanity.rb
corundum-0.0.28 lib/corundum/gemspec_sanity.rb
corundum-0.0.27 lib/corundum/gemspec_sanity.rb
corundum-0.0.26 lib/corundum/gemspec_sanity.rb
corundum-0.0.25 lib/corundum/gemspec_sanity.rb