sinclair 1.12.0 → 1.12.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b14d0d24d28075129d870b9f2b93c306e894407a70878d7950e0c73e7f747dbb
|
4
|
+
data.tar.gz: 5a3d836d3b8eb5dc299dd17836e50f387fe3273820e91ef95581aac25348407d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6bbf090685049aaa1936e632ed420060ccead6071bb9864de3b5e26f16ad68431b6d01de24442f4ac4ce87792158a5def414680fe9d6b941d4031b766bd386e
|
7
|
+
data.tar.gz: ef28a8f5b9f5b9e9e12cd36c558fe2bb14fededbea91df46cda1b2d8570d0fec22809dc3e36f4af61844da370ea659463df03562232883121d0ebc7f40a63e81
|
data/README.md
CHANGED
@@ -13,13 +13,13 @@ This gem helps the creation of complex gems/concerns
|
|
13
13
|
that enables creation of methods on the fly through class
|
14
14
|
methods
|
15
15
|
|
16
|
-
Current Release: [1.12.
|
16
|
+
Current Release: [1.12.1](https://github.com/darthjee/sinclair/tree/1.12.1)
|
17
17
|
|
18
|
-
[Next release](https://github.com/darthjee/sinclair/compare/1.12.
|
18
|
+
[Next release](https://github.com/darthjee/sinclair/compare/1.12.1...master)
|
19
19
|
|
20
20
|
Yard Documentation
|
21
21
|
-------------------
|
22
|
-
[https://www.rubydoc.info/gems/sinclair/1.12.
|
22
|
+
[https://www.rubydoc.info/gems/sinclair/1.12.1](https://www.rubydoc.info/gems/sinclair/1.12.1)
|
23
23
|
|
24
24
|
Installation
|
25
25
|
---------------
|
data/config/check_specs.yml
CHANGED
data/lib/sinclair/version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Sinclair::MethodDefinition::ParameterHelper do
|
6
|
+
describe '.parameters_from' do
|
7
|
+
context 'when parameters are not named' do
|
8
|
+
context 'when there are no defaults' do
|
9
|
+
it 'returns a list of parameters' do
|
10
|
+
expect(described_class.parameters_from(%i[a b]))
|
11
|
+
.to eq(%w[a b])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when there are defaults' do
|
16
|
+
let(:parameters) do
|
17
|
+
[{ a: 10, b: 'word', c: true, d: false }]
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'returns a list of parameters' do
|
21
|
+
expect(described_class.parameters_from(parameters))
|
22
|
+
.to eq(['a = 10', 'b = "word"', 'c = true', 'd = false'])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'when parameters are named' do
|
28
|
+
context 'when there are no defaults' do
|
29
|
+
it 'returns a list of parameters' do
|
30
|
+
expect(described_class.parameters_from(%i[a b], named: true))
|
31
|
+
.to eq(%w[a: b:])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when there are defaults' do
|
36
|
+
let(:parameters) do
|
37
|
+
[{ a: 10, b: 'word', c: true, d: false }]
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'returns a list of parameters' do
|
41
|
+
expect(described_class.parameters_from(parameters, named: true))
|
42
|
+
.to eq(['a: 10', 'b: "word"', 'c: true', 'd: false'])
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
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.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DarthJee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -380,6 +380,7 @@ files:
|
|
380
380
|
- spec/lib/sinclair/method_definition/block_helper_spec.rb
|
381
381
|
- spec/lib/sinclair/method_definition/call_definition_spec.rb
|
382
382
|
- spec/lib/sinclair/method_definition/parameter_builder_spec.rb
|
383
|
+
- spec/lib/sinclair/method_definition/parameter_helper_spec.rb
|
383
384
|
- spec/lib/sinclair/method_definition/string_definition_spec.rb
|
384
385
|
- spec/lib/sinclair/method_definition_spec.rb
|
385
386
|
- spec/lib/sinclair/method_definitions_spec.rb
|