Module: NRSER::Version

Defined in:
lib/nrser/version.rb

Class Method Summary collapse

Class Method Details

.doc_url(rel_path) ⇒ String

Get a URL to a place in the current version’s docs on ruby-docs.org.

Parameters:

  • rel_path (String)

    Relative path.

Returns:

  • (String)

    The RubyDocs URL.



62
63
64
65
66
67
68
# File 'lib/nrser/version.rb', line 62

def self.doc_url rel_path
  File.join(
    "http://www.rubydoc.info/gems/nrser",
    NRSER::Version.release.to_s,
    rel_path
  )
end

.gem_versionGem::Version

Returns Parse of NRSER::VERSION.

Returns:



29
30
31
# File 'lib/nrser/version.rb', line 29

def self.gem_version
  Gem::Version.new VERSION
end

.releaseGem::Version

The ‘Gem::Version` “release” for NRSER::VERSION - everything before any `-<alpha-numeric>` prerelease part (like `-dev`).

Examples:


NRSER::VERSION
# => '0.0.21.dev'

NRSER::Version.release
# => #<Gem::Version "0.0.21">

Returns:

  • (Gem::Version)

See Also:



49
50
51
# File 'lib/nrser/version.rb', line 49

def self.release
  gem_version.release
end