Class: BRocket::VersionFile

Inherits:
Configurable show all
Defined in:
lib/brocket/version_file.rb

Constant Summary collapse

FILENAME =
"VERSION".freeze
INITIAL_VERSION =
"0.0.1".freeze

Constants inherited from Configurable

Configurable::CONFIG_LINE_HEADER, Configurable::CONFIG_LINE_SEP

Instance Method Summary collapse

Instance Method Details

#bump(num = nil) ⇒ Object



29
30
31
# File 'lib/brocket/version_file.rb', line 29

def bump(num = nil)
  bump_on(:patch, num)
end

#init(version = nil) ⇒ Object



9
10
11
# File 'lib/brocket/version_file.rb', line 9

def init(version = nil)
  write_file(version || INITIAL_VERSION)
end

#major(num = nil) ⇒ Object



19
20
21
# File 'lib/brocket/version_file.rb', line 19

def major(num = nil)
  bump_on(:major, num)
end

#minor(num = nil) ⇒ Object



24
25
26
# File 'lib/brocket/version_file.rb', line 24

def minor(num = nil)
  bump_on(:minor, num)
end

#showObject



14
15
16
# File 'lib/brocket/version_file.rb', line 14

def show
  $stdout.puts(read_file)
end