beginner.codes 0.1.3 → 0.1.4
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/CHANGELOG.md +21 -0
- data/README.md +6 -1
- data/lib/challenges.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53a61ed7bdf941612a9b872243a1735c99e6510a0f787488654fd5cb0f57183e
|
4
|
+
data.tar.gz: 749500774942cd631b2c7f072f42e0bd6ed703791a8d97fdbec0a8b34367928e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 944c7ac5de055f6f919537b62525ee86135c50add2fbbabe53cfd95e58bc39db9aadf5718504ce0bd7b41396279649824a13b733a2b4c9dc8453955482f97ad2
|
7
|
+
data.tar.gz: ea7009f4fc91cfdb3d339e9d676138ca0f98c12d96762ca2a65f876810557c3d4d4098563752dc96250dd92af575d42a20eef5a199f19d37df2f89ab889a584e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# 0.1.4 (7 November 2023)
|
2
|
+
|
3
|
+
---
|
4
|
+
|
5
|
+
## Enhancements
|
6
|
+
|
7
|
+
- Added ability to process lambda functions.
|
8
|
+
|
9
|
+
## Bug Fixes
|
10
|
+
|
11
|
+
## Performance
|
12
|
+
|
13
|
+
- It is now .0001% faster
|
14
|
+
|
15
|
+
## Documentation
|
16
|
+
|
17
|
+
- Updated README to include the lambda function syntax
|
18
|
+
- Sometimes I wonder if I'm living in a simulation. If so, why does my player always have me go into a room and forget why I went in.
|
19
|
+
|
20
|
+
---
|
21
|
+
|
1
22
|
# 0.1.3 (1 November 2023)
|
2
23
|
|
3
24
|
---
|
data/README.md
CHANGED
@@ -14,7 +14,12 @@ def n_differences(nums)
|
|
14
14
|
nil
|
15
15
|
end # Your code goes here!!!
|
16
16
|
|
17
|
-
|
18
17
|
test(458, :n_differences)
|
18
|
+
|
19
|
+
# OR You can use a Lambda Proc
|
20
|
+
|
21
|
+
n_differences = -> (x) {x*2}
|
22
|
+
|
23
|
+
test(458, n_differences)
|
19
24
|
```
|
20
25
|
This will handle downloading the necessary challenge test cases and will run them against your code. It will show you which tests failed, what went wrong, and how many tests succeeded.
|
data/lib/challenges.rb
CHANGED
@@ -41,7 +41,12 @@ def run_tests(tests, solution_func)
|
|
41
41
|
tests.each_with_index do |test_case, index|
|
42
42
|
result = Result.new(index, test_case['return'])
|
43
43
|
begin
|
44
|
-
result.got =
|
44
|
+
result.got = if solution_func.is_a?(Proc)
|
45
|
+
solution_func.call(*test_case['args'])
|
46
|
+
else
|
47
|
+
send(solution_func, *test_case['args'])
|
48
|
+
end
|
49
|
+
|
45
50
|
rescue StandardError => e
|
46
51
|
result.status = Status::EXCEPTION
|
47
52
|
result.got = e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beginner.codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mr. Robinhood 5
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-11-
|
12
|
+
date: 2023-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|