Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4ef91678bb9a
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 731e9c097c9b
Choose a head ref

Commits on Dec 26, 2017

  1. Enable IPv6 in Docker (#5429)

    cotsog authored and bcardiff committed Dec 26, 2017
    Copy the full SHA
    68c0098 View commit details

Commits on Dec 27, 2017

  1. Copy the full SHA
    4313e86 View commit details

Commits on Dec 28, 2017

  1. Copy the full SHA
    12cc7f2 View commit details

Commits on Dec 29, 2017

  1. Update gitignore template (#5480)

    * Fix docs directory in gitignore.ecr (renamed in #4937)
    bcardiff authored Dec 29, 2017
    Copy the full SHA
    4f56a57 View commit details

Commits on Jan 2, 2018

  1. Copy the full SHA
    d3fed8b View commit details

Commits on Jan 5, 2018

  1. Include UUID in docs

    asterite authored and bcardiff committed Jan 5, 2018
    Copy the full SHA
    e1680dd View commit details

Commits on Jan 10, 2018

  1. Fix: decode DWARF line sequences with single program entry (#5565)

    Debug::DWARF::LineNumbers would skip the program statement when it
    contained a single entry, because of a wrong assumption of the
    sequence unit_length entry, which doesn't account for the unit
    length space in the standard, and was overlooked in checking whether
    the sequence had any program statement, or not.
    ysbaddaden authored and bcardiff committed Jan 10, 2018
    Copy the full SHA
    5eecd57 View commit details

Commits on Jan 23, 2018

  1. Add ASTNode#single_expression and refactor with using it (#5513)

    * Add ASTNode#single_expression and refactor with using it
    
    Fixed #5482
    Fixed #5511
    
    But this commit contains no spec for #5511 because I don't know where to
    place such a spec.
    
    * Add spec for #5511
    
    Thank you @asterite!
    See: #5513 (comment)
    makenowjust authored and matiasgarciaisaia committed Jan 23, 2018
    Copy the full SHA
    0ebc173 View commit details

Commits on Jan 25, 2018

  1. Copy the full SHA
    b793876 View commit details
  2. Copy the full SHA
    7f05801 View commit details
  3. Bug: default_verify_param are inverted in SSL::Context::Client and SS…

    …L::Context::Server
    
    Fixes #5266
    
    x509 certificates have a purpose associated to them. Clients should
    verify that the server's certificate is intended to be used in a
    server, and servers should check the client's certificate is
    intended to be used for clients.
    
    Crystal was mistakingly checking those mixed up.
    
    See https://wiki.openssl.org/index.php?title=Manual:X509(1)&oldid=1797#CERTIFICATE_EXTENSIONS
    See https://tools.ietf.org/html/rfc5280#section-4.2.1.3
    waj authored and matiasgarciaisaia committed Jan 25, 2018
    Copy the full SHA
    558a32a View commit details
  4. Version 0.24.2

    matiasgarciaisaia committed Jan 25, 2018
    Copy the full SHA
    1445529 View commit details

Commits on Jan 29, 2018

  1. Migrate to Circle 2.0

    bcardiff committed Jan 29, 2018
    Copy the full SHA
    8e621ad View commit details
  2. Set TZ for osx builds

    bcardiff committed Jan 29, 2018
    Copy the full SHA
    6418ee4 View commit details
  3. Enable ipv6 for docker in linux build

    Move setup from .travis.yml to /bin/ci
    bcardiff committed Jan 29, 2018
    Copy the full SHA
    6b655af View commit details
  4. Copy the full SHA
    d08d7c9 View commit details
  5. Add branch and tag filter to ci

    Build master, release and ci branches
    Build tags
    bcardiff committed Jan 29, 2018
    Copy the full SHA
    1a1124b View commit details
  6. Test nightly build

    bcardiff committed Jan 29, 2018
    Copy the full SHA
    9538efb View commit details
  7. Copy the full SHA
    5c06ff9 View commit details
  8. Add darwin nightly artifacts

    bcardiff committed Jan 29, 2018
    Copy the full SHA
    bfc9f79 View commit details
  9. Copy the full SHA
    85d895f View commit details
  10. Copy the full SHA
    ccdf9c1 View commit details
  11. Remove docs publishing from travis

    Make travis build ci branches
    bcardiff committed Jan 29, 2018
    Copy the full SHA
    a4ed534 View commit details

Commits on Jan 30, 2018

  1. Copy the full SHA
    d5e952f View commit details

Commits on Feb 5, 2018

  1. Copy the full SHA
    80a1c4a View commit details

Commits on Feb 6, 2018

  1. Copy the full SHA
    e3c3f7f View commit details
  2. Copy the full SHA
    66600d6 View commit details

Commits on Feb 7, 2018

  1. Shorten jobs names

    bcardiff committed Feb 7, 2018
    Copy the full SHA
    19981d3 View commit details

Commits on Mar 1, 2018

  1. Copy the full SHA
    4cf8a7c View commit details

Commits on Mar 5, 2018

  1. Copy the full SHA
    91cd833 View commit details
  2. Add full workflows

    run dist only after test on all platforms run.
    split workflows for:
    1. test all platforms
    2. tagged releases
    3. nightly releases
    4. maintenance releases (specific branch build per commit)
    bcardiff committed Mar 5, 2018
    Copy the full SHA
    f0e2be1 View commit details

Commits on Mar 6, 2018

  1. Copy the full SHA
    601d3c9 View commit details
  2. Update version branding

    Remove package iteration args
    Tidy up dist_docker args
    bcardiff committed Mar 6, 2018
    Copy the full SHA
    3533460 View commit details
  3. Run nightly at midnight

    bcardiff committed Mar 6, 2018
    Copy the full SHA
    04755f9 View commit details

Commits on Mar 7, 2018

  1. Copy the full SHA
    3ad85aa View commit details
  2. Run nightly on master

    bcardiff committed Mar 7, 2018
    Copy the full SHA
    2dd3a87 View commit details
  3. Copy the full SHA
    161bea6 View commit details

Commits on Mar 8, 2018

  1. Update changelog

    bcardiff committed Mar 8, 2018
    Copy the full SHA
    4f9ed8d View commit details

Commits on Mar 9, 2018

  1. Copy the full SHA
    731e9c0 View commit details
Showing with 423 additions and 109 deletions.
  1. +387 −0 .circleci/config.yml
  2. +2 −4 .travis.yml
  3. +12 −1 CHANGELOG.md
  4. +4 −72 bin/ci
  5. +0 −16 circle.yml
  6. +2 −0 spec/compiler/crystal/tools/init_spec.cr
  7. +3 −3 spec/std/dir_spec.cr
  8. +3 −3 src/compiler/crystal/macros.cr
  9. +8 −8 src/dir.cr
  10. +2 −2 src/openssl/ssl/context.cr
387 changes: 387 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
defaults:
environment: &env
TRAVIS_BRANCH: $CIRCLE_BRANCH
TRAVIS_PULL_REQUEST: $CI_PULL_REQUEST || "false"
steps: &ci_steps
- checkout
- run: bin/ci prepare_system
- run: bin/ci prepare_build
- run: bin/ci build

version: 2

jobs:
test_linux:
machine: true
environment:
<<: *env
TRAVIS_OS_NAME: linux
ARCH: x86_64
ARCH_CMD: linux64
steps: *ci_steps

test_linux32:
machine: true
environment:
<<: *env
TRAVIS_OS_NAME: linux
ARCH: i386
ARCH_CMD: linux32
ARCH_LIBRARY_PATH: /opt/crystal/embedded/lib/
steps: *ci_steps

test_darwin:
macos:
xcode: "9.0"
environment:
<<: *env
TRAVIS_OS_NAME: osx
steps: *ci_steps

prepare_common:
docker:
- image: docker:stable-git
steps:
# checkout specific distribution-scripts version to perform releases and nightly
- run: |
git clone https://github.com/crystal-lang/distribution-scripts.git ~/distribution-scripts
cd ~/distribution-scripts
git checkout 839e8ce63e5c48393faa0c126dd2f42aa5c798aa
# persist relevant information for build process
- run: |
cd ~/distribution-scripts
touch build.env
echo "export DOCKER_REPOSITORY=crystallang/crystal" >> build.env
# What to build
echo "export CRYSTAL_SHA1=$CIRCLE_SHA1" >> build.env
# Which previous version use
export PREVIOUS_CRYSTAL_BASE_URL="https://github.com/crystal-lang/crystal/releases/download/v0.24.1/crystal-0.24.1-2"
echo "export PREVIOUS_CRYSTAL_RELEASE_LINUX_TARGZ=${PREVIOUS_CRYSTAL_BASE_URL}-linux-x86_64.tar.gz" >> build.env
echo "export PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ=${PREVIOUS_CRYSTAL_BASE_URL}-darwin-x86_64.tar.gz" >> build.env
cat build.env
- persist_to_workspace:
root: ../
paths:
- distribution-scripts

# prepare build for tagged releases
prepare_tagged:
docker:
- image: docker:stable-git
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
# How to brand it
echo "export CRYSTAL_VERSION=$CIRCLE_TAG" >> build.env
echo "export DOCKER_TAG=$CIRCLE_TAG" >> build.env
cat build.env
- persist_to_workspace:
root: /tmp/workspace
paths:
- distribution-scripts

# prepare build for nightly releases
prepare_nightly:
docker:
- image: docker:stable-git
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
# How to brand it
export VERSION=nightly-$(date '+%Y%m%d')
echo "export CRYSTAL_VERSION=$VERSION" >> build.env
echo "export DOCKER_TAG=$VERSION" >> build.env
# Build from working directory (needed for omnibus and when version does not match branch/tag)
echo "export FORCE_GIT_TAGGED=0" >> build.env
cat build.env
- persist_to_workspace:
root: /tmp/workspace
paths:
- distribution-scripts

# prepare build for manual triggered releases like ci branches, maintenance releases, etc.
prepare_maintenance:
docker:
- image: docker:stable-git
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
# How to brand it
export VERSION=${CIRCLE_BRANCH/release\//}
export VERSION=${VERSION/\//-}-dev
echo "export CRYSTAL_VERSION=$VERSION" >> build.env
echo "export DOCKER_TAG=$VERSION" >> build.env
# Build from working directory (needed for omnibus and when version does not match branch/tag)
echo "export FORCE_GIT_TAGGED=0" >> build.env
cat build.env
- persist_to_workspace:
root: /tmp/workspace
paths:
- distribution-scripts

dist_linux:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
source build.env
cd linux
make release=true
- persist_to_workspace:
root: /tmp/workspace/distribution-scripts/linux/
paths:
- build

dist_darwin:
macos:
xcode: "9.0"
shell: /bin/bash --login -eo pipefail
steps:
- run:
name: Setup environment
command: |
brew install pkgconfig libtool
sudo mkdir -p /opt/crystal
sudo chown $(whoami) /opt/crystal/
sudo mkdir -p /var/cache
sudo chown $(whoami) /var/cache
- attach_workspace:
at: /tmp/workspace
- run:
no_output_timeout: 40m
command: |
echo "2.4.2" > /tmp/workspace/distribution-scripts/.ruby-version
cd /tmp/workspace/distribution-scripts
source build.env
cd omnibus
bundle check || bundle install --binstubs
cd ../darwin
make
- persist_to_workspace:
root: /tmp/workspace/distribution-scripts/darwin/
paths:
- build

dist_docker:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
source build.env
cd docker
make CRYSTAL_DEB=/tmp/workspace/build/crystal_${CRYSTAL_VERSION}-1_amd64.deb
- persist_to_workspace:
root: /tmp/workspace/distribution-scripts/docker/
paths:
- build

publish_docker:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
source ./build.env
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}.tar.gz | docker image load
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-build.tar.gz | docker image load
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
docker push ${DOCKER_REPOSITORY}:${DOCKER_TAG}
docker push ${DOCKER_REPOSITORY}:${DOCKER_TAG}-build
dist_docs:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- run: |
cd /tmp/workspace/distribution-scripts
source build.env
cd docs
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-build.tar.gz | docker image load
make CRYSTAL_DOCKER_IMAGE=${DOCKER_REPOSITORY}:${DOCKER_TAG}-build
- persist_to_workspace:
root: /tmp/workspace/distribution-scripts/docs/
paths:
- build

dist_artifacts:
docker:
- image: buildpack-deps:xenial
steps:
- attach_workspace:
at: /tmp/workspace
- store_artifacts:
path: /tmp/workspace/build
destination: dist_packages

workflows:
version: 2
test_all_platforms:
jobs:
- test_linux
- test_linux32
- test_darwin

tagged_release:
jobs:
- test_linux:
filters: &per_tag
branches:
ignore: /.*/
tags:
only: /.*/
- test_linux32:
filters: *per_tag
- test_darwin:
filters: *per_tag
- prepare_common:
filters: *per_tag
requires:
- test_linux
- test_linux32
- test_darwin
- prepare_tagged:
filters: *per_tag
requires:
- prepare_common
- dist_linux:
filters: *per_tag
requires:
- prepare_tagged
- dist_darwin:
filters: *per_tag
requires:
- prepare_tagged
- dist_docker:
filters: *per_tag
requires:
- dist_linux
# Tagged release do not publish docker images since they are unsigned
# publish_docker:
- dist_docs:
filters: *per_tag
requires:
- dist_docker
- dist_artifacts:
filters: *per_tag
requires:
- dist_linux
- dist_darwin
- dist_docker
- dist_docs

nightly_release:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- test_linux
- test_linux32
- test_darwin
- prepare_common:
requires:
- test_linux
- test_linux32
- test_darwin
- prepare_nightly:
requires:
- prepare_common
- dist_linux:
requires:
- prepare_nightly
- dist_darwin:
requires:
- prepare_nightly
- dist_docker:
requires:
- dist_linux
- publish_docker:
requires:
- dist_docker
- dist_docs:
requires:
- dist_docker
- dist_artifacts:
requires:
- dist_linux
- dist_darwin
- dist_docker
- dist_docs

maintenance_release:
jobs:
- test_linux:
filters: &maintenance
branches:
only:
- /release\/.+/
- /.*\bci\b.*/
- test_linux32:
filters: *maintenance
- test_darwin:
filters: *maintenance
- prepare_common:
filters: *maintenance
requires:
- test_linux
- test_linux32
- test_darwin
- prepare_maintenance:
filters: *maintenance
requires:
- prepare_common
- dist_linux:
filters: *maintenance
requires:
- prepare_maintenance
- dist_darwin:
filters: *maintenance
requires:
- prepare_maintenance
- dist_docker:
filters: *maintenance
requires:
- dist_linux
- publish_docker:
filters: *maintenance
requires:
- dist_docker
- dist_docs:
filters: *maintenance
requires:
- dist_docker
- dist_artifacts:
filters: *maintenance
requires:
- dist_linux
- dist_darwin
- dist_docker
- dist_docs

6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ matrix:
include:
- env: ARCH=i386 ARCH_CMD=linux32 ARCH_LIBRARY_PATH=/opt/crystal/embedded/lib/
os: linux
- env: ARCH=x86_64 ARCH_CMD=linux64 DEPLOY=true
- env: ARCH=x86_64 ARCH_CMD=linux64
os: linux

before_install:
@@ -25,13 +25,11 @@ install:
script:
- bin/ci build

after_success:
- bin/ci deploy

branches:
only:
- master
- /\Arelease\/.+\z/
- /.*\bci\b.*/

env:
global:
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# 0.24.1 (TBA)
# 0.24.2 (2018-03-08)

- Fixed an `Index out of bounds` raised during `at_exit` (#5224, #5565, thanks @ysbaddaden)
- Re-add `Dir#each` so it complies with `Enumerable` (#5458, thanks @bcardiff)
- Fixed `SSL::Context` bug verifying certificates (#5266, #5601, thanks @waj)
- Fixed UUID documentation that was missing (#5478, #5542, thanks @asterite)
- Fixed a bug with single expressions in parenthesis (#5482, #5511, #5513, thanks @MakeNowJust)
- Fixed `skip_file` macro docs (#5488, thanks @straight-shoota)
- Fixed CI `build` script's `LIBRARY_PATH` (#5457, #5461, thanks @bcardiff)
- Fixed formatter bug with upper-cased `fun` names (#5432, #5434, thanks @bew)

# 0.24.1 (2017-12-23)

## New features
- Add ThinLTO support for faster release builds in LLVM 4.0 and above. ([#4367](https://github.com/crystal-lang/crystal/issues/4367), thanks @bcardiff)
76 changes: 4 additions & 72 deletions bin/ci
Original file line number Diff line number Diff line change
@@ -5,18 +5,6 @@ fail() {
exit 1
}

on_deploy() {
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
if [ "${DEPLOY}" = "true" ]; then
echo "${@}"
eval "${@}"
return $?
else
return 0
fi
fi
}

on_tag() {
if [ -n "$CURRENT_TAG" ]; then
echo "${@}"
@@ -78,8 +66,10 @@ on_osx() {
}

prepare_system() {
on_linux 'echo '"'"'{"ipv6":true, "fixed-cidr-v6":"2001:db8:1::/64"}'"'"' | sudo tee /etc/docker/daemon.json'
on_linux sudo service docker restart

on_osx brew update
on_deploy sudo pip install awscli
}

build() {
@@ -89,61 +79,6 @@ build() {
with_build_env './bin/crystal tool format --check samples spec src'
}

deploy() {
export CURRENT_TAG=$(git describe --tags --exact-match 2> /dev/null)
export GIT_VERSION=$(git describe --tags --long --always 2>/dev/null)
on_deploy 'echo $GIT_VERSION > docs/revision.txt'

on_deploy aws s3 sync docs/ s3://crystal-api/api/$TRAVIS_BRANCH

on_deploy on_tag aws s3 sync docs/ s3://crystal-api/api/$CURRENT_TAG
cat - > .aws-config <<EOF
{
"IndexDocument": {
"Suffix": "index.html"
},
"RoutingRules": [
{
"Condition": {
"KeyPrefixEquals": "api/latest/${CURRENT_TAG}/"
},
"Redirect": {
"HttpRedirectCode": "302",
"ReplaceKeyWith": "404",
"Protocol": "https",
"HostName": "crystal-lang.org"
}
},
{
"Condition": {
"KeyPrefixEquals": "api/latest/"
},
"Redirect": {
"HttpRedirectCode": "302",
"ReplaceKeyPrefixWith": "api/${CURRENT_TAG}/",
"Protocol": "https",
"HostName": "crystal-lang.org"
}
},
{
"Condition": {
"KeyPrefixEquals": "api/",
"HttpErrorCodeReturnedEquals": "404"
},
"Redirect": {
"HttpRedirectCode": "301",
"ReplaceKeyPrefixWith": "api/latest/",
"Protocol": "https",
"HostName": "crystal-lang.org"
}
}
]
}
EOF
on_deploy on_tag cat .aws-config
on_deploy on_tag aws s3api put-bucket-website --bucket crystal-api --website-configuration file://.aws-config
}

prepare_build() {
on_linux verify_linux_environment

@@ -169,6 +104,7 @@ with_build_env() {
"jhass/crystal-build-$ARCH" \
"$ARCH_CMD" /bin/sh -c "'$command'"

on_osx sudo systemsetup -settimezone $TZ
on_osx PATH="/usr/local/opt/llvm/bin:\$PATH" \
CRYSTAL_CACHE_DIR="/tmp/crystal" \
/bin/sh -c "'$command'"
@@ -185,7 +121,6 @@ Commands:
prepare_system setup any necessaries repositories etc.
prepare_build download and extract any dependencies needed for the build
build run specs, build crystal, run format check, build samples, build the docs
deploy deploy the docs
with_build_env command run command in the build environment
help display this
@@ -208,9 +143,6 @@ case $command in
build)
build
;;
deploy)
deploy
;;
-h|--help|help)
usage
;;
16 changes: 0 additions & 16 deletions circle.yml

This file was deleted.

2 changes: 2 additions & 0 deletions spec/compiler/crystal/tools/init_spec.cr
Original file line number Diff line number Diff line change
@@ -64,12 +64,14 @@ module Crystal
end

describe_file "example/.gitignore" do |gitignore|
gitignore.should contain("/docs/")
gitignore.should contain("/.shards/")
gitignore.should contain("/shard.lock")
gitignore.should contain("/lib/")
end

describe_file "example_app/.gitignore" do |gitignore|
gitignore.should contain("/docs/")
gitignore.should contain("/.shards/")
gitignore.should_not contain("/shard.lock")
gitignore.should contain("/lib/")
6 changes: 3 additions & 3 deletions spec/std/dir_spec.cr
Original file line number Diff line number Diff line change
@@ -342,7 +342,7 @@ describe "Dir" do
filenames = [] of String

dir = Dir.new(__DIR__)
dir.each_entry do |filename|
dir.each do |filename|
filenames << filename
end.should be_nil
dir.close
@@ -354,7 +354,7 @@ describe "Dir" do
filenames = [] of String

Dir.open(__DIR__) do |dir|
dir.each_entry do |filename|
dir.each do |filename|
filenames << filename
end.should be_nil
end
@@ -380,7 +380,7 @@ describe "Dir" do
it "gets dir iterator" do
filenames = [] of String

iter = Dir.new(__DIR__).each_entry
iter = Dir.new(__DIR__).each
iter.each do |filename|
filenames << filename
end
6 changes: 3 additions & 3 deletions src/compiler/crystal/macros.cr
Original file line number Diff line number Diff line change
@@ -100,19 +100,19 @@ module Crystal::Macros

# Skips the rest of the file from which it is executed.
# Typical usage is to skip files that have platform specific code,
# without having to surround the most relevant code in `{%...%}` macro blocks.
# without having to surround the most relevant code in `{% if flag?(...) %} ... {% end %}` macro blocks.
#
# Example:
#
# ```
# # sth_for_osx.cr
# {% skip unless flag?(:darwin) %}
# {% skip_file unless flag?(:darwin) %}
#
# # Class FooForMac will only be defined if we're compiling on OS X
# class FooForMac
# end
# ```
def skip : Nop
def skip_file : Nop
end

# This is the base class of all AST nodes. This methods are
16 changes: 8 additions & 8 deletions src/dir.cr
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ class Dir
# File.write("testdir/config.h", "")
#
# d = Dir.new("testdir")
# d.each_entry { |x| puts "Got #{x}" }
# d.each { |x| puts "Got #{x}" }
# ```
#
# produces:
@@ -53,20 +53,20 @@ class Dir
# Got ..
# Got config.h
# ```
def each_entry : Nil
def each : Nil
while entry = read
yield entry
end
end

def each_entry
def each
EntryIterator.new(self)
end

# Returns an array containing all of the filenames in the given directory.
def entries : Array(String)
entries = [] of String
each_entry do |filename|
each do |filename|
entries << filename
end
entries
@@ -80,7 +80,7 @@ class Dir
# File.write("testdir/config.h", "")
#
# d = Dir.new("testdir")
# d.each_entry { |x| puts "Got #{x}" }
# d.each_child { |x| puts "Got #{x}" }
# ```
#
# produces:
@@ -159,10 +159,10 @@ class Dir
end
end

# See `#each_entry`.
def self.each_entry(dirname)
# See `#each`.
def self.each(dirname)
Dir.open(dirname) do |dir|
dir.each_entry do |filename|
dir.each do |filename|
yield filename
end
end
4 changes: 2 additions & 2 deletions src/openssl/ssl/context.cr
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ abstract class OpenSSL::SSL::Context

self.verify_mode = OpenSSL::SSL::VerifyMode::PEER
{% if LibSSL::OPENSSL_102 %}
self.default_verify_param = "ssl_client"
self.default_verify_param = "ssl_server"
{% end %}
end

@@ -130,7 +130,7 @@ abstract class OpenSSL::SSL::Context

add_options(OpenSSL::SSL::Options::CIPHER_SERVER_PREFERENCE)
{% if LibSSL::OPENSSL_102 %}
self.default_verify_param = "ssl_server"
self.default_verify_param = "ssl_client"
{% end %}

set_tmp_ecdh_key(curve: LibCrypto::NID_X9_62_prime256v1)