sinclair 1.16.2 → 2.0.0

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: 474f2601f89233396a82476209781ffb365ceb839756d70defeadade14a0b07e
4
- data.tar.gz: 0de9aa5777826bb36c69e7499fce572f7dabcb2fff8d3fb322de75f71edcbf41
3
+ metadata.gz: 5925279d520a736464493265a29b33212eb44c509ac5e08605b3dc49e26b9113
4
+ data.tar.gz: f09c7b30adef51ee9b5e18dbda960a5f93e595686afb2b4a0774bd8eeab40fb8
5
5
  SHA512:
6
- metadata.gz: d1b82cbba327c1310c7783b3223acb1d7d412dfc8af26f98993499104cd8aac30ba06cfc334f433c59d052631c7d28a76638b6894d8247811ad682d95a8d2c90
7
- data.tar.gz: bf2039f736954188ee656c8f6d871a4d10546f9a9b6e80f5bdaa88f8a22cbf4ea94a650bb5d1101b4d68ab3fbf1553701d70f27613c8233f0fe699fc619add0f
6
+ metadata.gz: 62cc94ccc49c52f06bedd28d12b62fb10ccb583f8d8b5fe48c24896e45979d36da2529349795dfbbdfe8d899565ec99520b23069654fa67abf3616251fd0a473
7
+ data.tar.gz: d20e090b1b663d3fb5b333763c4002f99b55b204a7e90ddf2c287d737f2508fd7dfc1d388a57a8b6a99abe09f7087b37df2336928254a439c397a51fd3e9e319
data/README.md CHANGED
@@ -15,13 +15,13 @@ create custom comparators, configure your application, create powerfull options,
15
15
 
16
16
  Employing Sinclair in your applications helps you streamline your development workflow and enhance your development process through more efficient, cleaner code
17
17
 
18
- Current Release: [1.16.2](https://github.com/darthjee/sinclair/tree/1.16.2)
18
+ Current Release: [2.0.0](https://github.com/darthjee/sinclair/tree/2.0.0)
19
19
 
20
- [Next release](https://github.com/darthjee/sinclair/compare/1.16.2...master)
20
+ [Next release](https://github.com/darthjee/sinclair/compare/2.0.0...master)
21
21
 
22
22
  Yard Documentation
23
23
  -------------------
24
- [https://www.rubydoc.info/gems/sinclair/1.16.2](https://www.rubydoc.info/gems/sinclair/1.16.2)
24
+ [https://www.rubydoc.info/gems/sinclair/2.0.0](https://www.rubydoc.info/gems/sinclair/2.0.0)
25
25
 
26
26
  Installation
27
27
  ---------------
@@ -34,7 +34,7 @@ class Sinclair
34
34
  # model.random_name # returns 'John 803 Doe'
35
35
  def build(klass, options = {}, &block)
36
36
  new(klass, options).tap do |builder|
37
- builder.instance_eval(&block)
37
+ builder.instance_eval(&block) if block_given?
38
38
  end.build
39
39
  end
40
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Sinclair
4
- VERSION = '1.16.2'
4
+ VERSION = '2.0.0'
5
5
  end
data/sinclair.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.test_files = gem.files.grep(%r{^(test|gem|features)/})
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_runtime_dependency 'activesupport', '~> 5.2.0'
22
+ gem.add_runtime_dependency 'activesupport', '~> 7.0.4'
23
23
 
24
24
  gem.add_development_dependency 'bundler', '>= 2.3.25'
25
25
  gem.add_development_dependency 'pry', '0.14.1'
@@ -34,5 +34,21 @@ describe Sinclair::ClassMethods do
34
34
  expect(instance.some_method).to eq(1)
35
35
  end
36
36
  end
37
+
38
+ context 'when no block is given' do
39
+ let(:builder_class) do
40
+ Class.new(Sinclair) do
41
+ def build
42
+ add_method(:some_method) { 1 }
43
+ super
44
+ end
45
+ end
46
+ end
47
+
48
+ it 'executes the block and builds' do
49
+ expect { builder_class.build(dummy_class, options) }
50
+ .to add_method(:some_method).to(dummy_class)
51
+ end
52
+ end
37
53
  end
38
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinclair
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthJee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-03 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.0
19
+ version: 7.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.0
26
+ version: 7.0.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement