subroutine-factory 0.1.8 → 0.2.0
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 +4 -4
- data/.ruby-version +1 -1
- data/lib/subroutine/factory/version.rb +1 -1
- data/lib/subroutine/factory.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 698ad2a1f2e741d5068f5d9f4a007113f85c7fc85603beffa396dbb8d6e6b83a
|
4
|
+
data.tar.gz: 73acb2010c7f19347d1bfd16fd7557111903b665e97a8c52bdb13a8beb88c511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 435308c5821c84856a8e496e99a3a90e56765d946d95423807b6a77e9a16190613c349efdf95b6fb5047d792a08b64454af33564f533f256fe607c8ae43c5143
|
7
|
+
data.tar.gz: 1daefe1cfa4647168882612ed29ac44b379271d2fa1da147740c38c0a4847fcc6fd45ed5381094d09a21190d013f1f8581fb2b579cac05466661f28a4b4a3394
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.6
|
data/lib/subroutine/factory.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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: []
|