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.11.1 lib/ckeditor5/rails/semver.rb
ckeditor5-1.11.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.10.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.9.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.8.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.7.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.6.1 lib/ckeditor5/rails/semver.rb
ckeditor5-1.6.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.5.4 lib/ckeditor5/rails/semver.rb
ckeditor5-1.5.3 lib/ckeditor5/rails/semver.rb
ckeditor5-1.5.2 lib/ckeditor5/rails/semver.rb
ckeditor5-1.5.1 lib/ckeditor5/rails/semver.rb
ckeditor5-1.5.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.4.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.3.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.2.0 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.7 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.6 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.5 lib/ckeditor5/rails/semver.rb
ckeditor5-1.1.4 lib/ckeditor5/rails/semver.rb