Sha256: f8d9d02a00612f4290285415d46aee8cad8329e93583dee5f02219ba5e37bb43

Contents?: true

Size: 1.79 KB

Versions: 912

Compression:

Stored size: 1.79 KB

Contents

module Precheck
  # each attribute on a app version is a single item.
  # for example: .name, .keywords, .description, will all have a single item to represent them
  # which includes their name and a more user-friendly name we can use to print out information
  class ItemToCheck
    attr_accessor :item_name
    attr_accessor :friendly_name
    attr_accessor :is_optional

    def initialize(item_name, friendly_name, is_optional = false)
      @item_name = item_name
      @friendly_name = friendly_name
      @is_optional = is_optional
    end

    def item_data
      not_implemented(__method__)
    end

    def inspect
      "#{self.class}(friendly_name: #{@friendly_name}, data: #{@item_data})"
    end

    def to_s
      "#{self.class}: #{item_name}: #{friendly_name}"
    end
  end

  # if the data point we want to check is a text field (like 'description'), we'll use this object to encapsulate it
  # this includes the text, the property name, and what that name maps to in plain english so that we can print out nice, friendly messages.
  class TextItemToCheck < ItemToCheck
    attr_accessor :text

    def initialize(text, item_name, friendly_name, is_optional = false)
      @text = text
      super(item_name, friendly_name, is_optional)
    end

    def item_data
      return text
    end
  end

  # if the data point we want to check is a URL field (like 'marketing_url'), we'll use this object to encapsulate it
  # this includes the url, the property name, and what that name maps to in plain english so that we can print out nice, friendly messages.
  class URLItemToCheck < ItemToCheck
    attr_accessor :url

    def initialize(url, item_name, friendly_name, is_optional = false)
      @url = url
      super(item_name, friendly_name, is_optional)
    end

    def item_data
      return url
    end
  end
end

Version data entries

912 entries across 912 versions & 5 rubygems

Version Path
fastlane-2.225.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.224.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.223.1 precheck/lib/precheck/item_to_check.rb
fastlane-2.223.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.222.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.221.1 precheck/lib/precheck/item_to_check.rb
fastlane-2.221.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.220.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.219.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.218.0 precheck/lib/precheck/item_to_check.rb
fastlane-security-patched-2.216.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.217.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.216.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.215.1 precheck/lib/precheck/item_to_check.rb
fastlane-2.215.0 precheck/lib/precheck/item_to_check.rb
fastlane-mercafacil-2.214.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.214.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.213.0 precheck/lib/precheck/item_to_check.rb
fastlane-2.212.2 precheck/lib/precheck/item_to_check.rb
fastlane_pricing_fix-2.212.1 precheck/lib/precheck/item_to_check.rb