Skip to content

Commit

Permalink
Changes in YAML.safe_load
Browse files Browse the repository at this point in the history
  • Loading branch information
emrojo committed Nov 6, 2023
1 parent b6ebdff commit 74a8444
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ GEM
ast (2.4.2)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
base64 (0.1.1)
bindex (0.8.1)
bootsnap (1.14.0)
msgpack (~> 1.2)
Expand Down Expand Up @@ -243,7 +242,7 @@ GEM
public_suffix (5.0.0)
puma (6.0.0)
nio4r (~> 2.0)
racc (1.6.0)
racc (1.7.3)
rack (2.2.4)
rack-mini-profiler (3.0.0)
rack (>= 1.2.0)
Expand Down Expand Up @@ -310,8 +309,7 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.0)
rubocop (1.57.1)
base64 (~> 0.1.1)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -322,7 +320,7 @@ GEM
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.15.1)
rubocop (>= 1.7.0, < 2.0)
Expand Down
5 changes: 4 additions & 1 deletion config/initializers/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ def instance # rubocop:todo Metrics/AbcSize
# but the creates an immutable setting object that messes with tests.
# Immutability is good here though, so we should probably fix that.
# Added flag onto safe_load to allow read of anchors (aliases) in yml files.
@instance = Hashie::Mash.new(YAML.safe_load_file(configuration_filename, [Symbol], [], true))
config_file_descriptor = File.open(configuration_filename, 'r:bom|utf-8')
@instance = Hashie::Mash.new(YAML.safe_load(config_file_descriptor, permitted_classes: [Symbol]))

#@instance = Hashie::Mash.new(safe_content)

# To view a list of pipeline groups and respective pipelines:
# e.g. Settings.pipelines.group_by(&:pipeline_group).transform_values { |pipelines| pipelines.map(&:name) }
Expand Down

0 comments on commit 74a8444

Please sign in to comment.