Module: RakeVersion

Defined in:
lib/rake-version.rb,
lib/rake-version/tasks.rb,
lib/rake-version/config.rb,
lib/rake-version/copier.rb,
lib/rake-version/context.rb,
lib/rake-version/manager.rb,
lib/rake-version/version.rb

Defined Under Namespace

Classes: BadArgument, BadBumpType, BadContext, BadFilePattern, BadVersion, BadVersionPattern, BadVersionString, Config, Context, Copier, Error, Manager, MissingContext, MissingVersionFile, Tasks, Version

Constant Summary collapse

VERSION =
'1.0.1'

Class Method Summary collapse

Class Method Details

.check_type(o, expected_type, error_class = Error, name = nil) ⇒ Object

Raises:

  • (error_class)


22
23
24
25
26
# File 'lib/rake-version.rb', line 22

def self.check_type o, expected_type, error_class = Error, name = nil
  name ||= expected_type.to_s.sub(/.*::/, '')
  name = name.downcase
  raise error_class, "Expected #{name} to be a #{expected_type}." unless o.kind_of? expected_type
end

.check_version(o) ⇒ Object



18
19
20
# File 'lib/rake-version.rb', line 18

def self.check_version o
  self.check_type o, RakeVersion::Version, BadVersion
end