Class: Amanuensis::Version

Inherits:
Struct
  • Object
show all
Defined in:
lib/amanuensis/version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagObject

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



4
5
6
# File 'lib/amanuensis/version.rb', line 4

def tag
  @tag
end

Instance Method Details

#getObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/amanuensis/version.rb', line 6

def get
  major, minor, patch = *previous

  case Amanuensis.version.to_sym
  when :minor
    minor += 1
  when :major
    major += 1
  when :patch
    patch += 1
  end

  [major, minor, patch].join '.'
end

#previousObject



21
22
23
# File 'lib/amanuensis/version.rb', line 21

def previous
  tag.split('.').map(&:to_i)
end