quick-sampler 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 7f81ad0d5f37da0956dca3b19ec8734ae4ddb673
4
- data.tar.gz: 12467152b7750200a431b2fb4a331687e37cf8b4
3
+ metadata.gz: 8ce420572de6ae77e74e2736e3501d5e9daf2953
4
+ data.tar.gz: 1ab7c6e1c3c11277e105a47befad9fe974fe760c
5
5
  SHA512:
6
- metadata.gz: 33f9a893f91e642315d47e8b5b8f72b95fda8fdb3e9683f38ccda63e792547a5a97a0c341905e2977b7dcdca501e9a86a8eb2c6cc32fd918053c43883e2aa606
7
- data.tar.gz: ab1d83d5bd017cff91ca39c285eba42c98878ba2e821019f6b24cbdfd1b5c166c667653a9a1e5b424c0ba7422266bfe8a7faa002a367d4dc966a350e032f0fb5
6
+ metadata.gz: dbb04b8b15840fcc0e12885d3b82e8757696b381acbbb787c80ce9953d818849d6d977873dc666e6f9757e605d9e01fb66992ac3ac24c3d7f845e8c4399a754b
7
+ data.tar.gz: 46d536fe6288ddfb8779b5b26131f4dfc813a61b6f9e76c24ccf37241e35b64aa008142f56eeab3b5c4fe7435adcc7da547f83bb3ad814dfc3518e20aa396d9c
@@ -52,8 +52,17 @@ module Quick
52
52
  # @param [Integer, Range, Quick::Sampler<Intger>] size
53
53
  # value to use as, range to pick from or sampler to sample from the list size
54
54
  def list_of sampler, size: 1..10
55
- size = pick_from(size) if Range === size
56
- send_to(sampler, :first, size)
55
+ size = case size
56
+ when Quick::Sampler
57
+ size
58
+ when Range
59
+ pick_from(size)
60
+ when Numeric
61
+ const(size.to_i)
62
+ else
63
+ raise "Cant use #{size.inspect} as size"
64
+ end
65
+ feed { sampler.first(size.next) }
57
66
  end
58
67
 
59
68
  # Sampler of arbitrary nested structures made up of `Array`s, `Hash`es, `Quick::Sampler`s and
@@ -1,5 +1,5 @@
1
1
  module Quick
2
2
  module Sampler
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quick-sampler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Baguinski