Skip to content

Commit

Permalink
Merge a5c216e into 37811c5
Browse files Browse the repository at this point in the history
  • Loading branch information
y-yagi committed Mar 15, 2024
2 parents 37811c5 + a5c216e commit 173de79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ bundle exec appraisal activerecord-7.0 rake
# MYSQL80=1 bundle exec appraisal activerecord-7.0 rake
```

**Notice:** Ruby 2.6 or above/mysql-client/postgresql-client is required.
**Notice:** Ruby 2.7 or above/mysql-client/postgresql-client is required.

## Demo

Expand Down
7 changes: 2 additions & 5 deletions bin/ridgepole
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ ARGV.options do |opt|
opt.on('', '--dry-run') { options[:dry_run] = true }
opt.on('', '--table-options OPTIONS') { |v| options[:table_options] = v }
opt.on('', '--table-hash-options OPTIONS') do |v|
# NOTE: Ruby2.4 doesn't support `symbolize_names: true`
hash = YAML.safe_load(v).deep_symbolize_keys
hash = YAML.safe_load(v, symbolize_names: true)

case hash[:id]
when String
Expand Down Expand Up @@ -265,15 +264,13 @@ begin
else
File.open(diff_file)
end
elsif Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') # Ruby 2.6
else
YAML.safe_load(
diff_file,
permitted_classes: [],
permitted_symbols: [],
aliases: true
)
else
YAML.safe_load(diff_file, [], [], true)
end
end

Expand Down
21 changes: 7 additions & 14 deletions lib/ridgepole/cli/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ def load(config, env = 'development', spec_name = '')
parse_config_file(config)
elsif (expanded = File.expand_path(config)) && File.exist?(expanded)
parse_config_file(expanded)
elsif Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') # Ruby 2.6
else
YAML.safe_load(
ERB.new(config).result,
permitted_classes: [],
permitted_symbols: [],
aliases: true
)
else
YAML.safe_load(ERB.new(config).result, [], [], true)
end

parsed_config = parse_database_url(config) unless parsed_config.is_a?(Hash)
Expand All @@ -39,17 +37,12 @@ def load(config, env = 'development', spec_name = '')

def parse_config_file(path)
yaml = ERB.new(File.read(path)).result

if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') # Ruby 2.6
YAML.safe_load(
yaml,
permitted_classes: [],
permitted_symbols: [],
aliases: true
)
else
YAML.safe_load(yaml, [], [], true)
end
YAML.safe_load(
yaml,
permitted_classes: [],
permitted_symbols: [],
aliases: true
)
end

def parse_database_url(config)
Expand Down

0 comments on commit 173de79

Please sign in to comment.