|
1 | 1 | # frozen_string_literal: true
|
2 | 2 |
|
3 | 3 | Synvert::Rewriter.new 'rails', 'convert_configs_7_0_to_7_1' do
|
4 |
| - configure(parser: Synvert::PARSER_PARSER) |
| 4 | + configure(parser: Synvert::PRISM_PARSER) |
5 | 5 |
|
6 | 6 | description <<~EOS
|
7 | 7 | It converts rails configs from 7.0 to 7.1
|
|
17 | 17 | call_helper 'rails/set_load_defaults', rails_version: '7.1'
|
18 | 18 |
|
19 | 19 | within_files 'config/environments/*.rb' do
|
20 |
| - find_node '.send[receiver=.send[receiver=.send[receiver=nil][message=config][arguments.size=0]][message=action_dispatch][arguments.size=0]][message=show_exceptions=][arguments.size=1][arguments.0=true]' do |
21 |
| - replace :arguments, with: ':all' |
| 20 | + with_node node_type: 'call_node', |
| 21 | + receiver: { node_type: 'call_node', receiver: 'config', name: 'action_dispatch' }, |
| 22 | + name: 'show_exceptions=', |
| 23 | + arguments: { node_type: 'arguments_node', arguments: { size: 1, first: true } } do |
| 24 | + replace 'arguments.arguments', with: ':all' |
22 | 25 | end
|
23 | 26 |
|
24 |
| - find_node '.send[receiver=.send[receiver=.send[receiver=nil][message=config][arguments.size=0]][message=action_dispatch][arguments.size=0]][message=show_exceptions=][arguments.size=1][arguments.0=false]' do |
25 |
| - replace :arguments, with: ':none' |
| 27 | + with_node node_type: 'call_node', |
| 28 | + receiver: { node_type: 'call_node', receiver: 'config', name: 'action_dispatch' }, |
| 29 | + name: 'show_exceptions=', |
| 30 | + arguments: { node_type: 'arguments_node', arguments: { size: 1, first: false } } do |
| 31 | + replace 'arguments.arguments', with: ':none' |
26 | 32 | end
|
27 | 33 | end
|
28 | 34 | end
|
0 commit comments