diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b60113..72c089b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["2.7", "3.0", "3.1", "3.2"] + ruby: ["3.0", "3.1", "3.2", "3.3"] services: postgres: diff --git a/.rubocop.yml b/.rubocop.yml index 77d512f..8332173 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,7 +3,8 @@ inherit_gem: AllCops: DisplayCopNames: true - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 + SuggestExtensions: false Naming/MethodParameterName: AllowedNames: ["x", "y", "z"] diff --git a/Gemfile.lock b/Gemfile.lock index 6875a57..d0349b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,125 +1,141 @@ PATH remote: . specs: - umbrellio-utils (0.7.5) + umbrellio-utils (1.0.0) memery (~> 1) GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + actioncable (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8) - actionpack (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activesupport (= 7.0.8) + actionmailer (7.1.3.2) + actionpack (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activesupport (= 7.1.3.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8) - actionview (= 7.0.8) - activesupport (= 7.0.8) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.3.2) + actionview (= 7.1.3.2) + activesupport (= 7.1.3.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8) - actionpack (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.2) + actionpack (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8) - activesupport (= 7.0.8) + actionview (7.1.3.2) + activesupport (= 7.1.3.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8) - activesupport (= 7.0.8) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.2) + activesupport (= 7.1.3.2) globalid (>= 0.3.6) - activemodel (7.0.8) - activesupport (= 7.0.8) - activerecord (7.0.8) - activemodel (= 7.0.8) - activesupport (= 7.0.8) - activestorage (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activesupport (= 7.0.8) + activemodel (7.1.3.2) + activesupport (= 7.1.3.2) + activerecord (7.1.3.2) + activemodel (= 7.1.3.2) + activesupport (= 7.1.3.2) + timeout (>= 0.4.0) + activestorage (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activesupport (= 7.1.3.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8) + activesupport (7.1.3.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - amazing_print (1.5.0) + amazing_print (1.6.0) amq-protocol (2.3.2) ast (2.4.2) - bigdecimal (3.1.4) + base64 (0.2.0) + bigdecimal (3.1.7) builder (3.2.4) bunny (2.22.0) amq-protocol (~> 2.3, >= 2.3.1) sorted_set (~> 1, >= 1.0.2) - ci-helper (0.5.0) - colorize (~> 0.8) - dry-inflector (~> 0.2) - umbrellio-sequel-plugins (~> 0.4) + ci-helper (0.6.0) + colorize (~> 1.1) + dry-inflector (~> 1.0) + umbrellio-sequel-plugins (~> 0.14) coderay (1.1.3) - colorize (0.8.1) - concurrent-ruby (1.2.2) + colorize (1.1.0) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) - diff-lcs (1.5.0) + date (3.3.4) + diff-lcs (1.5.1) docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dry-inflector (0.3.0) + domain_name (0.6.20240107) + drb (2.2.1) + dry-inflector (1.0.0) erubi (1.12.0) - ffi (1.15.5) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) + ffi (1.16.3) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) rake globalid (1.2.1) activesupport (>= 6.1) - http (5.1.1) + http (5.2.0) addressable (~> 2.8) + base64 (~> 0.1) http-cookie (~> 1.0) http-form_data (~> 2.2) - llhttp-ffi (~> 0.4.0) + llhttp-ffi (~> 0.5.0) http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) - json (2.6.3) - lamian (1.7.0) + io-console (0.7.2) + irb (1.12.0) + rdoc + reline (>= 0.4.2) + json (2.7.2) + lamian (1.8.0) rails (>= 4.2) - llhttp-ffi (0.4.0) + llhttp-ffi (0.5.0) ffi-compiler (~> 1.0) rake (~> 13.0) - loofah (2.21.3) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -127,42 +143,40 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) memery (1.5.0) ruby2_keywords (~> 0.0.2) - method_source (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.20.0) - net-imap (0.3.7) + mini_portile2 (2.8.6) + minitest (5.22.3) + mutex_m (0.2.0) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.5) + nio4r (2.7.1) + nokogiri (1.15.6) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.5-arm64-darwin) - racc (~> 1.4) - nokogiri (1.15.5-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.15.5-x86_64-linux) - racc (~> 1.4) - nori (2.6.0) - parallel (1.23.0) - parser (3.2.2.3) + nori (2.7.0) + bigdecimal + parallel (1.24.0) + parser (3.3.0.5) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.6) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.3) + psych (5.1.2) + stringio + public_suffix (5.0.5) rabbit_messaging (0.13.0) bunny (~> 2.0) lamian @@ -170,23 +184,28 @@ GEM sneakers (~> 2.0) tainbox racc (1.7.3) - rack (2.2.8) + rack (3.0.10) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8) - actioncable (= 7.0.8) - actionmailbox (= 7.0.8) - actionmailer (= 7.0.8) - actionpack (= 7.0.8) - actiontext (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activemodel (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.2) + actioncable (= 7.1.3.2) + actionmailbox (= 7.1.3.2) + actionmailer (= 7.1.3.2) + actionpack (= 7.1.3.2) + actiontext (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activemodel (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) bundler (>= 1.15.0) - railties (= 7.0.8) + railties (= 7.1.3.2) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -194,34 +213,39 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) - method_source + railties (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.2.1) rbtree (0.4.6) - regexp_parser (2.8.1) + rdoc (6.6.3.1) + psych (>= 4.0.0) + regexp_parser (2.9.0) + reline (0.5.1) + io-console (~> 0.5) rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-json_matcher (0.2.0) amazing_print json - rspec-mocks (3.12.6) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) rubocop (1.50.2) json (~> 2.3) parallel (~> 1.10) @@ -232,9 +256,9 @@ GEM rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-capybara (2.20.0) rubocop (~> 1.41) rubocop-config-umbrellio (1.50.0.85) rubocop (~> 1.50.0) @@ -260,15 +284,15 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) self_data (1.3.0) - semantic_logger (4.14.0) + semantic_logger (4.15.0) concurrent-ruby (~> 1.0) - sequel (5.72.0) + sequel (5.79.0) bigdecimal sequel-batches (2.0.2) sequel serverengine (2.0.7) sigdump (~> 0.2.2) - set (1.0.3) + set (1.1.0) sigdump (0.2.5) simplecov (0.22.0) docile (~> 1.1) @@ -286,31 +310,30 @@ GEM sorted_set (1.0.3) rbtree set (~> 1.0) + stringio (3.1.0) symbiont-ruby (0.7.0) - table_sync (6.4.1) + table_sync (6.5.0) memery rabbit_messaging (~> 0.13) rails self_data tainbox (2.1.2) activesupport - thor (1.2.2) + thor (1.3.1) timecop (0.9.8) - timeout (0.4.0) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - umbrellio-sequel-plugins (0.14.0.187) + umbrellio-sequel-plugins (0.14.0.192) sequel symbiont-ruby - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) + webrick (1.8.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - yard (0.9.34) - zeitwerk (2.6.11) + yard (0.9.36) + zeitwerk (2.6.13) PLATFORMS arm64-darwin-20 @@ -344,4 +367,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.4.5 + 2.5.9 diff --git a/lib/umbrellio_utils/checks.rb b/lib/umbrellio_utils/checks.rb index 569e3b6..bc00981 100644 --- a/lib/umbrellio_utils/checks.rb +++ b/lib/umbrellio_utils/checks.rb @@ -4,8 +4,8 @@ module UmbrellioUtils module Checks extend self - EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i.freeze - HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/.freeze + EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i + HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/ def secure_compare(src, dest) ActiveSupport::SecurityUtils.secure_compare( diff --git a/lib/umbrellio_utils/parsing.rb b/lib/umbrellio_utils/parsing.rb index 1c17c6c..4f0f90b 100644 --- a/lib/umbrellio_utils/parsing.rb +++ b/lib/umbrellio_utils/parsing.rb @@ -9,7 +9,7 @@ module Parsing HTTP_X_HTTP_AUTHORIZATION HTTP_REDIRECT_X_HTTP_AUTHORIZATION ].freeze - CARD_TRUNCATED_PAN_REGEX = /\A(\d{6}).*(\d{4})\z/.freeze + CARD_TRUNCATED_PAN_REGEX = /\A(\d{6}).*(\d{4})\z/ def try_to_parse_as_json(data) JSON.parse(data) rescue data diff --git a/lib/umbrellio_utils/semantic_logger/tiny_json_formatter.rb b/lib/umbrellio_utils/semantic_logger/tiny_json_formatter.rb index e8040c3..0322331 100644 --- a/lib/umbrellio_utils/semantic_logger/tiny_json_formatter.rb +++ b/lib/umbrellio_utils/semantic_logger/tiny_json_formatter.rb @@ -21,7 +21,8 @@ class TinyJsonFormatter }.freeze # Returns a new instance of the {UmbrellioUtils::SemanticLogger::TinyJsonFormatter}. - # @param [Hash] custom_names_mapping mapping from default field names to custom ones. + # @option [Integer] message_size_limit maximum number of characters in a log message + # @option [Hash] custom_names_mapping mapping from default field names to custom ones. # @option custom_names_mapping [Symbol] :severity custom name for the `severity` field. # @option custom_names_mapping [Symbol] :name custom name for the `name` field. # @option custom_names_mapping [Symbol] :thread_fingerprint @@ -36,7 +37,8 @@ class TinyJsonFormatter # ) #=> # @return [UmbrellioUtils::SemanticLogger::TinyJsonFormatter] # a new instance of the {UmbrellioUtils::SemanticLogger::TinyJsonFormatter} - def initialize(**custom_names_mapping) + def initialize(message_size_limit: 10_000, custom_names_mapping: {}) + self.message_size_limit = message_size_limit self.field_names = { **DEFAULT_NAMES_MAPPING, **custom_names_mapping }.freeze end @@ -53,7 +55,7 @@ def call(log, _logger) # @!attribute field_names # @return [Hash] the mapping from default field names to the new ones. - attr_accessor :field_names + attr_accessor :message_size_limit, :field_names # Builds hash with data from log. # @return [Hash] the hash, which will be converted to the JSON later. @@ -69,8 +71,8 @@ def pack_data(log) [ log.level.upcase, log.name, - thread_fingerprint_for(log), - log_to_message(log), + thread_fingerprint, + truncate(log_to_message(log)), log.tags, log.named_tags, log.time.utc.iso8601(9), @@ -79,8 +81,8 @@ def pack_data(log) # Calculates MD5 fingerprint for the thread in which the log was made. # @return [String] truncated `MD5` hash. - def thread_fingerprint_for(log) - Digest::MD5.hexdigest("#{log.thread_name}#{Process.pid}")[0...8] + def thread_fingerprint + Digest::MD5.hexdigest("#{Thread.current.object_id}-#{Process.pid}")[0...8] end # Renders either exception or message of the log. @@ -91,9 +93,18 @@ def log_to_message(log) msg << "\n#{e.backtrace.join("\n")}" if e.backtrace msg else - log.message + log.message.to_s end end + + def truncate(msg) + return msg unless msg.size > message_size_limit + + suffix = "..." + msg = msg[0, message_size_limit - suffix.size] + + "#{msg}#{suffix}" + end end end end diff --git a/lib/umbrellio_utils/version.rb b/lib/umbrellio_utils/version.rb index e2cee8d..25c84bd 100644 --- a/lib/umbrellio_utils/version.rb +++ b/lib/umbrellio_utils/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module UmbrellioUtils - VERSION = "0.7.5" + VERSION = "1.0.0" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 73d9b7f..ec7c1f1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -34,7 +34,7 @@ require "umbrellio-utils" -Dir[Pathname(__dir__).join("support/**/*")].sort.each { |x| require(x) } +Dir[Pathname(__dir__).join("support/**/*")].each { |x| require(x) } TableSync.orm = :sequel TableSync.headers_callable = -> (_klass, attributes) { attributes.slice(:id) } diff --git a/spec/umbrellio_utils/request_wrapper_spec.rb b/spec/umbrellio_utils/request_wrapper_spec.rb index 6432fc4..cc39b8a 100644 --- a/spec/umbrellio_utils/request_wrapper_spec.rb +++ b/spec/umbrellio_utils/request_wrapper_spec.rb @@ -136,9 +136,9 @@ { "CONTENT_LENGTH" => "0", "CONTENT_TYPE" => "application/json", - "HTTPS" => "off", "HTTP_HOST" => "test.host", "HTTP_USER_AGENT" => "Rails Testing", + "HTTPS" => "off", "PATH_INFO" => "/", "QUERY_STRING" => "", "REMOTE_ADDR" => "192.168.0.1", @@ -146,6 +146,7 @@ "SCRIPT_NAME" => "", "SERVER_NAME" => "example.org", "SERVER_PORT" => "80", + "SERVER_PROTOCOL" => "HTTP/1.1", } end @@ -170,16 +171,14 @@ describe "#headers" do let(:expected_headers) do { - "rack.multithread" => true, - "rack.multiprocess" => true, - "rack.run_once" => false, + "HTTPS" => "off", + "PATH_INFO" => "/", + "QUERY_STRING" => "", + "rack.url_scheme" => "http", "REQUEST_METHOD" => "GET", "SERVER_NAME" => "example.org", "SERVER_PORT" => "80", - "QUERY_STRING" => "", - "PATH_INFO" => "/", - "rack.url_scheme" => "http", - "HTTPS" => "off", + "SERVER_PROTOCOL" => "HTTP/1.1", } end diff --git a/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb b/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb index b56d9a4..5652f91 100644 --- a/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb +++ b/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb @@ -2,19 +2,22 @@ describe UmbrellioUtils::SemanticLogger::TinyJsonFormatter do before { stub_const("UmbrellioUtils::SemanticLogger::TinyJsonFormatter::Process", process_stub) } + before { stub_const("UmbrellioUtils::SemanticLogger::TinyJsonFormatter::Thread", thread_stub) } let(:process_stub) do class_double(Process).tap do |klass| - allow(klass).to receive(:pid).and_return(process_pid) + allow(klass).to receive(:pid).and_return(2222) end end - let(:process_pid) { 1234 } + + let(:thread_stub) do + double(current: instance_double(Thread, object_id: 1111)) + end let(:log) do instance_double(SemanticLogger::Log).tap do |instance| allow(instance).to receive(:level).and_return(log_level) allow(instance).to receive(:name).and_return(log_name) - allow(instance).to receive(:thread_name).and_return(log_thread_name) allow(instance).to receive(:message).and_return(log_message) allow(instance).to receive(:exception).and_return(log_exception) allow(instance).to receive(:tags).and_return(log_tags) @@ -24,23 +27,26 @@ end let(:result) { formatter.call(log, nil) } - let(:formatter) { described_class.new(**custom_names_mapping) } + let(:formatter) { described_class.new(**options) } + let(:options) { Hash[custom_names_mapping: custom_names_mapping] } let(:custom_names_mapping) { Hash[] } let(:log_level) { :debug } let(:log_name) { "SomeName" } - let(:log_thread_name) { "10706" } let(:log_message) { "Some Message" } let(:log_exception) { nil } let(:log_tags) { [] } let(:log_named_tags) { Hash[] } let(:log_time) { Time.utc(2007) } + # md5(1111-2222) = b78cbe5f798598ea7f1ab6dc4158499d + let(:expected_thread_fingerprint) { "b78cbe5f" } + it "properly formats log" do expect(result).to be_json_as( severity: "DEBUG", name: "SomeName", - thread_fingerprint: "85bb6139", + thread_fingerprint: expected_thread_fingerprint, message: "Some Message", time: "2007-01-01T00:00:00.000000000Z", tags: [], @@ -48,6 +54,22 @@ ) end + context "with custom message_size_limit" do + let(:options) { Hash[message_size_limit: 8] } + + it "truncates message" do + expect(result).to be_json_including(message: "Some ...") + end + + context "with nil message" do + let(:log_message) { nil } + + it "logs blank message" do + expect(result).to be_json_including(message: "") + end + end + end + context "with custom field names" do let(:custom_names_mapping) { Hash[message: :note, time: :timestamp] } @@ -55,7 +77,7 @@ expect(result).to be_json_as( severity: "DEBUG", name: "SomeName", - thread_fingerprint: "85bb6139", + thread_fingerprint: expected_thread_fingerprint, note: "Some Message", timestamp: "2007-01-01T00:00:00.000000000Z", tags: [], @@ -71,7 +93,7 @@ expect(result).to be_json_as( severity: "DEBUG", name: "SomeName", - thread_fingerprint: "85bb6139", + thread_fingerprint: expected_thread_fingerprint, message: "Some Message", time: "2007-01-01T00:00:00.000000000Z", tags: [], @@ -88,7 +110,7 @@ expect(result).to be_json_as( severity: "DEBUG", name: "SomeName", - thread_fingerprint: "85bb6139", + thread_fingerprint: expected_thread_fingerprint, message: "Some Message", time: "2007-01-01T00:00:00.000000000Z", tags: ["kek"], @@ -104,7 +126,7 @@ expect(result).to be_json_as( severity: "DEBUG", name: "SomeName", - thread_fingerprint: "85bb6139", + thread_fingerprint: expected_thread_fingerprint, message: "Error! (RuntimeError)", time: "2007-01-01T00:00:00.000000000Z", tags: [], @@ -119,7 +141,7 @@ expect(result).to be_json_as( severity: "DEBUG", name: "SomeName", - thread_fingerprint: "85bb6139", + thread_fingerprint: expected_thread_fingerprint, message: "Error! (RuntimeError)\n1\n2\n3", time: "2007-01-01T00:00:00.000000000Z", tags: [], diff --git a/umbrellio_utils.gemspec b/umbrellio_utils.gemspec index f582082..1381927 100644 --- a/umbrellio_utils.gemspec +++ b/umbrellio_utils.gemspec @@ -5,14 +5,14 @@ require_relative "lib/umbrellio_utils/version" Gem::Specification.new do |spec| spec.name = "umbrellio-utils" spec.version = UmbrellioUtils::VERSION - spec.authors = ["JustAnotherDude"] - spec.email = ["VanyaZ158@gmail.com"] + spec.authors = ["Team Umbrellio"] + spec.email = ["oss@umbrellio.biz"] spec.summary = "A set of utilities that speed up development" spec.description = "UmbrellioUtils is collection of utility classes and helpers" spec.homepage = "https://github.com/umbrellio/utils" spec.license = "MIT" - spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") + spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0") spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com/umbrellio/utils"