Module: Cran

Defined in:
lib/cran.rb,
lib/cran/db.rb,
lib/cran/config.rb,
lib/cran/adapter.rb,
lib/cran/p_store.rb,
lib/cran/package.rb,
lib/cran/version.rb,
lib/cran/repository.rb,
lib/cran/cli/cran_indexer.rb

Defined Under Namespace

Modules: Adapter, Cli, Config, Db Classes: PStoreAdapter, Package, Repository

Class Method Summary collapse

Class Method Details

.load_versionObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/cran/version.rb', line 2

def self.load_version
  s = ''
  open(File.expand_path('../../../.semver', __FILE__), 'r') do |f|
    v = Hash[f.readlines.map{ |line|
               line
             }.select{ |line|
               line =~ /^:.*:/
             }.map{ |spec|
               spec.split(':').map{ |w| w.strip }.reject { |w| w.empty? }
             }]
    s = "#{v['major']}.#{v['minor']}.#{v['patch']}#{v['special'].chop.reverse.chop.reverse}"
  end
  s
end