rimless 1.4.2 → 1.5.1

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: 5eb06c668517f7d1e2e2a122cdd8586ada5c6c69b8d08448e2163f4628b22b91
4
- data.tar.gz: b40442ca44912688d5230b25680c1c82f69845ad62f9420306e9710530542306
3
+ metadata.gz: c49d6db3a548187e76ca5ee01121a91543c13a2a98ed7afe0a22d299f1869b88
4
+ data.tar.gz: ca412431753486b42b92c952c30bd24a2104cca1fc9ad2eb7e6672893bbedb93
5
5
  SHA512:
6
- metadata.gz: d2ec34319a309770fd831655c2e370da52e55f43118c3d61b3a28a3dbc625840e776234a54d481e1c9bfff9f16b75df90bc2cf56ec00e6266be1a121cead757e
7
- data.tar.gz: e13af984580349ed5567be7bf8c7513e3ef03dacb59f4b329cb0769ff82e0260d04bcb027907400aed59f5e5e6e5571f6e1e42db2da08c3cb9f43b541f58f0dd
6
+ metadata.gz: 664037e7791bed603c7426bf59f26f1164cb6e3344457e3956361e5bac5bfd58efc57272072e0dc2a20205827271e4c8eb5d17c83fe2dd59cde8423932c9ae30
7
+ data.tar.gz: ae577c63363a7903509ee8d5428c2328c278b4a6dd6c6c9a061d4bbde60eb73b46f45986da0fa0651260435f01dbe201d64713ddf268111929abc2f196f4b1c9
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-22.04
13
13
  timeout-minutes: 5
14
14
  steps:
15
- - uses: actions/checkout@v3
15
+ - uses: actions/checkout@v4
16
16
 
17
17
  - name: Install the correct Ruby version
18
18
  uses: ruby/setup-ruby@v1
@@ -18,7 +18,7 @@ jobs:
18
18
  runs-on: ubuntu-22.04
19
19
  timeout-minutes: 5
20
20
  steps:
21
- - uses: actions/checkout@v3
21
+ - uses: actions/checkout@v4
22
22
 
23
23
  - name: Install Ruby 2.5
24
24
  uses: ruby/setup-ruby@v1
@@ -23,7 +23,7 @@ jobs:
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
26
- - uses: actions/checkout@v3
26
+ - uses: actions/checkout@v4
27
27
 
28
28
  - name: Install the correct Ruby version
29
29
  uses: ruby/setup-ruby@v1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 1.5.1
6
+
7
+ * Added a retry to write compiled schema files as this may fail on parallel
8
+ execution (#33)
9
+
10
+ ### 1.5.0
11
+
12
+ * Do not extend the `Rimless.logger` to write to stdout by default when running
13
+ in the `development` environment - this generates duplicated messages when
14
+ the configured logger already writes to stdout. A new configuration was added
15
+ `Rimless.configuration.extend_dev_logger = false` was added (#32)
16
+
5
17
  ### 1.4.2
6
18
 
7
19
  * Reverted to use `yield_self` instead of `then` in order to support Ruby 2.5
data/Gemfile CHANGED
@@ -11,7 +11,9 @@ gemspec
11
11
  gem 'appraisal', '~> 2.4'
12
12
  gem 'bundler', '~> 2.3'
13
13
  gem 'countless', '~> 1.1'
14
- gem 'factory_bot', '~> 6.2'
14
+ # TODO: Remove the upper lock when
15
+ # https://github.com/thoughtbot/factory_bot/issues/1614 is solved.
16
+ gem 'factory_bot', '~> 6.2', '< 6.4.5'
15
17
  gem 'guard-rspec', '~> 4.7'
16
18
  gem 'railties', '>= 5.2'
17
19
  gem 'rake', '~> 13.0'
data/Makefile CHANGED
@@ -25,6 +25,7 @@ ID ?= id
25
25
  MKDIR ?= mkdir
26
26
  RM ?= rm
27
27
  XARGS ?= xargs
28
+ TEST ?= test
28
29
 
29
30
  # Container binaries
30
31
  APPRAISAL ?= appraisal
@@ -35,6 +36,7 @@ RAKE ?= rake
35
36
  RSPEC ?= rspec
36
37
  RUBOCOP ?= rubocop
37
38
  YARD ?= yard
39
+ RUBY_VERSION := ruby-version
38
40
 
39
41
  # Files
40
42
  GEMFILES ?= $(subst _,-,$(patsubst $(GEMFILES_DIR)/%.gemfile,%,\
@@ -113,7 +115,8 @@ test-style: \
113
115
 
114
116
  test-style-ruby:
115
117
  # Run the static code analyzer (rubocop)
116
- @$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a)
118
+ @$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a \
119
+ || ($(TEST) $$($(RUBY_VERSION)) != '2.5' && true))
117
120
 
118
121
  clean:
119
122
  # Clean the dependencies
@@ -5,7 +5,7 @@ MAINTAINER Hermann Mayer <hermann.mayer@hausgold.de>
5
5
  RUN gem update --system
6
6
 
7
7
  # Add backports repository
8
- RUN echo 'deb http://ftp.debian.org/debian buster-backports main' \
8
+ RUN echo 'deb http://archive.debian.org/debian buster-backports main' \
9
9
  >> /etc/apt/sources.list
10
10
 
11
11
  # Install nodejs 16
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.3"
7
7
  gem "countless", "~> 1.1"
8
- gem "factory_bot", "~> 6.2"
8
+ gem "factory_bot", "~> 6.2", "< 6.4.5"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", "~> 5.2.0"
11
11
  gem "rake", "~> 13.0"
@@ -34,10 +34,15 @@ module Rimless
34
34
  def render_file(src)
35
35
  # Convert the template path to the destination path
36
36
  dest = schema_path(src)
37
- # Create the deep path when not yet existing
38
- FileUtils.mkdir_p(File.dirname(dest))
39
- # Write the rendered file contents to the destination
40
- File.write(dest, ERB.new(File.read(src)).result(binding))
37
+
38
+ # Allow parallel cleanups and execution
39
+ with_retries(max_tries: 3, rescue: Errno::ENOENT) do
40
+ # Create the deep path when not yet existing
41
+ FileUtils.mkdir_p(File.dirname(dest))
42
+ # Write the rendered file contents to the destination
43
+ File.write(dest, ERB.new(File.read(src)).result(binding))
44
+ end
45
+
41
46
  # Check the written file for correct JSON
42
47
  validate_file(dest)
43
48
  end
@@ -27,6 +27,10 @@ module Rimless
27
27
  Logger.new($stdout)
28
28
  end
29
29
 
30
+ # Whenever the logger should be extended to write to stdout when
31
+ # running in development environment (Rimless.env)
32
+ config_accessor(:extend_dev_logger) { false }
33
+
30
34
  # At least one broker of the Apache Kafka cluster
31
35
  config_accessor(:kafka_brokers) do
32
36
  ENV.fetch('KAFKA_BROKERS', 'kafka://message-bus.local:9092').split(',')
@@ -88,6 +88,10 @@ module Rimless
88
88
  # When we run in development mode, we want to write the logs
89
89
  # to file and to stdout.
90
90
  def initialize_logger!
91
+ # Skip when configured not to extend the logger
92
+ return unless Rimless.configuration.extend_dev_logger
93
+
94
+ # Skip when not in development environment or in the server process
91
95
  return unless Rimless.env.development? && server?
92
96
 
93
97
  $stdout.sync = true
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module Rimless
5
5
  # The version of the +rimless+ gem
6
- VERSION = '1.4.2'
6
+ VERSION = '1.5.1'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/rimless.rb CHANGED
@@ -14,6 +14,7 @@ require 'avro_turf/messaging'
14
14
  require 'karafka'
15
15
  require 'karafka-sidekiq-backend'
16
16
  require 'sparsify'
17
+ require 'retries'
17
18
  require 'erb'
18
19
 
19
20
  # The top level namespace for the rimless gem.
data/rimless.gemspec CHANGED
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_runtime_dependency 'karafka', '~> 1.4', '< 1.4.15'
41
41
  spec.add_runtime_dependency 'karafka-sidekiq-backend', '~> 1.4'
42
42
  spec.add_runtime_dependency 'karafka-testing', '~> 1.4'
43
+ spec.add_runtime_dependency 'retries', '>= 0.0.5'
43
44
  spec.add_runtime_dependency 'sinatra', '~> 2.2'
44
45
  spec.add_runtime_dependency 'sparsify', '~> 1.1'
45
46
  spec.add_runtime_dependency 'waterdrop', '~> 1.4'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rimless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-12 00:00:00.000000000 Z
11
+ date: 2024-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,6 +86,20 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.4'
89
+ - !ruby/object:Gem::Dependency
90
+ name: retries
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 0.0.5
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 0.0.5
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: sinatra
91
105
  requirement: !ruby/object:Gem::Requirement