rex-core 0.1.25 → 0.1.26

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: 92383c2b5e9cf999abfc198c12992d176cfdf262fbd782886ef1ea1a705f2fd6
4
- data.tar.gz: 584ffd804e8c5b1d3b96c5cf90580553fb12513c958362d93238cf92545c7184
3
+ metadata.gz: b8ac9ac5c78f2af305446d6b5deeb2fdec947b00912eddd5c67d078c90c81ac4
4
+ data.tar.gz: a01aa99645e7230085e2889cc2527d870db46666542771b3b0d5c91c92f93d11
5
5
  SHA512:
6
- metadata.gz: fc7aa81e629107d66ceefdee7fcde2f7620fd95aff8bb2f163eacd31387835e84f123bdda4666b5e4c6a3390db5a9ddb4a55e8a15850c670ad0610c479ac2816
7
- data.tar.gz: 5d4b2fd53ec1cb320a5d503d97ff4f478f330368f98c3230cc1918edf1d07a9f950c2bef7d0210074e52ce1ee16097f3e32703b4476cd16d7d3edb651c26e35e
6
+ metadata.gz: 3d4976c2e3bc4066992ba28261c7e4ea6bb7751b083700c4f6ac50238fcb5703e972ce7dc2071b41916f50da9e96d6b0e1b7bb4c4bcdcf22a98dde7f98931402
7
+ data.tar.gz: d718c23b2fa94b3d525f94f205a50b132084f1f237cf2ce10dd81cc50fd51bbf44bdcee28d3008ee424d283db8d79c642beb7f6b8003e3c2ed2ebf33e1c47181
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Core
3
- VERSION = "0.1.25"
3
+ VERSION = "0.1.26"
4
4
  end
5
5
  end
data/lib/rex/sync/ref.rb CHANGED
@@ -10,11 +10,38 @@ module Rex
10
10
  #
11
11
  ###
12
12
  module Ref
13
+ #
14
+ # Raises a TypeError to prevent cloning.
15
+ #
16
+ def clone
17
+ raise TypeError, "can't clone instance of Ref #{self.class}"
18
+ end
19
+
20
+ #
21
+ # Raises a TypeError to prevent duping.
22
+ #
23
+ def dup
24
+ raise TypeError, "can't dup instance of Ref #{self.class}"
25
+ end
26
+
27
+ #
28
+ # Ensures that the Ref is correctly initialized when extended on an object:
29
+ # ```
30
+ # arbitrary_resource = Resource.new
31
+ # arbitrary_resource.extend(::Rex::Ref)
32
+ # ```
33
+ #
34
+ # @param instance [object] the instance that has just extended the Ref module
35
+ def self.extended(instance)
36
+ instance.refinit
37
+ end
13
38
 
14
39
  #
15
40
  # Initializes the reference count to one.
16
41
  #
17
42
  def refinit
43
+ return if defined?(@_references)
44
+
18
45
  @_references = 1
19
46
  @_references_mutex = Mutex.new
20
47
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2022-01-26 00:00:00.000000000 Z
96
+ date: 2022-02-15 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file