Class: Raykit::Version

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

Overview

Version functionality

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#start_timeObject

Returns the value of attribute start_time.



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

def start_time
  @start_time
end

Class Method Details

.detect(name) ⇒ Object

detect a version number based on the NAME variable, if defined



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

def self.detect(name)
    #if(defined?(NAME))

        csproj_filename = "#{name}/#{name}.csproj"
        if(File.exists?(csproj_filename))
            return IO.read(csproj_filename).match(/<Version>([\d.]+)</).captures[0]
        end
        gemspec_filename = "#{name}.gemspec"
        if(File.exists?(gemspec_filename))
            return IO.read(gemspec_filename).match(/version[\s]+=[\s]+['"]([\w.]+)['"]/).captures[0]
        end
    #end

    '0.0.0'
end