How to parse and import ASTs:
GtRubyImporter new parseDirectory: '/home/brant/Downloads/'
How to generate classes:
GtRubyImporter new buildClassesFromDirectory: '/home/brant/Downloads/'
License: MIT License
Trying to analyze a Rails codebase following the example in the Lepiter notebook that comes with Glamorous.
Error happens sending #createActiveRecordLinksAndAttributes
to the imported model.
The code that causes the error is as follows:
rootDirectory := 'example' asFileReference ensureDeleteAll.
repository := IceRepositoryCreator new
remote: (IceGitRemote url: '[email protected]:example/example.git');
location: rootDirectory;
createRepository.
rootDirectory
rootDirectory := 'example' asFileReference.
importer := GtSmaCCRubyImporter new.
model := importer
importASTs: (importer parseDirectory: rootDirectory).
model createForeignKeys.
model createActiveRecordLinksAndAttributes.
Backtrace:
GtRubyModule(Object)>>doesNotUnderstand: #superInheritances
FMMultivalueLink class>>on:update:from:to:
FAMIXInheritance>>subclass:
[ :each |
each rubyActiveRecordClass isNil
ifTrue: [ | rubyClassName class inheritance |
rubyClassName := self
rubyClassNameFrom: each name
removePluralization: true.
class := self ensureClassNamed: rubyClassName.
inheritance := FAMIXInheritance new
superclass: self ensureActiveRecordBaseClass;
subclass: class.
class isStub: true.
mooseModel add: inheritance.
each rubyActiveRecordClass: class.
self createActiveRecordLinkBetweenClass: class andTable: each ] ] in GtSmaCCRubyImporter(GtRubyImporter)>>createStubClassesFromTables in Block: [ :each | ...
Dictionary>>valuesDo:
Dictionary>>do:
GtSmaCCRubyImporter(GtRubyImporter)>>createStubClassesFromTables
UndefinedObject(a subclass of UndefinedObject)>>DoIt
GtPharoSnippetCoder(GtPharoSourceCoder)>>primitiveEvaluate:inContext:onFailDo:
[
self
primitiveEvaluate: aDecoratedSourceString
inContext: aSourceCoderEvaluationContext
onFailDo: [
| aResultWithSyntaxError |
aResultWithSyntaxError := GtSourceCoderEvaluationResultWithSyntaxError new
evaluationContext: aSourceCoderEvaluationContext.
aThenBlock cull: aResultWithSyntaxError.
^ aResultWithSyntaxError ] ] in GtPharoSnippetCoder(GtSourceCoder)>>evaluate:decorated:inContext:thenDo: in Block: [ ...
FullBlockClosure(BlockClosure)>>on:do:
GtPharoSnippetCoder(GtSourceCoder)>>evaluateBlock:onErrorDo:
GtPharoSnippetCoder(GtSourceCoder)>>evaluate:decorated:inContext:thenDo:
GtPharoSnippetCoder(GtSourceCoder)>>evaluate:inContext:thenDo:
GtPharoSnippetCoder(GtSourceCoder)>>doItAndGoInContext:
GtPharoSnippetCoderViewModel(GtSourceCoderViewModel)>>doItAndGoAll
GtPharoSnippetCoderViewModel(GtSourceCoderViewModel)>>doItAndGo
[ self coderViewModel perform: action ] in GtCoderCodeExecutor>>execute in Block: [ self coderViewModel perform: action ]
[ activeProcess
psValueAt: index
put: anObject.
aBlock value ] in GtCoderExecutionContextVariable(DynamicVariable)>>value:during: in Block: [ activeProcess...
FullBlockClosure(BlockClosure)>>ensure:
GtCoderExecutionContextVariable(DynamicVariable)>>value:during:
GtCoderExecutionContextVariable class(DynamicVariable class)>>value:during:
GtCoderExecutionContextVariable class>>element:do:
GtCoderCodeExecutor>>execute
[ :aCoderUIModel :anElement |
GtCoderCodeExecutor doItAndGo
coderViewModel: aCoderUIModel;
element: anElement;
execute ] in GtPharoSnippetCoder>>initializeAddOns: in Block: [ :aCoderUIModel :anElement | ...
FullBlockClosure(BlockClosure)>>valueWithPossibleArgs:
FullBlockClosure(BlockClosure)>>glamourValueWithArgs:
[ aGtCoderAction action
glamourValueWithArgs:
{self textualCoderViewModel.
aButtonElement} ] in [ [ aGtCoderAction action
glamourValueWithArgs:
{self textualCoderViewModel.
aButtonElement} ]
ensure: [ self enqueueEnableButton: aButtonElement action: aGtCoderAction ] ] in [ aButtonElement
enqueueTask:
(BlTaskAction new
action: [ [ aGtCoderAction action
glamourValueWithArgs:
{self textualCoderViewModel.
aButtonElement} ]
ensure: [ self enqueueEnableButton: aButtonElement action: aGtCoderAction ] ]) ] in GtCoderActionsElement>>handleButton:action:onEvent: in Block: [ aGtCoderAction action...
FullBlockClosure(BlockClosure)>>ensure:
[ [ aGtCoderAction action
glamourValueWithArgs:
{self textualCoderViewModel.
aButtonElement} ]
ensure: [ self enqueueEnableButton: aButtonElement action: aGtCoderAction ] ] in [ aButtonElement
enqueueTask:
(BlTaskAction new
action: [ [ aGtCoderAction action
glamourValueWithArgs:
{self textualCoderViewModel.
aButtonElement} ]
ensure: [ self enqueueEnableButton: aButtonElement action: aGtCoderAction ] ]) ] in GtCoderActionsElement>>handleButton:action:onEvent: in Block: [ [ aGtCoderAction action...
FullBlockClosure(BlockClosure)>>cull:
BlTaskAction>>run
[ aTask run ] in [ BlTaskExecutionSignal for: aTask block: [ aTask run ] ] in [ :aTask |
aTask setExecuting.
BlFrameTelemetry
timeSync: [ 'Run task {1} ({2})' format: { aTask class name . aTask } ]
during: [ BlTaskExecutionSignal for: aTask block: [ aTask run ] ].
self onTaskExecuted: aTask.
aTask requeueTaskAfterExecution ifTrue:
[ self requeue: aTask ]
ifFalse:
[ aTask setComplete ] ] in BlSpaceTaskQueue(BlTaskQueue)>>runOn: in Block: [ aTask run ]
BlTaskExecutionSignal class>>for:block:
[ BlTaskExecutionSignal for: aTask block: [ aTask run ] ] in [ :aTask |
aTask setExecuting.
BlFrameTelemetry
timeSync: [ 'Run task {1} ({2})' format: { aTask class name . aTask } ]
during: [ BlTaskExecutionSignal for: aTask block: [ aTask run ] ].
self onTaskExecuted: aTask.
aTask requeueTaskAfterExecution ifTrue:
[ self requeue: aTask ]
ifFalse:
[ aTask setComplete ] ] in BlSpaceTaskQueue(BlTaskQueue)>>runOn: in Block: [ BlTaskExecutionSignal for: aTask block: [ aTask ...etc...
NullTelemetry>>time:during:
BlSpaceTelemetry>>time:during:
BlFrameTelemetry(BaseProcessTelemetry)>>time:during:
BlFrameTelemetry(BaseProcessTelemetry)>>timeSync:during:
BlFrameTelemetry class(BaseProcessTelemetry class)>>timeSync:during:
[ :aTask |
aTask setExecuting.
BlFrameTelemetry
timeSync: [ 'Run task {1} ({2})' format: { aTask class name . aTask } ]
during: [ BlTaskExecutionSignal for: aTask block: [ aTask run ] ].
self onTaskExecuted: aTask.
aTask requeueTaskAfterExecution ifTrue:
[ self requeue: aTask ]
ifFalse:
[ aTask setComplete ] ] in BlSpaceTaskQueue(BlTaskQueue)>>runOn: in Block: [ :aTask |...
OrderedCollection>>do:
BlSpaceTaskQueue(BlTaskQueue)>>runOn:
GtWorld(BlSpace)>>runTasks
[ :theSpace | theSpace runTasks ] in BlSpaceFrameTaskPhase>>runOn: in Block: [ :theSpace | theSpace runTasks ]
FullBlockClosure(BlockClosure)>>cull:
GtWorld(BlSpace)>>dispatchTimeEvent:during:
BlSpaceFrameTaskPhase>>runOn:
[ self currentPhase runOn: aSpace ] in BlSpaceFrame>>runCurrentPhaseOn: in Block: [ self currentPhase runOn: aSpace ]
NullTelemetry>>time:during:
BlSpaceTelemetry>>time:during:
BlFrameTelemetry(BaseProcessTelemetry)>>time:during:
BlFrameTelemetry class(BaseProcessTelemetry class)>>time:during:
BlSpaceFrame>>runCurrentPhaseOn:
BlSpaceFrame>>runOn:
[ self frame runOn: self ] in [
BlFrameTelemetry
reset;
time: [ 'Frame' ]
during: [ self frame runOn: self ];
emit ] in BlSpace>>processPulse in Block: [ self frame runOn: self ]
NullTelemetry>>time:during:
BlSpaceTelemetry>>time:during:
BlFrameTelemetry(BaseProcessTelemetry)>>time:during:
BlFrameTelemetry class(BaseProcessTelemetry class)>>time:during:
[
BlFrameTelemetry
reset;
time: [ 'Frame' ]
during: [ self frame runOn: self ];
emit ] in BlSpace>>processPulse in Block: [ ...
FullBlockClosure(BlockClosure)>>ensure:
BlFrameTelemetry class>>withSpace:andTelemetry:do:
GtWorld(BlSpace)>>processPulse
GtWorld(BlSpace)>>pulse
[ :eachSpace | eachSpace pulse ] in BlParallelUniverse>>pulseSynchronously in Block: [ :eachSpace | eachSpace pulse ]
Array(SequenceableCollection)>>do:
BlSpaceManager>>do:
[
self tryToRunDeferredActions.
spaceManager do: [ :eachSpace | eachSpace pulse ]
] in BlParallelUniverse>>pulseSynchronously in Block: [...
FullBlockClosure(BlockClosure)>>ensure:
BlParallelUniverse>>pulseSynchronously
[
self pulseSynchronously
] in BlParallelUniverse>>pulse in Block: [...
FullBlockClosure(BlockClosure)>>ensure:
BlParallelUniverse>>pulse
BlHostPulseLoop>>firePulse
[ [ self firePulse.
loopProcess == Processor activeProcess ] whileTrue ] in BlHostPulseLoop>>createLoopTask in Block: [ [ self firePulse....
[self value.
Processor terminateActive] in FullBlockClosure(BlockClosure)>>newProcess in Block: [self value....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.