at_what_cost 1.0.0 → 1.0.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: d3a14e1a0e57c5c23eb8ec9b7d6d7cde98d29556f807ba327c2b46031d90988f
4
- data.tar.gz: 85ac42a172a69622006245c3a6b1ba3cb58e754f83b569cd4b84f07a89853ae6
3
+ metadata.gz: 63e785ae370329de7e393202a49bb8b9ce53016a0de956a06850506b08d6373b
4
+ data.tar.gz: 2975a3cb99010d08ca5b5a6adf7531a3fb20efa81bb1bb25e46a345ad3706996
5
5
  SHA512:
6
- metadata.gz: 50977dc2fdfba29a1cc548d6eb54ad76cc698a84e9aa93dc6ed86188a8d3442c01099a2f457e701b82a1b7d1aab2666968bfb74109d6eb5cce81d35022f0523f
7
- data.tar.gz: 4ea9bb815765e4972f898168c3f709d61a90db8d110ff06383bdd88eb43c5182dc03d894f471399012a5c380f1aaaefd0bb92aa896c1f571b5356381e29534ca
6
+ metadata.gz: 7251beaaec263b3d238b712a10fc63d4969bf1934cfaa9be6366a6943bacbde541cb2cd5e25dd8b5cd0619d37be0a8e10d150cc3858a996e9ab5dde59aa8c912
7
+ data.tar.gz: 2f9a3da727172177e29ee3e2656fff31f60c9103737b5ef9b1a2656f6084b763a211969e845636b7118bd1d7621d783a5c94ae30c02bb25fc33d21f81d2fbc4b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- at_what_cost (1.0.0)
4
+ at_what_cost (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,21 @@
1
1
  # AtWhatCost
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/at_what_cost`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ When you want to answer the question _at what cost_, simply put some code into a proc, and ask:
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ```ruby
6
+ require 'at_what_cost'
7
+
8
+ p = ->{ (1..9999).map{|n| n**2}}
9
+
10
+ p.at_what_cost?
11
+ ```
12
+
13
+ And see the output (YMMV):
14
+
15
+ ```
16
+ user system total real
17
+ 0.002122 0.000151 0.002273 ( 0.002882)
18
+ ```
6
19
 
7
20
  ## Installation
8
21
 
data/lib/at_what_cost.rb CHANGED
@@ -9,7 +9,7 @@ end
9
9
  class Proc
10
10
  def at_what_cost?
11
11
  Benchmark.bm do |x|
12
- x.report { self.() }
12
+ x.report(&self)
13
13
  end
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module AtWhatCost
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: at_what_cost
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Crissman