File: basic.rb

package info (click to toggle)
ruby-version-gem 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 144 kB
  • sloc: ruby: 105; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 370 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require_relative 'error'
require_relative 'api'

module VersionGem
  # This is a very *basic* version parser. Others could be built based on this pattern!
  module Basic
    def self.extended(base)
      raise Error, "VERSION must be defined before 'extend #{name}'" unless defined?(base::VERSION)

      base.extend Api
    end
  end
end