Class: ConjureShield::Analyzer
- Inherits:
-
Object
- Object
- ConjureShield::Analyzer
- Defined in:
- lib/conjure_shield/analyzer.rb
Constant Summary collapse
- RESTFUL_ACTIONS =
%i[index show new create edit update destroy].freeze
- SINGULAR_ACTIONS =
%i[show new create edit update destroy].freeze
- ACTION_ROUTE_MAP =
{ index: [:get_index, :index_pagination, :index_sorting], show: [:get_show, :show_with_associations], new: [:get_new, :new_form], create: [:post_create, :post_create_valid, :post_create_invalid, :post_create_redirect], edit: [:get_edit, :edit_form], update: [:put_patch_update_valid, :put_patch_update_invalid, :put_patch_update_redirect], destroy: [:delete_destroy, :delete_destroy_redirect] }.freeze
Instance Attribute Summary collapse
-
#ast_nodes ⇒ Object
readonly
Returns the value of attribute ast_nodes.
-
#codebase_path ⇒ Object
readonly
Returns the value of attribute codebase_path.
-
#devise_model ⇒ Object
readonly
Returns the value of attribute devise_model.
-
#existing_tests ⇒ Object
readonly
Returns the value of attribute existing_tests.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#missing_tests ⇒ Object
readonly
Returns the value of attribute missing_tests.
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
-
#routes_parsed ⇒ Object
readonly
Returns the value of attribute routes_parsed.
Instance Method Summary collapse
- #analyze ⇒ Object
-
#initialize(path) ⇒ Analyzer
constructor
A new instance of Analyzer.
Constructor Details
#initialize(path) ⇒ Analyzer
Returns a new instance of Analyzer.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/conjure_shield/analyzer.rb', line 24 def initialize(path) @codebase_path = File.(path) @ast_nodes = [] @missing_tests = [] @existing_tests = [] @files = [] @routes = {} @routes_parsed = false @devise_model = nil end |
Instance Attribute Details
#ast_nodes ⇒ Object (readonly)
Returns the value of attribute ast_nodes.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def ast_nodes @ast_nodes end |
#codebase_path ⇒ Object (readonly)
Returns the value of attribute codebase_path.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def codebase_path @codebase_path end |
#devise_model ⇒ Object (readonly)
Returns the value of attribute devise_model.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def devise_model @devise_model end |
#existing_tests ⇒ Object (readonly)
Returns the value of attribute existing_tests.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def existing_tests @existing_tests end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def files @files end |
#missing_tests ⇒ Object (readonly)
Returns the value of attribute missing_tests.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def missing_tests @missing_tests end |
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def routes @routes end |
#routes_parsed ⇒ Object (readonly)
Returns the value of attribute routes_parsed.
22 23 24 |
# File 'lib/conjure_shield/analyzer.rb', line 22 def routes_parsed @routes_parsed end |
Instance Method Details
#analyze ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/conjure_shield/analyzer.rb', line 35 def analyze scan_ruby_files scan_existing_tests analyze_ast parse_routes detect_missing_tests self end |