Sha256: bbbd5eb36e485297d63b66c416e2f9a3786e851cc0021a808da1fbf119234301

Contents?: true

Size: 728 Bytes

Versions: 1

Compression:

Stored size: 728 Bytes

Contents

module YSI
  class BuiltGem < Assertion
    attr_accessor :error

    def initialize(engine)
      @engine = engine
    end

    def display_name
      "built gem"
    end

    def gem_file
      "#{@engine.project_name}-#{@engine.version}.gem"
    end

    def gemspec_file
      "#{@engine.project_name}.gemspec"
    end

    def check
      if !File.exist?(gemspec_file)
        @error = "I need a gemspec: #{gemspec_file}"
        return nil
      end

      if !File.exist?(gem_file)
        return nil
      end

      gem_file
    end

    def assert(dry_run: false)
      if !dry_run
        `gem build #{gemspec_file}`
        if $?.to_i != 0
          return nil
        end
      end
      gem_file
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yes_ship_it-0.0.2 assertions/built_gem.rb