boltless 1.6.1 → 2.1.0

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: be9714a261e455fc60abca29af5d1ca6fa7b8fc3432e470f9d4ee081b8c5ac2e
4
- data.tar.gz: a4d9a56f1d4bad89cb9d2bb4a20a12cc7ad2275a6b178610cd4deff3f37c5544
3
+ metadata.gz: f8b7c4416097390006b201dcec4ce9beaa8190659d079da12af5e01689670aff
4
+ data.tar.gz: 434205668e628cb4b0d12a1451a83dac804cea38c1a045f3982f8157e9e25873
5
5
  SHA512:
6
- metadata.gz: fc326d69c64d09ba47e54d8f4950ed2a8a09f8057084abb6551616365f8ddd0da53f04d188826639f3bcb2440a2d3114daf6136977c0b68622b122dc63273e8e
7
- data.tar.gz: e432b377429d7b3ee99d83777bad37d458698bfec8f16d35dcbdbaa74e615a54c95dfe2712c56b93f18c474ee5bce5ae0d18d3d90f87fe42f642d5307eb20a63
6
+ metadata.gz: d20881d61af51e69287d45b36358c8bd35f2709e16b43439b598c542fe92a09f33a182260a2cc19360ddf3586f6c918e79957d1bb3b20b3eb5dafedfdd12273a
7
+ data.tar.gz: 163eb7a5a639a046a2801ecc002772c0eac9f0b6fe9113f9c35c0271cf41e3aee75137fd17d3c6278957caa67a29e1919e0fd7fcdfac6feb5a4939b65ddf1b59
data/Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
- FROM hausgold/ruby:2.7
1
+ FROM hausgold/ruby:3.2
2
2
  LABEL org.opencontainers.image.authors="containers@hausgold.de"
3
3
 
4
4
  # Update system gem
5
- RUN gem update --system '3.4.22'
5
+ RUN gem update --system '3.6.9'
6
6
 
7
7
  # Install system packages and the latest bundler
8
8
  RUN apt-get update -yqqq && \
@@ -11,7 +11,7 @@ RUN apt-get update -yqqq && \
11
11
  ca-certificates \
12
12
  bash-completion inotify-tools && \
13
13
  echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \
14
- gem install bundler -v '~> 2.4.22' --no-document --no-prerelease
14
+ gem install bundler -v '~> 2.6.9' --no-document --no-prerelease
15
15
 
16
16
  # Add new web user
17
17
  RUN mkdir /app && \
data/Gemfile CHANGED
@@ -9,9 +9,10 @@ gemspec
9
9
 
10
10
  # Development dependencies
11
11
  gem 'appraisal', '~> 2.4'
12
+ gem 'benchmark', '>= 0.5'
12
13
  gem 'benchmark-ips', '~> 2.10'
13
- gem 'bundler', '~> 2.3'
14
- gem 'countless', '~> 1.1'
14
+ gem 'bundler', '~> 2.6'
15
+ gem 'countless', '~> 2.2'
15
16
  gem 'guard-rspec', '~> 4.7'
16
17
  gem 'irb', '~> 1.2'
17
18
  gem 'rspec', '~> 3.12'
data/Makefile CHANGED
@@ -120,7 +120,7 @@ test-style: \
120
120
  test-style-ruby:
121
121
  # Run the static code analyzer (rubocop)
122
122
  @$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a \
123
- || ($(TEST) $$($(RUBY_VERSION)) != '2.7' && true))
123
+ || ($(TEST) $$($(RUBY_VERSION)) != '3.2' && true))
124
124
 
125
125
  clean:
126
126
  # Clean the dependencies
data/docker-compose.yml CHANGED
@@ -1,4 +1,3 @@
1
- version: "3"
2
1
  services:
3
2
  neo4j:
4
3
  image: hausgold/neo4j:4.4
@@ -2,8 +2,46 @@
2
2
 
3
3
  module Boltless
4
4
  # The configuration for the Boltless gem.
5
- class Configuration
6
- include ActiveSupport::Configurable
5
+ class Configuration < ActiveSupport::OrderedOptions
6
+ # Track our configurations settings (+Symbol+ keys) and their defaults as
7
+ # lazy-loaded +Proc+'s values
8
+ class_attribute :defaults,
9
+ instance_reader: true,
10
+ instance_writer: false,
11
+ instance_predicate: false,
12
+ default: {}
13
+
14
+ # Create a new +Configuration+ instance with all settings populated with
15
+ # their respective defaults.
16
+ #
17
+ # @param args [Hash{Symbol => Mixed}] additional settings which
18
+ # overwrite the defaults
19
+ # @return [Configuration] the new configuration instance
20
+ def initialize(**args)
21
+ super()
22
+ defaults.each { |key, default| self[key] = instance_exec(&default) }
23
+ merge!(**args)
24
+ end
25
+
26
+ # A simple DSL method to define new configuration accessors/settings with
27
+ # their defaults. The defaults can be retrieved with
28
+ # +Configuration.defaults+ or +Configuration.new.defaults+.
29
+ #
30
+ # @param name [Symbol, String] the name of the configuration
31
+ # accessor/setting
32
+ # @param default [Mixed, nil] a non-lazy-loaded static value, serving as a
33
+ # default value for the setting
34
+ # @param block [Proc] when given, the default value will be lazy-loaded
35
+ # (result of the Proc)
36
+ def self.config_accessor(name, default = nil, &block)
37
+ # Save the given configuration accessor default value
38
+ defaults[name.to_sym] = block || -> { default }
39
+
40
+ # Compile reader/writer methods so we don't have to go through
41
+ # +ActiveSupport::OrderedOptions#method_missing+.
42
+ define_method(name) { self[name] }
43
+ define_method("#{name}=") { |value| self[name] = value }
44
+ end
7
45
 
