Class: RakeVersion::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/rake-version/manager.rb

Instance Method Summary collapse

Constructor Details

#initializeManager

Returns a new instance of Manager.



6
7
8
# File 'lib/rake-version/manager.rb', line 6

def initialize
  @copiers = []
end

Instance Method Details

#bump(type) ⇒ Object



20
21
22
23
# File 'lib/rake-version/manager.rb', line 20

def bump type
  check_context
  copy save(version.bump(type))
end

#config=(config) ⇒ Object



25
26
27
28
# File 'lib/rake-version/manager.rb', line 25

def config= config
  @copiers = config.copiers
  self
end

#set(version_string) ⇒ Object



15
16
17
18
# File 'lib/rake-version/manager.rb', line 15

def set version_string
  check_context
  copy save(RakeVersion::Version.new.from_s(version_string))
end

#versionObject



10
11
12
13
# File 'lib/rake-version/manager.rb', line 10

def version
  check_context
  RakeVersion::Version.new.from_s read_version
end

#with_context(context) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



30
31
32
33
34
35
# File 'lib/rake-version/manager.rb', line 30

def with_context context, &block
  @context = context
  yield self if block_given?
  @context = nil
  self
end