diff --git a/spec/support/cli.cr b/spec/support/cli.cr index c9c3cae5..d7319d37 100644 --- a/spec/support/cli.cr +++ b/spec/support/cli.cr @@ -8,7 +8,7 @@ Spec.before_each do end end -def with_shard(metadata, lock = nil, override = nil) +def with_shard(metadata, lock = nil, override = nil, &) Dir.cd(application_path) do File.write "shard.yml", to_shard_yaml(metadata) File.write "shard.lock", to_lock_yaml(lock) if lock diff --git a/src/commands/command.cr b/src/commands/command.cr index 11f3ca90..cb84fd6a 100644 --- a/src/commands/command.cr +++ b/src/commands/command.cr @@ -73,7 +73,7 @@ module Shards Shards::Lock.write(packages, override_path, LOCK_FILENAME) end - def handle_resolver_errors + def handle_resolver_errors(&) yield rescue e : Molinillo::ResolverError Log.error { e.message } diff --git a/src/ext/yaml.cr b/src/ext/yaml.cr index e4fffed7..90cf1cb7 100644 --- a/src/ext/yaml.cr +++ b/src/ext/yaml.cr @@ -4,7 +4,7 @@ module YAML class PullParser # Iterates a sequence, yielding on each new entry until the sequence is # terminated. - def each_in_sequence : Nil + def each_in_sequence(&) : Nil read_sequence_start until kind == YAML::EventKind::SEQUENCE_END yield @@ -14,7 +14,7 @@ module YAML # Iterates a mapping, yielding on each new entry until the mapping is # terminated. - def each_in_mapping : Nil + def each_in_mapping(&) : Nil read_mapping_start until kind == YAML::EventKind::MAPPING_END yield diff --git a/src/resolvers/fossil.cr b/src/resolvers/fossil.cr index b8724a85..b568994c 100644 --- a/src/resolvers/fossil.cr +++ b/src/resolvers/fossil.cr @@ -380,7 +380,7 @@ module Shards end end - private def fossil_retry(err = "Failed to fetch repository") + private def fossil_retry(err = "Failed to fetch repository", &) retries = 0 loop do yield diff --git a/src/resolvers/git.cr b/src/resolvers/git.cr index b2c1c5fd..f150ca36 100644 --- a/src/resolvers/git.cr +++ b/src/resolvers/git.cr @@ -327,7 +327,7 @@ module Shards end end - private def git_retry(err = "Failed to fetch repository") + private def git_retry(err = "Failed to fetch repository", &) retries = 0 loop do yield diff --git a/src/resolvers/hg.cr b/src/resolvers/hg.cr index 2d33a720..7568b09d 100644 --- a/src/resolvers/hg.cr +++ b/src/resolvers/hg.cr @@ -352,7 +352,7 @@ module Shards end end - private def hg_retry(err = "Failed to update repository") + private def hg_retry(err = "Failed to update repository", &) retries = 0 loop do return yield diff --git a/src/versions.cr b/src/versions.cr index 1ee1562f..0795bbf9 100644 --- a/src/versions.cr +++ b/src/versions.cr @@ -63,7 +63,7 @@ module Shards end end - def only_zeroes? + def only_zeroes?(&) return if empty? yield unless to_i? == 0