light_stopwatch 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/light_stopwatch.rb +6 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d15621b199d576ecf823ee8d4d00984c55321de2
4
- data.tar.gz: f0270518459a01bc8b5a42fd6a4fa5b42bc70c60
3
+ metadata.gz: 6af65a9ba5b43318a9e2643dcdd3a969af6c0a42
4
+ data.tar.gz: f0ede6b50b91df6e340b48e1e50d8a7cfa4da495
5
5
  SHA512:
6
- metadata.gz: e7595e29cbedb78cea2f9a04e0f69b3b5751d4544689a67a18dea2627dbadab813d79993814513258a2fbae090bdbac49d760290aeacfccd57c708073af42c21
7
- data.tar.gz: 52aa9c436d7fe1d4537232e15c6563ad4f5767e890ebeb55b49677f9db9d48e94d6bea898449a10c39a45426df7de926b104d99ed7f9047dafa2416f7bc1ee38
6
+ metadata.gz: 7a6bf8767d3f950314d770a93cd01e50b0ca1c5810de24f367b56e7dc1c10c10e24f6c3c81c3917049edb268eeaa7f71a2a47302025cde1751ea583247061636
7
+ data.tar.gz: ee8769494c1245b268c0546f0c4e7a31c9522ca3eff173dcbc5ec6245196d7c3152bf7ddddc60648469ff3658a41d8fee5a29f15ebeb79fe19aa9d18479a404d
@@ -1,10 +1,12 @@
1
1
  module LightStopwatch
2
+ DEFAULT_TAG = 'Operation took:'
3
+
2
4
  def get_time(&block)
3
5
  LightStopwatch.get_time(&block)
4
6
  end
5
7
 
6
- def measure(&block)
7
- LightStopwatch.measure(&block)
8
+ def measure(tag = DEFAULT_TAG, &block)
9
+ LightStopwatch.measure(tag, &block)
8
10
  end
9
11
 
10
12
  def self.get_time(&block)
@@ -15,8 +17,8 @@ module LightStopwatch
15
17
  stop - start
16
18
  end
17
19
 
18
- def self.measure(&block)
19
- puts "Operation took: #{get_time(&block)}"
20
+ def self.measure(tag = DEFAULT_TAG, &block)
21
+ puts "#{tag} #{get_time(&block)}"
20
22
  end
21
23
  end
22
24
 
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: light_stopwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Renra Gloser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description: '["Measure the execute time of anything that you pass in a block"]'
14
14
  email:
15
15
  - jan.renra.gloser@gmail.com
16
16
  executables: []