focus_common 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/focus_common/app_info.rb +37 -4
- data/lib/focus_common/version.rb +1 -2
- data/makefile +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09b9d81be06a20bd600ef7590a887e3ef9cf21c1fb92a491e64a67c39b5f31b
|
4
|
+
data.tar.gz: 8bb58fca0eadaa64e3bafdfc6b08b941fa55fb59dff715c9fc9d28941ffd1ec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cece40964b5c2aa9a0e289a47afb8955ce6e2c863b266cd2435c71d4f73a25104be2961baf935404eeb47a0d1e9fb98ee1c18b8ef568b83b6dd130552d8c8c38
|
7
|
+
data.tar.gz: 24b4b5d04aeabaaa05929d18de43a05db532dad28970c4fd3fc670d64425c90934334e8c1a31d82e822549c3a448843e325d206997b838dd5a60fa066a4fd35c
|
@@ -11,6 +11,30 @@ class FocusCommon::AppInfo
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
def get_database_info
|
15
|
+
conn = ActiveRecord::Base.connection
|
16
|
+
adapter = conn.adapter_name
|
17
|
+
|
18
|
+
sql = \
|
19
|
+
case adapter
|
20
|
+
when "MSSQL"
|
21
|
+
"SELECT @@VERSION"
|
22
|
+
when "MySQL", "Mysql2", "PostgreSQL"
|
23
|
+
"SELECT VERSION()"
|
24
|
+
when "SQLServer"
|
25
|
+
"SELECT @@VERSION"
|
26
|
+
when "OracleEnhanced"
|
27
|
+
"SELECT * FROM V$VERSION"
|
28
|
+
when "SQLite"
|
29
|
+
"SELECT SQLITE_VERSION()"
|
30
|
+
else
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
v = sql ? conn.select_value(sql) : nil
|
35
|
+
{version: v}
|
36
|
+
end
|
37
|
+
|
14
38
|
def git_version
|
15
39
|
if Rails.env.development?
|
16
40
|
`git rev-parse HEAD`
|
@@ -36,6 +60,7 @@ class FocusCommon::AppInfo
|
|
36
60
|
ruby: RUBY_VERSION,
|
37
61
|
rails: Rails::VERSION::STRING,
|
38
62
|
git: git_version,
|
63
|
+
database: self.get_database_info[:version],
|
39
64
|
},
|
40
65
|
time: {
|
41
66
|
system: {
|
@@ -52,13 +77,13 @@ class FocusCommon::AppInfo
|
|
52
77
|
session_zone: db_time_info[:zone].try(:second),
|
53
78
|
},
|
54
79
|
},
|
55
|
-
important_gems: get_gems.map{|g| [g.name, g.version]}.to_h.slice(
|
80
|
+
important_gems: get_gems.map{|g| [g.name, g.version]}.to_h.slice(*self.important_gems),
|
56
81
|
}
|
57
82
|
|
58
|
-
if defined?(
|
83
|
+
if defined?(CbaDb)
|
59
84
|
info[:cba_site] = \
|
60
|
-
|
61
|
-
namespace =
|
85
|
+
CbaDb.enabled_sites.map do |site|
|
86
|
+
namespace = CbaDb.sites_info.fetch(site, {})[:db_name]
|
62
87
|
[site, namespace]
|
63
88
|
end.to_h
|
64
89
|
end
|
@@ -66,6 +91,14 @@ class FocusCommon::AppInfo
|
|
66
91
|
info
|
67
92
|
end
|
68
93
|
|
94
|
+
def important_gems
|
95
|
+
['sidekiq',
|
96
|
+
'grape',
|
97
|
+
'elasticsearch',
|
98
|
+
'twitter-bootstrap-rails',
|
99
|
+
]
|
100
|
+
end
|
101
|
+
|
69
102
|
def get_gems
|
70
103
|
Gem::Specification.sort_by{ |g| [g.name.downcase, g.version] }
|
71
104
|
end
|
data/lib/focus_common/version.rb
CHANGED
data/makefile
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: focus_common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linjunhalida
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Common library for Focus Solution Inc Rails projects
|
14
14
|
email:
|
@@ -32,7 +32,7 @@ homepage: https://github.com/halida/focus_common
|
|
32
32
|
licenses:
|
33
33
|
- LGPL-3.0
|
34
34
|
metadata: {}
|
35
|
-
post_install_message:
|
35
|
+
post_install_message:
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
38
38
|
- lib
|
@@ -47,8 +47,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
|
-
rubygems_version: 3.
|
51
|
-
signing_key:
|
50
|
+
rubygems_version: 3.5.23
|
51
|
+
signing_key:
|
52
52
|
specification_version: 4
|
53
53
|
summary: Common library for Focus Solution Inc Rails projects
|
54
54
|
test_files: []
|