Skip to content

Commit

Permalink
Crystal 1.15 prep
Browse files Browse the repository at this point in the history
  • Loading branch information
meatball133 committed Jan 14, 2025
1 parent a998879 commit 6e892cd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doc-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@cdf26dcd488490c9939e9d4d62cab169c9e4f20d
with:
crystal: "1.14.0"
crystal: "1.15.0"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Run generator tests
run: crystal spec ./document-generator/spec/*
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@cdf26dcd488490c9939e9d4d62cab169c9e4f20d
with:
crystal: "1.14.0"
crystal: "1.15.0"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Run generator tests
run: crystal document-generator/scripts/check_docs.cr
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
# Allows running the job multiple times with different configurations
matrix:
crystal: ["1.10", "1.11", "1.12", "1.13", "1.14.0"]
crystal: ["1.11", "1.12", "1.13", "1.14", "1.15"]
container:
image: crystallang/crystal:${{ matrix.crystal }}
steps:
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@cdf26dcd488490c9939e9d4d62cab169c9e4f20d
with:
crystal: "1.14.0"
crystal: "1.15.0"
- name: 'Setup jq'
run: choco install jq
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p vertical-align="middle"><h1>Exercism Crystal Track</h1></p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![Discourse topics](https://img.shields.io/discourse/topics?color=8A08E6&label=Connect%20&labelColor=FFDF58&logo=Discourse&logoColor=8A08E6&server=https%3A%2F%2Fforum.exercism.org&style=social)](https://forum.exercism.org)
&nbsp;[![Exercism_II](https://img.shields.io/badge/Exercism--Built-9101FF?logo=crystal&logoColor=000000&labelColor=E5E5E5&label=Crystal%201.14.0%20Powered)](https://exercism.org)
&nbsp;[![Exercism_II](https://img.shields.io/badge/Exercism--Built-9101FF?logo=crystal&logoColor=000000&labelColor=E5E5E5&label=Crystal%201.15.0%20Powered)](https://exercism.org)
&nbsp;[![Exercism_III](https://img.shields.io/badge/Open-11b30e?labelColor=3D454D&label=Contributions)](https://exercism.org/blog/freeing-our-maintainers) &nbsp;[![Build Status](https://github.com/exercism/crystal/workflows/Tests/badge.svg)](https://github.com/exercism/crystal/actions/workflows/tests.yml)

<br>
Expand All @@ -16,7 +16,7 @@ Hi. &nbsp;👋🏽 &nbsp;👋 &nbsp;**We are happy you are here.**&nbsp; 🎉&nb
**`exercism/Crystal`** is one of many programming language tracks on [exercism(dot)org][exercism-website].
This repo holds all the instructions, tests, code, & support files for Crystal _exercises_ currently under development or implemented & available for students.

🌟 &nbsp;&nbsp;Track tooling (_test-runner, representer, analyzer, and Continuous Integration_) runs on Crystal `1.14.0`. <br>
🌟 &nbsp;&nbsp;Track tooling (_test-runner, representer, analyzer, and Continuous Integration_) runs on Crystal `1.15.0`. <br>
🌟 &nbsp;&nbsp;Most exercises are solvable with Crystal `1.0.0` or higher.

This track is made up of **Practice Exercises**. Practice exercises are open-ended, and can be used to practice concepts learned, try out new techniques, and play.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/binary-search-tree/.meta/src/example.cr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Node(T)
end
end

def each
def each(&)
TreeIterator.new(self).each do |v|
yield v
end
Expand Down
3 changes: 1 addition & 2 deletions exercises/practice/markdown/.meta/src/example.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class Markdown
lines = @markdown.split("\n")
lines.each_with_index do |line, index|
level = line.scan(/^#+/)
# TODO: Use present? method when Crystal1.10 is dropped
if !level.empty? && level[0][0].size <= 6
if level.present? && level[0][0].size <= 6
level = level[0][0].size
result += "<h#{level}>#{parse_line(line[(level + 1)..-1])}</h#{level}>"
elsif line.starts_with?('*')
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/react/.meta/src/example.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ module React
@last_callback_value : CellValue

def initialize(input : Cell, &compute : CellValue -> CellValue)
initialize(->{ compute.call(input.value) }, input)
initialize(-> { compute.call(input.value) }, input)
end

def initialize(input1 : Cell, input2 : Cell, &compute : (CellValue, CellValue) -> CellValue)
initialize(->{ compute.call(input1.value, input2.value) }, input1, input2)
initialize(-> { compute.call(input1.value, input2.value) }, input1, input2)
end

private def initialize(@new_value : -> CellValue, *dependencies : Cell)
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/strain/.meta/src/example.cr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class Array(T)
def keep
def keep(&)
kept = Array(T).new
each { |e| kept << e if yield(e) }
kept
end

def discard
def discard(&)
keep { |e| !yield(e) }
end
end
2 changes: 1 addition & 1 deletion exercises/practice/word-search/.meta/src/example.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module WordSearch
results
end

private def self.each_delta
private def self.each_delta(&)
[-1, 0, 1].each do |dx|
[-1, 0, 1].each do |dy|
yield(dx, dy) if dx != 0 || dy != 0
Expand Down

0 comments on commit 6e892cd

Please sign in to comment.