sus 0.19.0 → 0.20.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/identity.rb +11 -1
- data/lib/sus/it.rb +2 -2
- data/lib/sus/version.rb +1 -1
- data/lib/sus/with.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d3a31b1ef9a5f80523b6d3bbe34d8fe1312fbee9f48b96eff16ee0c7755b46
|
4
|
+
data.tar.gz: 7fe132541184eb203cd93f1bb5f94288c473a70d0329b1a351d7bd70be382e41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 451fa9e5cc095f4af36347f0fc5f55ffbd74ce1b03efa6985cacbcdd2aa469ec577aadc8c6fe4d197e7f323bdd7ae18ca318c2cc1861568abe2b1230525a078f
|
7
|
+
data.tar.gz: 6d9ae7c5173b87ac726f3e61b13ae3ca199adf73cb86bba9f9e2326cacc064ea395a692288d97a3898fb7ff7500ad8581303a8d3331813fd8bfd04c3665a0da6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/sus/identity.rb
CHANGED
@@ -95,7 +95,7 @@ module Sus
|
|
95
95
|
end
|
96
96
|
else
|
97
97
|
# In theory this should be a bit faster:
|
98
|
-
|
98
|
+
each_caller_location do |location|
|
99
99
|
if location.path == @path
|
100
100
|
return self.with_line(location.lineno)
|
101
101
|
end
|
@@ -107,6 +107,16 @@ module Sus
|
|
107
107
|
|
108
108
|
protected
|
109
109
|
|
110
|
+
if Thread.respond_to?(:each_caller_location)
|
111
|
+
def each_caller_location(&block)
|
112
|
+
Thread.each_caller_location(&block)
|
113
|
+
end
|
114
|
+
else
|
115
|
+
def each_caller_location(&block)
|
116
|
+
caller_locations(1).each(&block)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
110
120
|
def append_unique_key(key, unique = @unique)
|
111
121
|
if @parent
|
112
122
|
@parent.append_unique_key(key)
|
data/lib/sus/it.rb
CHANGED
@@ -7,11 +7,11 @@ require_relative 'context'
|
|
7
7
|
|
8
8
|
module Sus
|
9
9
|
module It
|
10
|
-
def self.build(parent, description = nil, &block)
|
10
|
+
def self.build(parent, description = nil, unique: true, &block)
|
11
11
|
base = Class.new(parent)
|
12
12
|
base.extend(It)
|
13
13
|
base.description = description
|
14
|
-
base.identity = Identity.nested(parent.identity, base.description)
|
14
|
+
base.identity = Identity.nested(parent.identity, base.description, unique: unique)
|
15
15
|
|
16
16
|
if block_given?
|
17
17
|
base.define_method(:call, &block)
|
data/lib/sus/version.rb
CHANGED
data/lib/sus/with.rb
CHANGED
@@ -44,10 +44,10 @@ module Sus
|
|
44
44
|
end
|
45
45
|
|
46
46
|
module Context
|
47
|
-
def with(subject = nil, **variables, &block)
|
47
|
+
def with(subject = nil, unique: true, **variables, &block)
|
48
48
|
subject ||= variables.inspect
|
49
49
|
|
50
|
-
add With.build(self, subject, variables, &block)
|
50
|
+
add With.build(self, subject, variables, unique: unique, &block)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
40
40
|
-----END CERTIFICATE-----
|
41
|
-
date: 2023-02-
|
41
|
+
date: 2023-02-24 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: bake-test
|
metadata.gz.sig
CHANGED
Binary file
|