8
46
  # The base URL of the neo4j HTTP API (port 7474 for HTTP, port 7473
9
47
  # for HTTPS when configured at server side)
@@ -76,7 +76,7 @@ module Boltless
76
76
  pp.comma_breakable
77
77
 
78
78
  pp.text('rows=')
79
- if rows.count > 1
79
+ if rows.many?
80
80
  pp.group(1, '[', ']') do
81
81
  pp.pp(first)
82
82
  pp.comma_breakable
@@ -59,6 +59,9 @@ module Boltless
59
59
  #
60
60
  # @raise [Errors::RequestError] when an error occurs, see request object
61
61
  # for fine-grained details
62
+ #
63
+ # rubocop:disable Naming/PredicateMethod -- because this method performs an
64
+ # action, not a predicate check (bool is for error signaling)
62
65
  def begin!
63
66
  # We do not allow messing around in wrong states
64
67
  unless @raw_state == :not_yet_started
@@ -70,6 +73,7 @@ module Boltless
70
73
  @raw_state = :open
71
74
  true
72
75
  end
76
+ # rubocop:enable Naming/PredicateMethod
73
77
 
74
78
  # Begin a new transaction. We rescue all errors transparently.
75
79
  #
@@ -180,6 +184,9 @@ module Boltless
180
184
  #
181
185
  # @raise [Errors::RequestError] when an error occurs, see request object
182
186
  # for fine-grained details
187
+ #
188
+ # rubocop:disable Naming/PredicateMethod -- because this method performs
189
+ # an action, not a predicate check (bool is for error signaling)
183
190
  def rollback!
184
191
  # We do not allow messing around in wrong states
185
192
  raise Errors::TransactionInBadStateError, 'Transaction not open' \
@@ -189,6 +196,7 @@ module Boltless
189
196
  @raw_state = :closed
190
197
  true
191
198
  end
199
+ # rubocop:enable Naming/PredicateMethod
192
200
 
193
201
  # Rollback this transaction. We rescue all errors transparently.
194
202
  #
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module Boltless
5
5
  # The version of the +boltless+ gem
6
- VERSION = '1.6.1'
6
+ VERSION = '2.1.0'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/boltless.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'zeitwerk'
4
+ require 'base64'
4
5
  require 'http'
5
6
  require 'connection_pool'
6
7
  require 'oj'
@@ -9,6 +10,8 @@ require 'colorize'
9
10
  require 'logger'
10
11
  require 'active_support'
11
12
  require 'active_support/concern'
13
+ require 'active_support/ordered_options'
14
+ require 'active_support/core_ext/class/attribute'
12
15
  require 'active_support/core_ext/module/delegation'
13
16
  require 'active_support/core_ext/numeric/time'
14
17
  require 'active_support/core_ext/enumerable'
data/spec/spec_helper.rb CHANGED
@@ -9,7 +9,7 @@ require 'yaml'
9
9
  require 'boltless'
10
10
 
11
11
  # Load all support helpers and shared examples
12
- Dir[File.join(__dir__, 'support', '**', '*.rb')].sort.each { |f| require f }
12
+ Dir[File.join(__dir__, 'support', '**', '*.rb')].each { |f| require f }
13
13
 
14
14
  RSpec.configure do |config|
15
15
  # Enable flags like --only-failures and --next-failure
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Print some information
4
+ #
5
+ # rubocop:disable Rails/Output -- because we want to write to stdout here
4
6
  puts
5
7
  puts <<DESC
6
8
  -------------- Versions --------------
@@ -9,3 +11,4 @@ puts <<DESC
9
11
  --------------------------------------
10
12
  DESC
11
13
  puts
14
+ # rubocop:enable Rails/Output
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boltless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-05-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -16,14 +15,28 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '6.1'
18
+ version: '7.1'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '6.1'
25
+ version: '7.1'
26
+ - !ruby/object:Gem::Dependency
27
+ name: base64
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0.3'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0.3'
27
40
  - !ruby/object:Gem::Dependency
28
41
  name: colorize
29
42
  requirement: !ruby/object:Gem::Requirement
@@ -175,7 +188,6 @@ files:
175
188
  - spec/spec_helper.rb
176
189
  - spec/support/helpers.rb
177
190
  - spec/support/suite_context.rb
178
- homepage:
179
191
  licenses:
180
192
  - MIT
181
193
  metadata:
@@ -184,7 +196,6 @@ metadata:
184
196
  changelog_uri: https://github.com/hausgold/boltless/blob/master/CHANGELOG.md
185
197
  bug_tracker_uri: https://github.com/hausgold/boltless/issues
186
198
  documentation_uri: https://www.rubydoc.info/gems/boltless
187
- post_install_message:
188
199
  rdoc_options: []
189
200
  require_paths:
190
201
  - lib
@@ -192,15 +203,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
192
203
  requirements:
193
204
  - - ">="
194
205
  - !ruby/object:Gem::Version
195
- version: '2.7'
206
+ version: '3.2'
196
207
  required_rubygems_version: !ruby/object:Gem::Requirement
197
208
  requirements:
198
209
  - - ">="
199
210
  - !ruby/object:Gem::Version
200
211
  version: '0'
201
212
  requirements: []
202
- rubygems_version: 3.4.22
203
- signing_key:
213
+ rubygems_version: 3.6.9
204
214
  specification_version: 4
205
215
  summary: neo4j driver, via the HTTP API
206
216
  test_files: []