Sha256: 830cdd8f6d123aa47fa1a90d8e2ad82b02b8e8ab5a31728f5b10c8ed3573e898

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

module YSI
  class Version < Assertion
    attr_accessor :error

    def initialize(engine)
      @engine = engine
    end

    def display_name
      "version number"
    end

    def check
      version_file = "lib/version.rb"
      if !File.exist?(version_file)
        @error = "Expected version in #{version_file}"
        return nil
      end

      File.read(version_file).each_line do |line|
        if line =~ /VERSION = "(.*)"/
          @engine.version = $1
          return @engine.version
        end
      end
      @error = "Couldn't find version in #{version_file}"
      nil
    end

    def assert(dry_run: false)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yes_ship_it-0.0.2 assertions/version.rb
yes_ship_it-0.0.1 assertions/version.rb