subroutine-factory 0.1.8 → 0.2.0

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: dc88dc64c89f0f831b0ebbe437649c866edb2ca87a58f953b355a27b453abbb0
4
- data.tar.gz: e6671efa5cdc98c54098dc5518db9e304ce2554062b980fc60203df635e9cc15
3
+ metadata.gz: 698ad2a1f2e741d5068f5d9f4a007113f85c7fc85603beffa396dbb8d6e6b83a
4
+ data.tar.gz: 73acb2010c7f19347d1bfd16fd7557111903b665e97a8c52bdb13a8beb88c511
5
5
  SHA512:
6
- metadata.gz: 8fb7d4c79e01fc7fbd5459d7d145511d6cb32140da3268eef9d8b16f402bf7ff912b2b96675966426b0eafc3aaec6f4f15c4279c4cc706c7bb7d3b171e4576b5
7
- data.tar.gz: 8fe2680a14be76556bfe8c81ffe95b3312f9c52a7d2965c1fe665edf2baed874332ceb100e16a6f6ba8700893965bc8e3a06c4807e90fb10a41bff573c10f43f
6
+ metadata.gz: 435308c5821c84856a8e496e99a3a90e56765d946d95423807b6a77e9a16190613c349efdf95b6fb5047d792a08b64454af33564f533f256fe607c8ae43c5143
7
+ data.tar.gz: 1daefe1cfa4647168882612ed29ac44b379271d2fa1da147740c38c0a4847fcc6fd45ed5381094d09a21190d013f1f8581fb2b579cac05466661f28a4b4a3394
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 3.0.6
@@ -3,7 +3,7 @@
3
3
  module Subroutine
4
4
  module Factory
5
5
 
6
- VERSION = "0.1.8"
6
+ VERSION = "0.2.0"
7
7
 
8
8
  end
9
9
  end
@@ -63,11 +63,11 @@ module Subroutine
63
63
  def self.random(random_options = {}, &lambda)
64
64
  if block_given?
65
65
  proc do |*options|
66
- x = build_random(random_options)
66
+ x = build_random(**random_options)
67
67
  lambda.call(*[x, *options].compact)
68
68
  end
69
69
  else
70
- build_random(random_options)
70
+ build_random(**random_options)
71
71
  end
72
72
  end
73
73
 
@@ -75,6 +75,7 @@ module Subroutine
75
75
  ALPHAS = ("a".."z").to_a
76
76
  NUMERICS = (0..9).to_a
77
77
  ALPHANUMERICS = NUMERICS + ALPHAS
78
+
78
79
  def self.build_random(length: 8, type: :alphanumeric)
79
80
  raise ArgumentError, ":type must be one of #{RANDOM_FUNCTION_TYPES.inspect}" unless RANDOM_FUNCTION_TYPES.include?(type.to_sym)
80
81
 
@@ -88,7 +89,6 @@ module Subroutine
88
89
 
89
90
  length.times.inject(+"") do |memo, _i|
90
91
  x = source.sample.to_s
91
- x = x.upcase if rand(2) == 1
92
92
  memo << x
93
93
  end
94
94
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subroutine-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-08 00:00:00.000000000 Z
11
+ date: 2023-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: subroutine
@@ -121,7 +121,7 @@ licenses:
121
121
  - MIT
122
122
  metadata:
123
123
  allowed_push_host: https://rubygems.org
124
- post_install_message:
124
+ post_install_message:
125
125
  rdoc_options: []
126
126
  require_paths:
127
127
  - lib
@@ -136,8 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.0.6
140
- signing_key:
139
+ rubygems_version: 3.2.33
140
+ signing_key:
141
141
  specification_version: 4
142
142
  summary: Test factories for ops using Subroutine Ops
143
143
  test_files: []