rex-core 0.1.19 → 0.1.20

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: 4b2bbdcc1a0301230c6fdd17df19375ba3ee885852b14b7096736294539d566b
4
- data.tar.gz: f474c211aa36c95dc0dbdf5b05b591d2fd1cc98bd1cec5c877deea37fe2986e2
3
+ metadata.gz: cacc2616718c8056c7ff5ecf2626562f71ac9efd0a6ae69c80cd21565824b666
4
+ data.tar.gz: e6ed793586462b6cc826be77b533030e45a7bce1ae4fd0bdb2cbaf62ed6e17dd
5
5
  SHA512:
6
- metadata.gz: 247e60760168cfaeebce318e982939b6100f7ea2fe278914a11261b9eaf9933db6f5754b1b4afd859ec4aa2d7fb4379065a7505a1d5bae0565b5c10f56d56b4f
7
- data.tar.gz: 234380d838b2687ea3b80575f406430daebed9cfd3292be43db94b3ebb6c948a909d309cb6a20901d27daef423179f8ee92c548cd78ed078dcd2a5815d6969cf
6
+ metadata.gz: a7367cb540a9638f4f64e5756f3c9761e3ebe05f15444ee2d4ae8e6f6af94888f50e2813cc89e7ef3bc7492335f20c31ccc98c8c3ba4b2a55e61995b174c8497
7
+ data.tar.gz: 4dbd3f07ec237c23ca088bbbdc2f67e2a59bcf5167bcebe841550877fc99f1e81ef3a9c763ddb9c7d8478844676e08ee3f706188c721049be00fbe2b3350ef89
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Core
3
- VERSION = "0.1.19"
3
+ VERSION = "0.1.20"
4
4
  end
5
5
  end
data/lib/rex/stopwatch.rb CHANGED
@@ -1,16 +1,21 @@
1
- module Rex
1
+ module Rex::Stopwatch
2
2
 
3
3
  # This provides a correct way to time an operation provided within a block.
4
4
  #
5
5
  # @see https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/
6
+ # @see https://ruby-doc.org/core-2.7.1/Process.html#method-c-clock_gettime
7
+ #
8
+ # @param [Symbol] unit The unit of time in which to measure the duration. The
9
+ # argument is passed to Process.clock_gettime which defines the acceptable
10
+ # values.
6
11
  #
7
12
  # @yield [] The block whose operation should be timed.
8
13
  #
9
- # @return Returns the result of the block and the elapsed time in seconds.
10
- def self.stopwatch
11
- start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
14
+ # @return Returns the result of the block and the elapsed time in the specified unit.
15
+ def self.elapsed_time(unit: :float_second)
16
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC, unit)
12
17
  ret = yield
13
- elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
18
+ elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC, unit) - start
14
19
 
15
20
  [ret, elapsed]
16
21
  end
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.19
4
+ version: 0.1.20
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: 2021-11-15 00:00:00.000000000 Z
96
+ date: 2021-11-16 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- G��G�ϐan�p0ः�W�)�� R�p�
2
- ��LK��-�~�sR�ԅ<��-,��Qkk �1e+&U�?�����=p��M�5�)@,�&��|������C��OIVsb��,�&�{�%�?bb��4��
1
+ #¦����'}����sU�ʖ'V������ވ�nq��/�
2
+ �J:��VeQ�1�����tw�"���JK��2�������|n#�t`��U�3�v$[5����|�㣏�r�Mӵ�Yͳ��vEa�����|�A!nښ�Ҍ�Ҧ`w���/Nqq�������m\v���S-�4�[�lӘ����mS����vg Ǒu�� ��ގ�U��v�3?��`ŠU�4q�Ȅ