lib/pelusa/lint/collection_wrappers.rb in pelusa-0.2.3 vs lib/pelusa/lint/collection_wrappers.rb in pelusa-0.2.4
- old
+ new
@@ -26,26 +26,26 @@
array_assignments = {}
# the name of all the assigned arrays, no others allowed
array_values = {}
ClassAnalyzer.walk(klass) do |node|
- if node.is_a?(Rubinius::AST::InstanceVariableAssignment) &&
- (node.value.is_a?(Rubinius::AST::ArrayLiteral) ||
- node.value.is_a?(Rubinius::AST::EmptyArray))
+ if node.is_a?(Rubinius::ToolSets::Runtime::ToolSet::AST::InstanceVariableAssignment) &&
+ (node.value.is_a?(Rubinius::ToolSets::Runtime::ToolSet::AST::ArrayLiteral) ||
+ node.value.is_a?(Rubinius::ToolSets::Runtime::ToolSet::AST::EmptyArray))
array_assignments[node] = true
array_values[node.name] = true
end
end
unless array_assignments.empty?
ClassAnalyzer.walk(klass) do |node|
# if this is where we assign the node for the first time, good
unless array_assignments[node]
# otherwise, if it's an instance variable assignment, verboten!
- if node.is_a?(Rubinius::AST::InstanceVariableAssignment)
+ if node.is_a?(Rubinius::ToolSets::Runtime::ToolSet::AST::InstanceVariableAssignment)
@violations << node.line
# or if we access any other ivars
- elsif node.is_a?(Rubinius::AST::InstanceVariableAccess) &&
+ elsif node.is_a?(Rubinius::ToolSets::Runtime::ToolSet::AST::InstanceVariableAccess) &&
!array_values[node.name]
@violations << node.line
end
end
end