Sha256: 095e6078e23d0bbebdf00f3b14732afe1a36e27660d1028845669a5708d841ff

Contents?: true

Size: 395 Bytes

Versions: 25

Compression:

Stored size: 395 Bytes

Contents

# frozen_string_literal: true

class CKEditor5::Rails::Semver
  attr_reader :version

  alias to_s :version

  def initialize(version)
    @version = version.to_s
    validate!
  end

  private

  def validate!
    raise ArgumentError, 'version must be a string' unless version.is_a?(String)
    raise ArgumentError, 'invalid version format' unless version.match?(/\A\d+\.\d+\.\d+\z/)
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
ckeditor5-1.1.3 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.2 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.1 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.0.6 lib/ckeditor5/rails/semver.rb