sus 0.18.2 → 0.19.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: 7368b0ed0e288959f59f0fe6c2c5dd93ff90ba52f423b1365406e8de260536c1
4
- data.tar.gz: 10fe5fec8209ce9cea739f580a3f4bd1b36be3b6e384f6ff85ad813fad32d0f2
3
+ metadata.gz: be6340b088c8d6e160633c485f38092c1cf9d5efec5d02271a71262e564b303b
4
+ data.tar.gz: a99c97b6bc58cb640abd624cfb4d74cf021707c6c92077dde8b07cb1533969e9
5
5
  SHA512:
6
- metadata.gz: 1456e34138bea3c5952ababab2950ac946ddce0a3f55879ed1bedb9828c536ffb5c4ced7b9a35f4e80ad1879e230dd26b0fc120b7258e218710530165d9233e5
7
- data.tar.gz: b1ea6d027ec46f0aa72e74fd6cb169a71b5209a57791b52b7f41c1a1f2fc7d70353e08e73ebfef2d7262e67a7be10702500d07ee99f18499d898de5b0ad917ed
6
+ metadata.gz: e19c1efd09b7233fd3e20b46206d562598587afe6088b53812658aaedb249e287189b140d2296fdac57a3fc6df429f66f59108d8607b62874578cce40483978b
7
+ data.tar.gz: 493742b0eb7ea370253a51078e355535cc34e67cbfae7cadde6974f6ed5bd75196bea81334e887b5dab13ed3af423c8e3fc77d48fb7bbf277ed7192289709e23
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
- Thread.each_caller_location do |location|
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/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2022, by Samuel Williams.
5
5
 
6
6
  module Sus
7
- VERSION = "0.18.2"
7
+ VERSION = "0.19.1"
8
8
  end
data/lib/sus/with.rb CHANGED
@@ -44,7 +44,9 @@ module Sus
44
44
  end
45
45
 
46
46
  module Context
47
- def with(subject, **variables, &block)
47
+ def with(subject = nil, **variables, &block)
48
+ subject ||= variables.inspect
49
+
48
50
  add With.build(self, subject, variables, &block)
49
51
  end
50
52
  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.18.2
4
+ version: 0.19.1
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-20 00:00:00.000000000 Z
41
+ date: 2023-02-21 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