Class: Releaser::FromFile

Inherits:
Object
  • Object
show all
Defined in:
lib/releaser/from_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name = File.join(Rails.root, "CURRENT_VERSION")) ⇒ FromFile

Returns a new instance of FromFile.



5
6
7
# File 'lib/releaser/from_file.rb', line 5

def initialize(file_name = File.join(Rails.root, "CURRENT_VERSION"))
  self.name = file_name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/releaser/from_file.rb', line 3

def name
  @name
end

Instance Method Details

#version(default = "development") ⇒ Object



9
10
11
12
13
14
15
# File 'lib/releaser/from_file.rb', line 9

def version(default = "development")
  if exists?
    from_file
  else
    default
  end
end