Class: CoreNYM

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

Overview

CoreNYM version in .env

Class Method Summary collapse

Class Method Details

.core_versionObject

nyasocom tools core version



36
37
38
# File 'lib/nym.rb', line 36

def self.core_version
    '1.1.0'.to_s
end

.gem_versionObject

rubygems version



29
30
31
32
33
# File 'lib/nym.rb', line 29

def self.gem_version
    gversion = 'gem -v'
    stdout_rb, stderr_rb, status_rb = Open3.capture3(gversion)
    version = stdout_rb.to_s
end

.koyomiObject

current date.



8
9
10
11
12
# File 'lib/nym.rb', line 8

def self.koyomi
    dt = Time.new.getlocal('+09:00')
    week = %w(      )[dt.wday]
    @himekuri = "#{dt.year}" + "#{dt.month}" + "#{dt.day}" + ' : '.to_s + "#{dt.hour}"+"#{dt.min}"+"#{dt.sec}" + ' : '.to_s + week + "曜日"
end

.pg_versionObject

libgroonga version in pgroonga



15
16
17
18
19
20
21
# File 'lib/nym.rb', line 15

def self.pg_version
    sql = "SHOW pgroonga.libgroonga_version;"
    query = ActiveRecord::Base.connection.select_all(sql).to_a
    pg_string = (query).to_s.gsub(/[^A-Za-z]/, ' ').rstrip
    pg_number = (query).to_s.gsub(/[^.0-9A-Za-z]/, '').rstrip.delete("A-Za-z").delete_prefix(".").delete_suffix(".")
    @pg_version = pg_string + " " + pg_number
end

.versionObject

version number x.x



24
25
26
# File 'lib/nym.rb', line 24

def self.version
    @version = ENV['NYASOCOMSUN_VERSION']
end