focus_common 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f68c50ff019b3943eb41032e45c47428bd5f8edf53f61cdc1d25164400039a4
4
- data.tar.gz: 513d24a149fe4c742679a73ff0307bd062ec5f6929a60a0bb5216a94d5ffb133
3
+ metadata.gz: c31f69a408d2cfb5939ffe8d2ca9ee7056f37e0ae3f4931af246450191cf036d
4
+ data.tar.gz: b63ebb1cac3cd016f896547348e9be1a6716b2141000862f16cb3c52a940f63f
5
5
  SHA512:
6
- metadata.gz: 23a63d542e1226f80f6e92e4756ee8940df30c810715edef745a32b34afa3654a22dc73fb41363947fe977cf2180322864f890236a0cc5da874b7c558724bf4c
7
- data.tar.gz: de52371e9a48df210c257fe75f6232ea1bbb4edaa94d5c74ed12537dbe586d8766648271acd312d01b1ed81284813c331fc40287322c6196835fafc2f4a857a2
6
+ metadata.gz: 48e79968501e3702b51aa71111995c02665524b327277ec971e9e9332d881d0d86191d0352a03610ee850a146464a0534378d30d82814cce2525254f18a74c11
7
+ data.tar.gz: e0a2d41166292f43e377de8dbb2233fe4f704861c1286496e62674a59a7eead8bc29876ab6d6cb1081a5b8c4d5744b982625208dce0fa9470a296fc9755c19aa
@@ -11,6 +11,16 @@ class FocusCommon::AppInfo
11
11
  end
12
12
  end
13
13
 
14
+ def get_database_info
15
+ conn = ActiveRecord::Base.connection
16
+ if conn.class.name.demodulize == 'Mysql2Adapter'
17
+ {version: conn.select_value("SELECT @@version"),
18
+ }
19
+ else
20
+ {}
21
+ end
22
+ end
23
+
14
24
  def git_version
15
25
  if Rails.env.development?
16
26
  `git rev-parse HEAD`
@@ -36,6 +46,7 @@ class FocusCommon::AppInfo
36
46
  ruby: RUBY_VERSION,
37
47
  rails: Rails::VERSION::STRING,
38
48
  git: git_version,
49
+ database: self.get_database_info[:version],
39
50
  },
40
51
  time: {
41
52
  system: {
@@ -52,13 +63,13 @@ class FocusCommon::AppInfo
52
63
  session_zone: db_time_info[:zone].try(:second),
53
64
  },
54
65
  },
55
- important_gems: get_gems.map{|g| [g.name, g.version]}.to_h.slice('sidekiq'),
66
+ important_gems: get_gems.map{|g| [g.name, g.version]}.to_h.slice(*self.important_gems),
56
67
  }
57
68
 
58
- if defined?(CbaDB)
69
+ if defined?(CbaDb)
59
70
  info[:cba_site] = \
60
- CbaDB.enabled_sites.map do |site|
61
- namespace = CbaDB.sites_info.fetch(site, {})[:db_name]
71
+ CbaDb.enabled_sites.map do |site|
72
+ namespace = CbaDb.sites_info.fetch(site, {})[:db_name]
62
73
  [site, namespace]
63
74
  end.to_h
64
75
  end
@@ -66,6 +77,14 @@ class FocusCommon::AppInfo
66
77
  info
67
78
  end
68
79
 
80
+ def important_gems
81
+ ['sidekiq',
82
+ 'grape',
83
+ 'elasticsearch',
84
+ 'twitter-bootstrap-rails',
85
+ ]
86
+ end
87
+
69
88
  def get_gems
70
89
  Gem::Specification.sort_by{ |g| [g.name.downcase, g.version] }
71
90
  end
@@ -1,4 +1,3 @@
1
1
  module FocusCommon
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
4
-
data/makefile CHANGED
@@ -1,7 +1,7 @@
1
1
  build:
2
2
  gem build focus_common.gemspec
3
3
 
4
- upload:
4
+ upload: clear build
5
5
  gem push *.gem
6
6
 
7
7
  clear:
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - linjunhalida
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-20 00:00:00.000000000 Z
11
+ date: 2025-01-10 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.0.8
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: []