sinclair 1.16.2 → 1.16.3

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: b50c8756a84388173ff948946c6551420db72afa180b707754de4db5aebfc37e
4
+ data.tar.gz: d1824371cc9e9e272c8d26c5a24ce836af12b3febdd9943a1dae7a345f8947b9
5
5
  SHA512:
6
- metadata.gz: d1b82cbba327c1310c7783b3223acb1d7d412dfc8af26f98993499104cd8aac30ba06cfc334f433c59d052631c7d28a76638b6894d8247811ad682d95a8d2c90
7
- data.tar.gz: bf2039f736954188ee656c8f6d871a4d10546f9a9b6e80f5bdaa88f8a22cbf4ea94a650bb5d1101b4d68ab3fbf1553701d70f27613c8233f0fe699fc619add0f
6
+ metadata.gz: 8f5c96721ae43d84a713bc6535b251b5e06e17acc60da8f4fd03bb1df63f7a56f3a72c68ace5dd8856f3bc0884e29c0f807befc5cfe8705165f64345d01ea3d8
7
+ data.tar.gz: d27893bf77a520bcdea71e4813cea5a6ef03ed168ec7e95e29c94a23c901b5bceaaa6c914801a9d4dda802e65365aa4ec0171704303011baff41810bdaf8a3b2
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: [1.16.3](https://github.com/darthjee/sinclair/tree/1.16.3)
19
19
 
20
- [Next release](https://github.com/darthjee/sinclair/compare/1.16.2...master)
20
+ [Next release](https://github.com/darthjee/sinclair/compare/1.16.3...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/1.16.3](https://www.rubydoc.info/gems/sinclair/1.16.3)
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 = '1.16.3'
5
5
  end
@@ -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: 1.16.3
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-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport