bizside 3.0.3 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73521110af0354af6ab7be8aeecf81c4b7a51003eba151398a4769981436a528
4
- data.tar.gz: fa0cc7ea9e2b39716154c69ccdc0e736e6b827eba54b060fc1e105a593fd682d
3
+ metadata.gz: 2c335798feba6e981e50b8d9aaa79eca2417627f5de40af3ddbd7d8bdf28fbec
4
+ data.tar.gz: c6317c6ab85daf3ac135564dca835eeec7e41e5c8461fadd48c2ed6ca7f58bfb
5
5
  SHA512:
6
- metadata.gz: 89243ceb64e24a815373006c4ce1d16cc5e5ffdadac4669cad7858b3501bc3e41e0a903c401d82baa734ad15c4f6c518128e51bf55fad0be751d8f9226b387ca
7
- data.tar.gz: e82df91dffd5f633b9ba3b5987aad540fe256079295b3dafeb441fe04a3ad9ee01cff71d9b5bf455a4997a339a99bf1c4a43e9fe2bc8e1e05e12a6c569f772b0
6
+ metadata.gz: ce65569c73a77debb6e7a113fe2e57d634f77b923774463cc8a1ce55fe7744b371f6b6393b00bbad562257373bd6d04e33e85fe0d4550a435c9a428f06e739cf
7
+ data.tar.gz: 38dc38e60d2f93a5da57f6900df7ecb9f8e21027d37de869f59830b8be9da51d0972a3698d6e3543c74c3709aeb635216f149de3b9e6ee330ade3a76a07e316a
@@ -1,33 +1,35 @@
1
1
  module Bizside
2
- class CoverageLaunch
2
+ module Coverage
3
+ class Launch
3
4
 
4
- def self.load
5
- if ENV["COVERAGE"].to_s.downcase == 'true' and ENV['ACCEPTANCE_TEST'].to_s.downcase == 'true'
6
- setup()
5
+ def self.load
6
+ if ENV["COVERAGE"].to_s.downcase == 'true' and ENV['ACCEPTANCE_TEST'].to_s.downcase == 'true'
7
+ setup()
7
8
 
8
- SimpleCov.start 'rails' do
9
- SimpleCov.command_name(ENV['COMMAND_NAME']) if ENV['COMMAND_NAME']
10
- SimpleCov.merge_timeout(7200)
9
+ SimpleCov.start 'rails' do
10
+ SimpleCov.command_name(ENV['COMMAND_NAME']) if ENV['COMMAND_NAME']
11
+ SimpleCov.merge_timeout(7200)
12
+ end
11
13
  end
12
14
  end
13
- end
14
15
 
15
- def self.load_from_test_helper
16
- if ENV["COVERAGE"] == 'true'
17
- setup()
18
- SimpleCov.start 'rails'
16
+ def self.load_from_test_helper
17
+ if ENV["COVERAGE"] == 'true'
18
+ setup()
19
+ SimpleCov.start 'rails'
20
+ end
19
21
  end
20
- end
21
22
 
22
- def self.setup
23
- require 'simplecov'
24
- require 'simplecov-rcov'
25
- require_relative 'rcov_formatter'
26
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
27
- SimpleCov::Formatter::HTMLFormatter,
28
- Coverage::RcovFormatter
29
- ])
23
+ def self.setup
24
+ require 'simplecov'
25
+ require 'simplecov-rcov'
26
+ require_relative 'rcov_formatter'
27
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
28
+ SimpleCov::Formatter::HTMLFormatter,
29
+ Bizside::Coverage::RcovFormatter
30
+ ])
31
+ end
32
+ private_class_method :setup
30
33
  end
31
- private_class_method :setup
32
34
  end
33
35
  end
@@ -1,12 +1,14 @@
1
- module Coverage
2
- class RcovFormatter < SimpleCov::Formatter::RcovFormatter
1
+ module Bizside
2
+ module Coverage
3
+ class RcovFormatter < SimpleCov::Formatter::RcovFormatter
3
4
 
4
- private
5
+ private
5
6
 
6
- def write_file(template, output_filename, binding)
7
- rcov_result = template.result( binding ).force_encoding('UTF-8')
8
- File.open( output_filename, "w" ) do |file_result|
9
- file_result.write rcov_result
7
+ def write_file(template, output_filename, binding)
8
+ rcov_result = template.result( binding ).force_encoding('UTF-8')
9
+ File.open( output_filename, "w" ) do |file_result|
10
+ file_result.write rcov_result
11
+ end
10
12
  end
11
13
  end
12
14
  end
@@ -121,7 +121,7 @@ module Bizside
121
121
  # config/itamae.yml:: 設定ファイル-2(*2)
122
122
  # /etc/bizside/hanaita.yml:: 設定ファイル-3
123
123
  #
124
- # (*1) RAISL_ENV に該当する部分のみ 'db' エントリの下に読み込みます。
124
+ # (*1) RAILS_ENV に該当する部分のみ 'db' エントリの下に読み込みます。
125
125
  # (*2) 指定された ROLE のみ読み込みます。
126
126
  class ItamaeConf < ItamaeConfSub
127
127
  class OverWriteError < StandardError; end
@@ -1,5 +1,5 @@
1
1
  require_relative 'coverage/launch'
2
- Bizside::CoverageLaunch.load()
2
+ Bizside::Coverage::Launch.load()
3
3
 
4
4
  module Bizside
5
5
  class Railtie < ::Rails::Railtie
@@ -159,3 +159,39 @@ end
159
159
  Resque::Failure::Multiple.configure do |multi|
160
160
  multi.classes = [Resque::Failure::Redis, Resque::Failure::LogOutput, Resque::Failure::JobAuditLog]
161
161
  end
162
+
163
+ # resque-scheduler
164
+ if defined? Resque::Scheduler
165
+ module Bizside
166
+ module ResqueScheduler
167
+ class FailureHandler
168
+ def self.on_enqueue_failure(payload, exception)
169
+ ::Resque::Scheduler::FailureHandler.on_enqueue_failure(payload, exception)
170
+
171
+ return if Bizside.rails_env&.test?
172
+
173
+ ::Bizside.logger.error [
174
+ "[FATAL] Resque::Scheduler",
175
+ "#{payload}",
176
+ "#{exception.class} #{exception.to_s}",
177
+ "#{Array(exception.backtrace).join("\n")}"
178
+ ].join("\n")
179
+
180
+ @hostname ||= (`hostname`.chomp rescue '(unknown)')
181
+ info = {
182
+ time: Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z'),
183
+ add_on_name: Bizside.config.add_on_name,
184
+ server_address: @hostname,
185
+ class: payload['class'],
186
+ args: payload['args'].to_s,
187
+ exception: exception.class,
188
+ exception_message: exception.to_s,
189
+ exception_backtrace: Array(exception.backtrace)[0..10].join("\n") # Get only the top 10 because there are many traces.
190
+ }
191
+ ::Bizside::Audit::JobLogger.logger.record(info)
192
+ end
193
+ end
194
+ end
195
+ end
196
+ Resque::Scheduler.failure_handler = Bizside::ResqueScheduler::FailureHandler
197
+ end
@@ -1,7 +1,7 @@
1
1
  require 'minitest/reporters'
2
2
 
3
3
  require_relative 'coverage/launch'
4
- Bizside::CoverageLaunch.load_from_test_helper()
4
+ Bizside::Coverage::Launch.load_from_test_helper()
5
5
 
6
6
  case ENV['CI'].to_s.downcase
7
7
  when 'jenkins'
@@ -1,3 +1,3 @@
1
1
  module Bizside
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizside
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - bizside-developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -475,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
475
475
  - !ruby/object:Gem::Version
476
476
  version: '0'
477
477
  requirements: []
478
- rubygems_version: 3.3.26
478
+ rubygems_version: 3.4.18
479
479
  signing_key:
480
480
  specification_version: 4
481
481
  summary: Bizside is an utilities for web application.