Skip to content

Commit

Permalink
Fix CI error in JRuby
Browse files Browse the repository at this point in the history
```
NameError:
  uninitialized constant Set
```

See <https://github.com/GrottoPress/envy.rb/actions/runs/9333465138/job/25690519165>.
  • Loading branch information
akadusei committed Jun 1, 2024
1 parent 4e3978b commit 578d97c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/envy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "yaml"
require "set"

require_relative "envy/version"
require_relative "envy/error"
Expand Down Expand Up @@ -47,12 +48,12 @@ def set_perms(files, perm: nil)
# rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity
def set_envs(yaml, prev_key = "", force:)
case yaml
when ::Hash
when Hash
yaml.each do |key, value|
env_key = "#{prev_key}_#{key.to_s.upcase}".sub(/\A_/, "")
set_envs(value, env_key, force: force)
end
when ::Array, ::Set
when Array, Set
yaml.each_with_index do |value, index|
env_key = "#{prev_key}_#{index}".sub(/\A_/, "")
set_envs(value, env_key, force: force)
Expand Down

0 comments on commit 578d97c

Please sign in to comment.