Sha256: 1fd823dfed77fc577bb15e786f4c67e5455006c8f4da8e535a9d0c16037364ff

Contents?: true

Size: 643 Bytes

Versions: 3

Compression:

Stored size: 643 Bytes

Contents

module YSI
  class BuiltGem < Assertion
    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

3 entries across 3 versions & 1 rubygems

Version Path
yes_ship_it-0.0.5 assertions/built_gem.rb
yes_ship_it-0.0.4 assertions/built_gem.rb
yes_ship_it-0.0.3 assertions/built_gem.rb