Class: Necropsy::SemanticsMatrix
- Inherits:
-
Object
- Object
- Necropsy::SemanticsMatrix
- Defined in:
- lib/necropsy/semantics_matrix.rb
Constant Summary collapse
- SCHEMA_VERSION =
'necropsy.semantics.v1'- STATUSES =
%w[exact partial blocked unsupported].freeze
- EXACT_PRISM_NODES =
%i[ AliasMethodNode ArgumentsNode ArrayNode AssocNode BeginNode BlockArgumentNode BlockLocalVariableNode BlockParameterNode BlockParametersNode ClassNode ConstantPathNode ConstantReadNode ConstantTargetNode DefNode FalseNode FloatNode ForwardingArgumentsNode ForwardingParameterNode HashNode ImaginaryNode ImplicitNode ImplicitRestNode IntegerNode ItLocalVariableReadNode ItParametersNode KeywordHashNode KeywordRestParameterNode LocalVariableReadNode LocalVariableTargetNode ModuleNode NilNode NoKeywordsParameterNode NumberedParametersNode NumberedReferenceReadNode OptionalKeywordParameterNode OptionalParameterNode ParametersNode ParenthesesNode RationalNode RegularExpressionNode RequiredKeywordParameterNode RequiredParameterNode RestParameterNode SelfNode SourceEncodingNode SourceFileNode SourceLineNode StatementsNode StringNode SymbolNode TrueNode ].to_set.freeze
- PARTIAL_PRISM_NODES =
%i[ AliasGlobalVariableNode AlternationPatternNode AndNode ArrayPatternNode AssocSplatNode BackReferenceReadNode BlockNode BreakNode CallAndWriteNode CallNode CallOperatorWriteNode CallOrWriteNode CallTargetNode CapturePatternNode CaseMatchNode CaseNode ClassVariableAndWriteNode ClassVariableOperatorWriteNode ClassVariableOrWriteNode ClassVariableReadNode ClassVariableTargetNode ClassVariableWriteNode ConstantAndWriteNode ConstantOperatorWriteNode ConstantOrWriteNode ConstantPathAndWriteNode ConstantPathOperatorWriteNode ConstantPathOrWriteNode ConstantPathTargetNode ConstantPathWriteNode ConstantWriteNode DefinedNode ElseNode EmbeddedStatementsNode EmbeddedVariableNode EnsureNode FindPatternNode FlipFlopNode ForNode ForwardingSuperNode GlobalVariableAndWriteNode GlobalVariableOperatorWriteNode GlobalVariableOrWriteNode GlobalVariableReadNode GlobalVariableTargetNode GlobalVariableWriteNode HashPatternNode IfNode InNode IndexAndWriteNode IndexOperatorWriteNode IndexOrWriteNode IndexTargetNode InstanceVariableAndWriteNode InstanceVariableOperatorWriteNode InstanceVariableOrWriteNode InstanceVariableReadNode InstanceVariableTargetNode InstanceVariableWriteNode InterpolatedMatchLastLineNode InterpolatedRegularExpressionNode InterpolatedStringNode InterpolatedSymbolNode InterpolatedXStringNode LambdaNode LocalVariableAndWriteNode LocalVariableOperatorWriteNode LocalVariableOrWriteNode LocalVariableWriteNode MatchLastLineNode MatchPredicateNode MatchRequiredNode MatchWriteNode MultiTargetNode MultiWriteNode NextNode OrNode PinnedExpressionNode PinnedVariableNode PostExecutionNode PreExecutionNode ProgramNode RangeNode RedoNode RescueModifierNode RescueNode RetryNode ReturnNode ShareableConstantNode SingletonClassNode SplatNode SuperNode UndefNode UnlessNode UntilNode WhenNode WhileNode XStringNode YieldNode ].to_set.freeze
- BLOCKED_PRISM_NODES =
%i[MissingNode].to_set.freeze
- RUBY_HOOK_STATUS =
{ 'inherited' => 'partial', 'included' => 'partial', 'extended' => 'partial', 'prepended' => 'partial', 'method_added' => 'partial', 'singleton_method_added' => 'partial', 'const_missing' => 'partial', 'method_missing' => 'partial', 'respond_to_missing?' => 'partial' }.freeze
Instance Method Summary collapse
Instance Method Details
#render(format: :human) ⇒ Object
70 71 72 73 74 75 76 77 |
# File 'lib/necropsy/semantics_matrix.rb', line 70 def render(format: :human) case format.to_sym when :json then JSON.pretty_generate(to_h) when :yaml then YAML.dump(to_h) when :human then render_human else raise Error, "semantics supports human, json, or yaml output (got #{format})" end end |
#to_h ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/necropsy/semantics_matrix.rb', line 59 def to_h { 'schema_version' => SCHEMA_VERSION, 'runtime' => { 'ruby' => RUBY_VERSION, 'prism' => Prism::VERSION }, 'statuses' => STATUSES, 'prism_nodes' => prism_nodes, 'ruby_hooks' => ruby_hooks, 'rails_dsl' => rails_dsl } end |