leftovers 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/README.md +28 -45
- data/docs/Configuration.md +598 -0
- data/exe/leftovers +2 -2
- data/leftovers.gemspec +13 -7
- data/lib/config/attr_encrypted.yml +3 -4
- data/lib/config/audited.yml +9 -0
- data/lib/config/datagrid.yml +1 -1
- data/lib/config/flipper.yml +1 -3
- data/lib/config/graphql.yml +15 -13
- data/lib/config/okcomputer.yml +1 -3
- data/lib/config/parser.yml +89 -91
- data/lib/config/rails.yml +162 -92
- data/lib/config/redcarpet.yml +35 -38
- data/lib/config/rollbar.yml +1 -3
- data/lib/config/rspec.yml +18 -10
- data/lib/config/ruby.yml +42 -39
- data/lib/config/selenium-webdriver.yml +19 -0
- data/lib/config/sidekiq.yml +9 -0
- data/lib/config/will_paginate.yml +12 -14
- data/lib/leftovers.rb +60 -43
- data/lib/leftovers/ast.rb +8 -0
- data/lib/leftovers/ast/builder.rb +6 -3
- data/lib/leftovers/ast/node.rb +63 -104
- data/lib/leftovers/backports.rb +24 -40
- data/lib/leftovers/cli.rb +17 -14
- data/lib/leftovers/collector.rb +7 -11
- data/lib/leftovers/config.rb +34 -13
- data/lib/leftovers/config_validator.rb +60 -0
- data/lib/leftovers/config_validator/error_processor.rb +196 -0
- data/lib/leftovers/config_validator/schema_hash.rb +495 -0
- data/lib/leftovers/definition.rb +14 -39
- data/lib/leftovers/definition_set.rb +7 -17
- data/lib/leftovers/dynamic_processors.rb +11 -0
- data/lib/leftovers/dynamic_processors/call.rb +25 -0
- data/lib/leftovers/dynamic_processors/call_definition.rb +31 -0
- data/lib/leftovers/dynamic_processors/definition.rb +26 -0
- data/lib/leftovers/dynamic_processors/each.rb +19 -0
- data/lib/leftovers/dynamic_processors/null.rb +9 -0
- data/lib/leftovers/erb.rb +2 -2
- data/lib/leftovers/file.rb +3 -5
- data/lib/leftovers/file_collector.rb +72 -85
- data/lib/leftovers/file_list.rb +9 -12
- data/lib/leftovers/haml.rb +9 -12
- data/lib/leftovers/matcher_builders.rb +24 -0
- data/lib/leftovers/matcher_builders/and.rb +19 -0
- data/lib/leftovers/matcher_builders/and_not.rb +14 -0
- data/lib/leftovers/matcher_builders/argument_node_value.rb +21 -0
- data/lib/leftovers/matcher_builders/name.rb +29 -0
- data/lib/leftovers/matcher_builders/node.rb +40 -0
- data/lib/leftovers/matcher_builders/node_has_argument.rb +71 -0
- data/lib/leftovers/matcher_builders/node_has_keyword_argument.rb +22 -0
- data/lib/leftovers/matcher_builders/node_has_positional_argument.rb +24 -0
- data/lib/leftovers/matcher_builders/node_name.rb +15 -0
- data/lib/leftovers/matcher_builders/node_pair_name.rb +18 -0
- data/lib/leftovers/matcher_builders/node_pair_value.rb +16 -0
- data/lib/leftovers/matcher_builders/node_path.rb +14 -0
- data/lib/leftovers/matcher_builders/node_type.rb +28 -0
- data/lib/leftovers/matcher_builders/or.rb +73 -0
- data/lib/leftovers/matcher_builders/path.rb +15 -0
- data/lib/leftovers/matcher_builders/string.rb +11 -0
- data/lib/leftovers/matcher_builders/string_pattern.rb +19 -0
- data/lib/leftovers/matcher_builders/unless.rb +13 -0
- data/lib/leftovers/matchers.rb +26 -0
- data/lib/leftovers/matchers/all.rb +25 -0
- data/lib/leftovers/matchers/and.rb +24 -0
- data/lib/leftovers/matchers/any.rb +27 -0
- data/lib/leftovers/matchers/node_has_any_keyword_argument.rb +28 -0
- data/lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb +25 -0
- data/lib/leftovers/matchers/node_has_positional_argument.rb +23 -0
- data/lib/leftovers/matchers/node_has_positional_argument_with_value.rb +25 -0
- data/lib/leftovers/matchers/node_name.rb +23 -0
- data/lib/leftovers/matchers/node_pair_value.rb +23 -0
- data/lib/leftovers/matchers/node_path.rb +23 -0
- data/lib/leftovers/matchers/node_scalar_value.rb +25 -0
- data/lib/leftovers/matchers/node_type.rb +23 -0
- data/lib/leftovers/matchers/not.rb +23 -0
- data/lib/leftovers/matchers/or.rb +26 -0
- data/lib/leftovers/merged_config.rb +20 -14
- data/lib/leftovers/parser.rb +37 -0
- data/lib/leftovers/processor_builders.rb +22 -0
- data/lib/leftovers/processor_builders/action.rb +63 -0
- data/lib/leftovers/processor_builders/add_prefix.rb +20 -0
- data/lib/leftovers/processor_builders/add_suffix.rb +20 -0
- data/lib/leftovers/processor_builders/argument.rb +25 -0
- data/lib/leftovers/processor_builders/dynamic.rb +27 -0
- data/lib/leftovers/processor_builders/each.rb +36 -0
- data/lib/leftovers/processor_builders/each_action.rb +51 -0
- data/lib/leftovers/processor_builders/each_dynamic.rb +54 -0
- data/lib/leftovers/processor_builders/each_for_definition_set.rb +36 -0
- data/lib/leftovers/processor_builders/itself.rb +13 -0
- data/lib/leftovers/processor_builders/keyword.rb +24 -0
- data/lib/leftovers/processor_builders/keyword_argument.rb +14 -0
- data/lib/leftovers/processor_builders/transform.rb +55 -0
- data/lib/leftovers/processor_builders/transform_chain.rb +24 -0
- data/lib/leftovers/processor_builders/transform_set.rb +47 -0
- data/lib/leftovers/processor_builders/value.rb +13 -0
- data/lib/leftovers/rake_task.rb +4 -4
- data/lib/leftovers/reporter.rb +1 -1
- data/lib/leftovers/value_processors.rb +40 -0
- data/lib/leftovers/value_processors/add_dynamic_prefix.rb +31 -0
- data/lib/leftovers/value_processors/add_dynamic_suffix.rb +31 -0
- data/lib/leftovers/value_processors/add_prefix.rb +20 -0
- data/lib/leftovers/value_processors/add_suffix.rb +20 -0
- data/lib/leftovers/value_processors/camelize.rb +24 -0
- data/lib/leftovers/value_processors/capitalize.rb +19 -0
- data/lib/leftovers/value_processors/deconstantize.rb +24 -0
- data/lib/leftovers/value_processors/delete_after.rb +22 -0
- data/lib/leftovers/value_processors/delete_before.rb +22 -0
- data/lib/leftovers/value_processors/delete_prefix.rb +26 -0
- data/lib/leftovers/value_processors/delete_suffix.rb +26 -0
- data/lib/leftovers/value_processors/demodulize.rb +24 -0
- data/lib/leftovers/value_processors/downcase.rb +19 -0
- data/lib/leftovers/value_processors/each.rb +21 -0
- data/lib/leftovers/value_processors/each_for_definition_set.rb +33 -0
- data/lib/leftovers/value_processors/each_keyword.rb +27 -0
- data/lib/leftovers/value_processors/each_keyword_argument.rb +27 -0
- data/lib/leftovers/value_processors/each_positional_argument.rb +24 -0
- data/lib/leftovers/value_processors/itself.rb +17 -0
- data/lib/leftovers/value_processors/keyword.rb +36 -0
- data/lib/leftovers/value_processors/keyword_argument.rb +36 -0
- data/lib/leftovers/value_processors/parameterize.rb +24 -0
- data/lib/leftovers/value_processors/placeholder.rb +18 -0
- data/lib/leftovers/value_processors/pluralize.rb +24 -0
- data/lib/leftovers/value_processors/positional_argument.rb +26 -0
- data/lib/leftovers/value_processors/replace_value.rb +18 -0
- data/lib/leftovers/value_processors/return_definition.rb +24 -0
- data/lib/leftovers/value_processors/return_string.rb +14 -0
- data/lib/leftovers/value_processors/singularize.rb +24 -0
- data/lib/leftovers/value_processors/split.rb +22 -0
- data/lib/leftovers/value_processors/swapcase.rb +19 -0
- data/lib/leftovers/value_processors/titleize.rb +24 -0
- data/lib/leftovers/value_processors/underscore.rb +24 -0
- data/lib/leftovers/value_processors/upcase.rb +19 -0
- data/lib/leftovers/version.rb +1 -1
- metadata +193 -29
- data/lib/config/selenium.yml +0 -21
- data/lib/leftovers/argument_rule.rb +0 -218
- data/lib/leftovers/core_ext.rb +0 -13
- data/lib/leftovers/hash_rule.rb +0 -40
- data/lib/leftovers/name_rule.rb +0 -53
- data/lib/leftovers/rule.rb +0 -74
- data/lib/leftovers/transform_rule.rb +0 -171
- data/lib/leftovers/value_rule.rb +0 -56
data/exe/leftovers
CHANGED
data/leftovers.gemspec
CHANGED
@@ -16,9 +16,10 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata['homepage_uri'] = spec.homepage
|
18
18
|
spec.metadata['source_code_uri'] = 'http://github.com/robotdana/leftovers'
|
19
|
-
spec.metadata['changelog_uri'] = 'http://github.com/robotdana/leftovers/blob/
|
19
|
+
spec.metadata['changelog_uri'] = 'http://github.com/robotdana/leftovers/blob/main/CHANGELOG.md'
|
20
|
+
spec.required_ruby_version = '>= 2.4.0'
|
20
21
|
|
21
|
-
spec.files = Dir.glob('{lib,exe}/**/{*,.*}') + %w{
|
22
|
+
spec.files = Dir.glob('{lib,exe,docs}/**/{*,.*}') + %w{
|
22
23
|
CHANGELOG.md
|
23
24
|
Gemfile
|
24
25
|
LICENSE.txt
|
@@ -30,17 +31,22 @@ Gem::Specification.new do |spec|
|
|
30
31
|
spec.require_paths = ['lib']
|
31
32
|
|
32
33
|
spec.add_development_dependency 'activesupport'
|
34
|
+
spec.add_development_dependency 'benchmark-ips'
|
33
35
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
34
36
|
spec.add_development_dependency 'haml'
|
35
37
|
spec.add_development_dependency 'pry', '~> 0.1'
|
36
|
-
spec.add_development_dependency 'rake', '
|
38
|
+
spec.add_development_dependency 'rake', '>= 13'
|
37
39
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
39
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
40
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.
|
40
|
+
spec.add_development_dependency 'rubocop', '~> 0.93.1'
|
41
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.8.1'
|
42
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.44.1'
|
43
|
+
spec.add_development_dependency 'simplecov', '>= 0.18.5'
|
44
|
+
spec.add_development_dependency 'simplecov-console'
|
45
|
+
spec.add_development_dependency 'tty_string', '>= 0.2.1'
|
41
46
|
|
42
47
|
spec.add_development_dependency 'spellr', '>= 0.8.1'
|
43
|
-
spec.add_dependency 'fast_ignore', '>= 0.
|
48
|
+
spec.add_dependency 'fast_ignore', '>= 0.15.1'
|
49
|
+
spec.add_dependency 'json_schemer'
|
44
50
|
spec.add_dependency 'parallel'
|
45
51
|
spec.add_dependency 'parser'
|
46
52
|
end
|
data/lib/config/datagrid.yml
CHANGED
data/lib/config/flipper.yml
CHANGED
data/lib/config/graphql.yml
CHANGED
@@ -1,20 +1,22 @@
|
|
1
|
-
|
2
|
-
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
- sliced_nodes
|
1
|
+
keep:
|
2
|
+
- cursor_from_node
|
3
|
+
- paged_nodes
|
4
|
+
- sliced_nodes
|
5
|
+
dynamic:
|
7
6
|
- name: field
|
8
7
|
calls:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
argument: method
|
9
|
+
- name: field
|
10
|
+
unless:
|
11
|
+
has_argument: method
|
12
|
+
calls: 0
|
13
13
|
- name: argument
|
14
|
+
unless:
|
15
|
+
has_argument: as
|
14
16
|
calls:
|
15
|
-
- argument:
|
17
|
+
- argument: 0
|
16
18
|
add_suffix: '='
|
17
|
-
|
18
|
-
|
19
|
+
- name: argument
|
20
|
+
calls:
|
19
21
|
- argument: as
|
20
22
|
add_suffix: '='
|
data/lib/config/okcomputer.yml
CHANGED
data/lib/config/parser.yml
CHANGED
@@ -1,91 +1,89 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
process_var_asgn_node
|
91
|
-
process_variable_node
|
1
|
+
keep:
|
2
|
+
- on_alias
|
3
|
+
- on_and
|
4
|
+
- on_and_asgn
|
5
|
+
- on_arg
|
6
|
+
- on_arg_expr
|
7
|
+
- on_args
|
8
|
+
- on_argument
|
9
|
+
- on_array
|
10
|
+
- on_back_ref
|
11
|
+
- on_begin
|
12
|
+
- on_block
|
13
|
+
- on_block_pass
|
14
|
+
- on_blockarg
|
15
|
+
- on_blockarg_expr
|
16
|
+
- on_break
|
17
|
+
- on_case
|
18
|
+
- on_casgn
|
19
|
+
- on_class
|
20
|
+
- on_const
|
21
|
+
- on_csend
|
22
|
+
- on_cvar
|
23
|
+
- on_cvasgn
|
24
|
+
- on_def
|
25
|
+
- on_defined?
|
26
|
+
- on_defs
|
27
|
+
- on_dstr
|
28
|
+
- on_dsym
|
29
|
+
- on_eflipflop
|
30
|
+
- on_ensure
|
31
|
+
- on_erange
|
32
|
+
- on_for
|
33
|
+
- on_gvar
|
34
|
+
- on_gvasgn
|
35
|
+
- on_hash
|
36
|
+
- on_if
|
37
|
+
- on_iflipflop
|
38
|
+
- on_irange
|
39
|
+
- on_ivar
|
40
|
+
- on_ivasgn
|
41
|
+
- on_kwarg
|
42
|
+
- on_kwbegin
|
43
|
+
- on_kwoptarg
|
44
|
+
- on_kwrestarg
|
45
|
+
- on_lvar
|
46
|
+
- on_lvasgn
|
47
|
+
- on_masgn
|
48
|
+
- on_match_current_line
|
49
|
+
- on_match_with_lvasgn
|
50
|
+
- on_mlhs
|
51
|
+
- on_module
|
52
|
+
- on_next
|
53
|
+
- on_not
|
54
|
+
- on_nth_ref
|
55
|
+
- on_op_asgn
|
56
|
+
- on_optarg
|
57
|
+
- on_or
|
58
|
+
- on_or_asgn
|
59
|
+
- on_pair
|
60
|
+
- on_postexe
|
61
|
+
- on_preexe
|
62
|
+
- on_procarg0
|
63
|
+
- on_redo
|
64
|
+
- on_regexp
|
65
|
+
- on_resbody
|
66
|
+
- on_rescue
|
67
|
+
- on_restarg
|
68
|
+
- on_restarg_expr
|
69
|
+
- on_retry
|
70
|
+
- on_return
|
71
|
+
- on_sclass
|
72
|
+
- on_send
|
73
|
+
- on_shadowarg
|
74
|
+
- on_splat
|
75
|
+
- on_super
|
76
|
+
- on_undef
|
77
|
+
- on_until
|
78
|
+
- on_until_post
|
79
|
+
- on_var
|
80
|
+
- on_vasgn
|
81
|
+
- on_when
|
82
|
+
- on_while
|
83
|
+
- on_while_post
|
84
|
+
- on_xstr
|
85
|
+
- on_yield
|
86
|
+
- process_argument_node
|
87
|
+
- process_regular_node
|
88
|
+
- process_var_asgn_node
|
89
|
+
- process_variable_node
|
data/lib/config/rails.yml
CHANGED
@@ -4,24 +4,30 @@ exclude_paths:
|
|
4
4
|
include_paths:
|
5
5
|
- '*.rjs'
|
6
6
|
- '*.rhtml'
|
7
|
+
requires:
|
8
|
+
- 'active_support/core_ext/string'
|
9
|
+
- 'active_support/inflections'
|
10
|
+
- './config/initializers/inflections'
|
7
11
|
|
8
12
|
# THIS IS INCOMPLETE (you can help by expanding it)
|
9
13
|
# rails is _really complicated_ and has a lot of magic which calls methods for you.
|
10
14
|
# some is currently impossible to handle (with_options).
|
11
15
|
# Some is just corners of rails I haven't hit yet.
|
12
|
-
|
13
|
-
|
14
|
-
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
names:
|
23
|
-
has_suffix: Helper
|
16
|
+
keep:
|
17
|
+
- ClassMethods # ActiveSupport::Concern
|
18
|
+
- process_action # ActiveSupport::LogSubscriber
|
19
|
+
- validate_each # ActiveModel::EachValidator
|
20
|
+
- format_message # ActiveSupport::Logger
|
21
|
+
- ssl_configured? # ApplicationController
|
22
|
+
- default_url_options # called by url_for
|
23
|
+
- APP_PATH
|
24
|
+
- APP_ROOT
|
25
|
+
- has_suffix: Helper
|
24
26
|
path: /app/helpers
|
27
|
+
- has_suffix: Preview
|
28
|
+
path: '**/mailers/previews/**/*_preview.rb'
|
29
|
+
|
30
|
+
dynamic:
|
25
31
|
- names:
|
26
32
|
- after_initialize
|
27
33
|
- after_find
|
@@ -47,10 +53,10 @@ rules:
|
|
47
53
|
- after_destroy_commit
|
48
54
|
- after_save_commit
|
49
55
|
calls:
|
50
|
-
arguments:
|
51
|
-
|
52
|
-
|
53
|
-
|
56
|
+
- arguments: 0
|
57
|
+
- arguments: [if, unless]
|
58
|
+
nested:
|
59
|
+
arguments: '*'
|
54
60
|
- name:
|
55
61
|
- after_action
|
56
62
|
- append_after_action
|
@@ -66,22 +72,24 @@ rules:
|
|
66
72
|
- skip_around_action
|
67
73
|
- validates_associated
|
68
74
|
calls:
|
69
|
-
- arguments:
|
70
|
-
- '*'
|
71
|
-
- if
|
72
|
-
- unless
|
75
|
+
- arguments: ['*', if, unless]
|
73
76
|
- name: validates
|
74
77
|
calls:
|
75
78
|
- arguments:
|
76
79
|
- '*'
|
77
|
-
-
|
80
|
+
- within
|
78
81
|
- inclusion
|
79
82
|
- scope
|
80
83
|
- if
|
81
84
|
- unless
|
82
|
-
-
|
85
|
+
- arguments: inclusion
|
86
|
+
nested:
|
87
|
+
arguments: 'in'
|
88
|
+
- keywords:
|
89
|
+
unless: [if, unless]
|
83
90
|
camelize: true
|
84
91
|
add_suffix: Validator
|
92
|
+
split: '::'
|
85
93
|
- names:
|
86
94
|
- validate
|
87
95
|
- validate_associated
|
@@ -116,8 +124,8 @@ rules:
|
|
116
124
|
- url_field
|
117
125
|
- week_field
|
118
126
|
calls:
|
119
|
-
- arguments: [1
|
120
|
-
- arguments: [1
|
127
|
+
- arguments: [0,1] # 0: with a receiver, 1: with no receiver
|
128
|
+
- arguments: [0,1]
|
121
129
|
add_suffix: '='
|
122
130
|
- name: fields_for
|
123
131
|
calls:
|
@@ -125,97 +133,146 @@ rules:
|
|
125
133
|
add_suffix: _attributes
|
126
134
|
- name: options_from_collection_for_select
|
127
135
|
calls:
|
128
|
-
- arguments: [2
|
136
|
+
- arguments: [1,2]
|
129
137
|
- name:
|
130
138
|
- collection_select
|
131
139
|
- collection_check_boxes
|
132
140
|
- collection_radio_buttons
|
133
141
|
calls:
|
134
|
-
- argument:
|
142
|
+
- argument: 1
|
135
143
|
add_suffix: '='
|
136
|
-
- arguments: [4
|
144
|
+
- arguments: [3,4]
|
137
145
|
- name: grouped_collection_select
|
138
146
|
calls:
|
139
|
-
- argument:
|
147
|
+
- argument: 1
|
140
148
|
add_suffix: '='
|
141
|
-
- arguments: [4,5,6
|
149
|
+
- arguments: [3,4,5,6]
|
142
150
|
- name: option_groups_from_collection_for_select
|
143
151
|
calls:
|
144
|
-
- arguments: [1,2,3
|
152
|
+
- arguments: [0,1,2,3]
|
145
153
|
- name: scope
|
146
154
|
path: /app/models
|
147
155
|
defines:
|
148
|
-
argument:
|
156
|
+
argument: 0 # ar
|
149
157
|
- name: scope
|
150
158
|
path: /config/routes*
|
151
159
|
calls:
|
152
160
|
argument: module # routes
|
153
161
|
camelize: true
|
162
|
+
split: '::'
|
154
163
|
- name: namespace
|
155
164
|
calls:
|
156
|
-
- argument:
|
165
|
+
- argument: 0
|
157
166
|
camelize: true
|
167
|
+
split: '::'
|
158
168
|
- name:
|
159
169
|
- attribute
|
160
170
|
- alias_attribute
|
161
171
|
path: app/models/*
|
162
172
|
defines:
|
163
|
-
argument:
|
164
|
-
|
173
|
+
argument: 0
|
174
|
+
transforms:
|
165
175
|
- original
|
166
176
|
- add_suffix: '?'
|
167
177
|
- add_suffix: '='
|
168
178
|
- name: alias_attribute
|
169
179
|
calls:
|
170
|
-
- argument:
|
171
|
-
- argument:
|
180
|
+
- argument: 1
|
181
|
+
- argument: 1
|
172
182
|
add_suffix: '?'
|
173
|
-
- argument:
|
183
|
+
- argument: 1
|
174
184
|
add_suffix: '='
|
175
185
|
- name:
|
176
186
|
- has_one
|
177
187
|
- belongs_to
|
188
|
+
unless:
|
189
|
+
has_argument: class_name
|
178
190
|
calls:
|
179
|
-
argument:
|
191
|
+
argument: 0
|
180
192
|
camelize: true
|
181
|
-
|
182
|
-
|
193
|
+
split: '::'
|
194
|
+
|
183
195
|
- name:
|
184
196
|
- has_many
|
185
197
|
- has_and_belongs_to_many
|
198
|
+
unless:
|
199
|
+
has_argument: class_name
|
186
200
|
calls:
|
187
|
-
argument:
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
201
|
+
- argument: 0
|
202
|
+
camelize: true
|
203
|
+
singularize: true
|
204
|
+
split: '::'
|
205
|
+
- name:
|
206
|
+
- has_many
|
207
|
+
- has_and_belongs_to_many
|
208
|
+
defines:
|
209
|
+
- argument: 0
|
210
|
+
transforms:
|
211
|
+
- original
|
212
|
+
- add_suffix: '='
|
213
|
+
- singularize: true
|
214
|
+
add_suffix: _ids
|
215
|
+
- singularize: true
|
216
|
+
add_suffix: _ids=
|
192
217
|
- name:
|
193
218
|
- has_many
|
194
219
|
- has_one
|
195
220
|
- has_and_belongs_to_many
|
196
221
|
calls:
|
197
|
-
argument:
|
222
|
+
argument:
|
223
|
+
- as
|
224
|
+
- name:
|
225
|
+
- has_one
|
226
|
+
- has_many
|
227
|
+
calls:
|
228
|
+
- argument:
|
229
|
+
- source_type
|
230
|
+
- source
|
231
|
+
- through
|
198
232
|
- name:
|
199
233
|
- has_one
|
200
|
-
- has_many
|
201
234
|
- belongs_to
|
202
|
-
- has_and_belongs_to_many
|
203
235
|
defines:
|
204
|
-
- argument:
|
205
|
-
|
236
|
+
- argument: 0
|
237
|
+
transforms:
|
206
238
|
- original
|
207
239
|
- add_suffix: '='
|
240
|
+
- add_prefix: build_
|
241
|
+
- add_prefix: create_
|
242
|
+
- add_prefix: create_
|
243
|
+
add_suffix: '!'
|
244
|
+
- add_prefix: reload
|
245
|
+
- name: belongs_to
|
246
|
+
unless:
|
247
|
+
has_argument:
|
248
|
+
at: optional
|
249
|
+
has_value: true
|
250
|
+
calls:
|
251
|
+
argument: 0
|
252
|
+
|
253
|
+
- name:
|
254
|
+
- has_one
|
255
|
+
- has_many
|
256
|
+
- belongs_to
|
257
|
+
- has_and_belongs_to_many
|
258
|
+
calls:
|
259
|
+
- argument: class_name
|
260
|
+
split: '::'
|
261
|
+
- argument: inverse_of
|
262
|
+
- argument: touch
|
263
|
+
add_suffix: '='
|
264
|
+
- name:
|
265
|
+
- has_one
|
266
|
+
- has_many
|
267
|
+
- belongs_to
|
268
|
+
- has_and_belongs_to_many
|
269
|
+
has_argument:
|
270
|
+
at: [dependent, inverse_of, touch, validate]
|
271
|
+
unless:
|
272
|
+
has_value: false
|
208
273
|
calls:
|
209
|
-
|
210
|
-
|
211
|
-
- class_name
|
212
|
-
- inverse_of
|
213
|
-
- argument: 1
|
214
|
-
if:
|
215
|
-
has_argument: dependent
|
216
|
-
- argument: 1
|
217
|
-
if:
|
218
|
-
has_argument: inverse_of
|
274
|
+
argument: 0
|
275
|
+
|
219
276
|
- name:
|
220
277
|
- rescue_from
|
221
278
|
calls:
|
@@ -227,38 +284,49 @@ rules:
|
|
227
284
|
- patch
|
228
285
|
- post
|
229
286
|
- put
|
287
|
+
- root
|
230
288
|
calls:
|
231
|
-
- arguments: [
|
289
|
+
- arguments: [0, action]
|
232
290
|
- argument: '**'
|
233
291
|
delete_before: '#'
|
234
292
|
- argument: '**'
|
235
293
|
delete_after: '#'
|
236
294
|
camelize: true
|
237
295
|
add_suffix: Controller
|
296
|
+
split: '::'
|
238
297
|
- name: delegate
|
298
|
+
has_argument:
|
299
|
+
at: prefix
|
300
|
+
has_value: true
|
239
301
|
defines:
|
240
302
|
- argument: '*'
|
241
|
-
if:
|
242
|
-
has_argument:
|
243
|
-
keyword: prefix
|
244
|
-
value: true
|
245
303
|
add_prefix:
|
246
|
-
|
247
|
-
|
304
|
+
argument: to
|
305
|
+
add_suffix: '_'
|
306
|
+
calls:
|
307
|
+
- argument: to
|
308
|
+
- argument: '*'
|
309
|
+
- name: delegate
|
310
|
+
has_argument:
|
311
|
+
at: prefix
|
312
|
+
has_value_type: [String, Symbol]
|
313
|
+
defines:
|
248
314
|
- argument: '*'
|
249
|
-
if:
|
250
|
-
has_argument:
|
251
|
-
keyword: prefix
|
252
|
-
value:
|
253
|
-
type: [String, Symbol]
|
254
315
|
add_prefix:
|
255
|
-
|
256
|
-
|
316
|
+
argument: prefix
|
317
|
+
add_suffix: '_'
|
257
318
|
calls:
|
258
319
|
- argument: to
|
259
320
|
- argument: '*'
|
260
|
-
|
261
|
-
|
321
|
+
- name: delegate
|
322
|
+
unless:
|
323
|
+
has_argument:
|
324
|
+
- at: prefix
|
325
|
+
has_value: true
|
326
|
+
- at: prefix
|
327
|
+
has_value_type: [String, Symbol]
|
328
|
+
calls:
|
329
|
+
- argument: to
|
262
330
|
- name:
|
263
331
|
- resource
|
264
332
|
- resources
|
@@ -267,28 +335,31 @@ rules:
|
|
267
335
|
- argument: controller
|
268
336
|
camelize: true
|
269
337
|
add_suffix: Controller
|
338
|
+
split: '::'
|
270
339
|
- name:
|
271
340
|
- resources
|
272
341
|
- controller
|
273
342
|
- namespace
|
274
343
|
calls:
|
275
|
-
- argument:
|
344
|
+
- argument: 0
|
276
345
|
camelize: true
|
277
346
|
add_suffix: Controller
|
347
|
+
split: '::'
|
278
348
|
- name: accepts_nested_attributes_for
|
279
349
|
defines:
|
280
350
|
argument: '*'
|
281
|
-
|
351
|
+
transforms:
|
282
352
|
- add_suffix: _attributes
|
283
353
|
- add_suffix: _attributes=
|
284
354
|
calls:
|
285
355
|
argument: reject_if
|
286
356
|
- name: resource
|
287
357
|
calls:
|
288
|
-
- argument:
|
358
|
+
- argument: 0
|
289
359
|
camelize: true
|
290
360
|
pluralize: true
|
291
361
|
add_suffix: Controller
|
362
|
+
split: '::'
|
292
363
|
- name:
|
293
364
|
- new
|
294
365
|
- create
|
@@ -297,16 +368,17 @@ rules:
|
|
297
368
|
- update!
|
298
369
|
- assign_attributes
|
299
370
|
calls:
|
300
|
-
|
371
|
+
keyword: '**'
|
301
372
|
add_suffix: '='
|
302
373
|
- name: permit
|
303
374
|
calls:
|
304
375
|
arguments: ['*', '**']
|
305
|
-
|
376
|
+
keywords: '**'
|
306
377
|
add_suffix: "="
|
378
|
+
recursive: true
|
307
379
|
- name: layout
|
308
380
|
calls:
|
309
|
-
argument:
|
381
|
+
argument: 0
|
310
382
|
- name:
|
311
383
|
- includes
|
312
384
|
- preload
|
@@ -316,7 +388,7 @@ rules:
|
|
316
388
|
- left_outer_joins
|
317
389
|
calls:
|
318
390
|
arguments: ['*', '**']
|
319
|
-
|
391
|
+
keywords: '**'
|
320
392
|
- name:
|
321
393
|
- string
|
322
394
|
- text
|
@@ -332,7 +404,7 @@ rules:
|
|
332
404
|
- boolean
|
333
405
|
path: /db/schema.rb
|
334
406
|
calls:
|
335
|
-
argument:
|
407
|
+
argument: 0
|
336
408
|
transforms:
|
337
409
|
- original
|
338
410
|
- add_suffix: '='
|
@@ -342,9 +414,8 @@ rules:
|
|
342
414
|
- mattr_accessor
|
343
415
|
defines:
|
344
416
|
- argument: '*'
|
345
|
-
|
346
|
-
|
347
|
-
- add_suffix: '='
|
417
|
+
- argument: '*'
|
418
|
+
add_suffix: '='
|
348
419
|
calls:
|
349
420
|
- argument: '*'
|
350
421
|
add_prefix: '@'
|
@@ -367,10 +438,9 @@ rules:
|
|
367
438
|
- thread_cattr_accessor
|
368
439
|
- thread_mattr_accessor
|
369
440
|
defines:
|
370
|
-
argument: '*'
|
371
|
-
|
372
|
-
|
373
|
-
- add_suffix: '='
|
441
|
+
- argument: '*'
|
442
|
+
- argument: '*'
|
443
|
+
add_suffix: '='
|
374
444
|
- name:
|
375
445
|
- thread_cattr_reader
|
376
446
|
- thread_mattr_reader
|
@@ -384,4 +454,4 @@ rules:
|
|
384
454
|
add_suffix: '='
|
385
455
|
- name: delegate_missing_to
|
386
456
|
calls:
|
387
|
-
argument:
|
457
|
+
argument: 0
|