Class: CoreNYM
- Inherits:
-
Object
- Object
- CoreNYM
- Defined in:
- lib/core.rb
Overview
CoreNYM version in .env
Class Method Summary collapse
-
.koyomi ⇒ Object
current date.
-
.pg_version ⇒ Object
libgroonga version in pgroonga.
-
.version ⇒ Object
version number x.x.
Class Method Details
.koyomi ⇒ Object
current date.
6 7 8 9 10 |
# File 'lib/core.rb', line 6 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_version ⇒ Object
libgroonga version in pgroonga
13 14 15 16 17 18 19 |
# File 'lib/core.rb', line 13 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 |
.version ⇒ Object
version number x.x
22 23 24 |
# File 'lib/core.rb', line 22 def self.version @version = ENV['NYASOCOMSUN_VERSION'] end |