yabi 0.1.1 → 0.2.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: ec5e71ee279ed743eb00c7d618c9098145bb248e3c3a4a9e5b69f46cb2ec6708
4
- data.tar.gz: fac7df29eb51cd3a061d3d4bc56d75620ea39909da95decfb80435b36e822623
3
+ metadata.gz: 142f08d18441d76afe19801f56c931ac0a4f75be872a8b4b014c15a236312d7d
4
+ data.tar.gz: d56601d215c0d930ccbdb77ffc44b01bda99e3ea70226f036d428c394f8ee5aa
5
5
  SHA512:
6
- metadata.gz: 1e0c999767e3fded4d2582450d3f275e25eb3ebcb3ab4fe88d2d5d18d05e5ec5bd2dd89ccf03d4a88630a2a1f9b1b55a7e315d8d876ce6845ed02c9e54b0586a
7
- data.tar.gz: 79e6da4d2cb6a68025f22e076f524b4fb174fb0933d3be46fc4ed4a0ecd8a16a3fe4d196d1d32b8ed3b23c411b5efd4cd992a067daa4283c7060b72fc4dc25c2
6
+ metadata.gz: ee32e7e896d01e02d715eea03c607bd4c16bcefbdbe540db7fffa1e1b1311da2a59b2050d7643d4242866caeb05be44dffd0e8369b064433b91c3b52a2071582
7
+ data.tar.gz: 908e9758f2f0d6278a97c450f574ca0154745e2902de196d881aeefe74b1639a8d60d73275976c77efaa035d51ebd4ed2f7c1747dae104014fcc8925930c378c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 - 2026-10-27
4
+ - **Breaking:** require Ruby >= 3.3 (3.1 and 3.2 are EOL; current dry-rb releases need 3.3+).
5
+ - Updated development dependencies: rspec ~> 3.13, rubocop ~> 1.92, rubocop-rspec ~> 3.10.
6
+ - Dropped the RuboCop compatibility shim (`rubocop_compat.rb`), no longer needed with rubocop-rspec 3.
7
+ - CI: test on Ruby 3.3, 3.4 and 4.0; added a RuboCop job.
8
+ - README: install from RubyGems, document Ruby requirement, use `Yabi::BaseInteractor` in examples.
9
+
3
10
  ## 0.1.0 - 2026-02-05
4
11
  - Extracted BaseInteractor (formerly BaseService) into the YABI gem.
5
12
  - Added BaseContract wrapper and global shims (BaseInteractor/BaseService/BaseContract).
data/README.md CHANGED
@@ -4,10 +4,12 @@ A tiny base class for service objects/interactors built on `dry-monads`, `dry-in
4
4
 
5
5
  ## Installation
6
6
 
7
+ Requires Ruby 3.3 or newer.
8
+
7
9
  Add to your Gemfile:
8
10
 
9
11
  ```ruby
10
- gem 'yabi', git: 'https://example.com/yabi.git'
12
+ gem 'yabi'
11
13
  ```
12
14
 
13
15
  Require the gem (Rails autoloading works too):
@@ -16,12 +18,12 @@ Require the gem (Rails autoloading works too):
16
18
  require 'yabi'
17
19
  ```
18
20
 
19
- By default the gem exposes `Yabi::BaseInteractor` plus shims `BaseInteractor` and `BaseService` (only defined if missing) to ease migration of existing code.
21
+ The gem exposes `Yabi::BaseInteractor` plus top-level shims `BaseService` and `BaseContract` (only defined if missing) to ease migration of existing code.
20
22
 
21
23
  ## Usage
22
24
 
23
25
  ```ruby
24
- class Users::Questions::Create < BaseInteractor
26
+ class Users::Questions::Create < Yabi::BaseInteractor
25
27
  option :question_text
26
28
 
27
29
  class ValidationContract < BaseContract
@@ -34,7 +36,7 @@ class Users::Questions::Create < BaseInteractor
34
36
  end
35
37
 
36
38
  Users::Questions::Create.call(question_text: 'hello')
37
- # => Success(\"HELLO\")
39
+ # => Success("HELLO")
38
40
  ```
39
41
 
40
42
  ### Contracts
@@ -73,7 +75,7 @@ Remember to add Faraday (or your preferred adapter) to your own Gemfile.
73
75
  require 'faraday'
74
76
  require 'uri'
75
77
 
76
- class Integrations::Http::Requests::Make < BaseInteractor
78
+ class Integrations::Http::Requests::Make < Yabi::BaseInteractor
77
79
  option :http_method
78
80
  option :url
79
81
  option :request_params, default: -> { {} }
@@ -121,8 +123,8 @@ Integrations::Http::Requests::Make.call(
121
123
  http_method: 'get',
122
124
  url: 'https://jsonplaceholder.typicode.com/posts/1'
123
125
  ).either(
124
- ->(response) { puts \"Success: #{response.status}\" },
125
- ->(error) { puts \"Error: #{error}\" }
126
+ ->(response) { puts "Success: #{response.status}" },
127
+ ->(error) { puts "Error: #{error}" }
126
128
  )
127
129
  ```
128
130
  This interactor is only an example; include it in your own app if desired and add
@@ -133,6 +135,7 @@ Faraday (or another HTTP client) to your dependencies.
133
135
  ```sh
134
136
  bundle install
135
137
  bundle exec rspec
138
+ bundle exec rubocop
136
139
  ```
137
140
 
138
141
  ## License
data/lib/yabi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yabi
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
data/lib/yabi.rb CHANGED
@@ -16,9 +16,3 @@ end
16
16
 
17
17
  module Yabi
18
18
  end
19
-
20
- # Provide global constants for easier adoption in existing Rails apps.
21
- BaseInteractor = Yabi::BaseInteractor unless defined?(BaseInteractor)
22
-
23
- # Backwards compatibility shim for legacy code using BaseService naming.
24
- BaseService = Yabi::BaseInteractor unless defined?(BaseService)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikkie Grom
@@ -91,42 +91,42 @@ dependencies:
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '3.12'
94
+ version: '3.13'
95
95
  type: :development
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '3.12'
101
+ version: '3.13'
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rubocop
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '1.66'
108
+ version: '1.92'
109
109
  type: :development
110
110
  prerelease: false
111
111
  version_requirements: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '1.66'
115
+ version: '1.92'
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: rubocop-rspec
118
118
  requirement: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: '2.30'
122
+ version: '3.10'
123
123
  type: :development
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '2.30'
129
+ version: '3.10'
130
130
  description: A small dry-rb-based base service/interactor with optional contract validation.
131
131
  email:
132
132
  - nikkie@nikkie.dev
@@ -156,14 +156,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: '3.1'
159
+ version: '3.3'
160
160
  required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.7.2
166
+ rubygems_version: 4.0.6
167
167
  specification_version: 4
168
168
  summary: Yet Another Base Interactor
169
169
  test_files: []