Sha256: ca97387b3fd5d5992d800553d3f6e56e943c7fa9b29e33a91cf0be5117595d7a

Contents?: true

Size: 921 Bytes

Versions: 1

Compression:

Stored size: 921 Bytes

Contents

module YSI
  class YesItShipped < Assertion
    needs "tag"

    def display_name
      "pushed to yes-it-shipped"
    end

    def check
      begin
        json = RestClient.get("https://yes-it-shipped.herokuapp.com/releases/#{engine.project_name}/#{engine.version}")
        return "#{engine.project_name}-#{engine.version}"
      rescue RestClient::ResourceNotFound
        return nil
      end
    end

    def assert(dry_run: false)
      if !dry_run
        begin
          RestClient.post("https://yes-it-shipped.herokuapp.com/releases",
            project: engine.project_name, version: engine.version,
            release_date_time: engine.tag_date, project_url: engine.project_url,
            release_url: engine.release_url, ysi_config_url: engine.config_url)
        rescue RestClient::Exception
          return nil
        end
      end
      "#{engine.project_name}-#{engine.version}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yes_ship_it-0.0.5 assertions/yes_it_shipped.rb