class Jeweler::VersionHelper

Attributes

base_dir[RW]
build[R]
major[R]
minor[R]
patch[R]

Public Instance Methods

bump_major() click to toggle source
# File lib/jeweler/version_helper.rb, line 100
def bump_major
  @major += 1
  @minor = 0
  @patch = 0
  @build = nil
end
bump_minor() click to toggle source
# File lib/jeweler/version_helper.rb, line 107
def bump_minor
  @minor += 1
  @patch = 0
  @build = nil
end
bump_patch() click to toggle source
# File lib/jeweler/version_helper.rb, line 113
def bump_patch
  @patch += 1
  @build = nil
end
plaintext_path() click to toggle source
# File lib/jeweler/version_helper.rb, line 135
def plaintext_path
  denormalized_path = File.join(@base_dir, 'VERSION')
  absolute_path = File.expand_path(denormalized_path)
  absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
end
to_s() click to toggle source
# File lib/jeweler/version_helper.rb, line 125
def to_s
  [major, minor, patch, build].compact.join('.')
end
update_to(major, minor, patch, build=nil) click to toggle source
# File lib/jeweler/version_helper.rb, line 118
def update_to(major, minor, patch, build=nil)
  @major = major
  @minor = minor
  @patch = patch
  @build = build
end
yaml_path() click to toggle source
# File lib/jeweler/version_helper.rb, line 129
def yaml_path
  denormalized_path = File.join(@base_dir, 'VERSION.yml')
  absolute_path = File.expand_path(denormalized_path)
  absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
end

Public Class Methods

new(base_dir) click to toggle source
# File lib/jeweler/version_helper.rb, line 86
def initialize(base_dir)
  self.base_dir = base_dir

  if File.exists?(yaml_path)
    extend YamlExtension
    parse_yaml
  else
    extend PlaintextExtension
    if File.exists?(plaintext_path)
      parse_plaintext
    end
  end
end