Skip to content

Commit

Permalink
adding some types to method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Sep 2, 2024
1 parent 6a502d5 commit 8bba3da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/resolvers/fossil.cr
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ module Shards
!files.strip.empty?
end

private def capture(command, path = local_path)
private def capture(command : String, path : String = local_path) : String
run(command, capture: true, path: path).not_nil!
end

Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/git.cr
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ module Shards
false
end

private def origin_url
private def origin_url : String
@origin_url ||= capture("git ls-remote --get-url origin --bare").strip
end

Expand Down Expand Up @@ -415,7 +415,7 @@ module Shards
!files.strip.empty?
end

private def capture(command, path = local_path)
private def capture(command : String, path : String = local_path) : String
run(command, capture: true, path: path).not_nil!
end

Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/hg.cr
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ module Shards
File.exists?(File.join(local_path, ".hg", "dirstate"))
end

private def origin_url
private def origin_url : String
@origin_url ||= capture("hg paths default").strip
end

Expand Down Expand Up @@ -433,7 +433,7 @@ module Shards
run("hg files -r #{Process.quote(ref.to_hg_revset)} -- #{Process.quote(path)}", raise_on_fail: false)
end

private def capture(command, path = local_path)
private def capture(command : String, path : String = local_path) : String
run(command, capture: true, path: path).as(String)
end

Expand Down

0 comments on commit 8bba3da

Please sign in to comment.