Module: Gelauto

Defined in:
lib/gelauto.rb,
lib/gelauto/rbi.rb,
lib/gelauto/var.rb,
lib/gelauto/type.rb,
lib/gelauto/utils.rb,
lib/gelauto/logger.rb,
lib/gelauto/version.rb,
lib/gelauto/arg_list.rb,
lib/gelauto/type_set.rb,
lib/gelauto/cli_utils.rb,
lib/gelauto/hash_type.rb,
lib/gelauto/namespace.rb,
lib/gelauto/array_type.rb,
lib/gelauto/method_def.rb,
lib/gelauto/null_logger.rb,
lib/gelauto/boolean_type.rb,
lib/gelauto/generic_type.rb,
lib/gelauto/method_index.rb

Defined Under Namespace

Modules: CLIUtils, Logger, Utils Classes: ArgList, ArrayType, BooleanType, GenericType, HashType, MethodDef, MethodIndex, Namespace, NullLogger, Rbi, Type, TypeSet, Var

Constant Summary collapse

VERSION =
'2.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject



71
72
73
# File 'lib/gelauto.rb', line 71

def logger
  @logger ||= ::Logger.new(STDERR)
end

.pathsObject

Returns the value of attribute paths.



23
24
25
# File 'lib/gelauto.rb', line 23

def paths
  @paths
end

Class Method Details

.annotate_file(path) ⇒ Object



66
67
68
69
# File 'lib/gelauto.rb', line 66

def annotate_file(path)
  annotated_code = Gelauto.method_index.annotate(path, File.read(path))
  File.write(path, annotated_code)
end

.discoverObject



35
36
37
38
39
40
# File 'lib/gelauto.rb', line 35

def discover
  setup
  yield
ensure
  teardown
end

.each_absolute_path(&block) ⇒ Object



50
51
52
# File 'lib/gelauto.rb', line 50

def each_absolute_path(&block)
  Utils.each_absolute_path(paths, &block)
end

.introspect(obj) ⇒ Object



62
63
64
# File 'lib/gelauto.rb', line 62

def introspect(obj)
  Gelauto.types[obj.class].introspect(obj)
end

.method_indexObject



42
43
44
# File 'lib/gelauto.rb', line 42

def method_index
  @method_index ||= MethodIndex.new
end

.register_type(type, handler) ⇒ Object



54
55
56
# File 'lib/gelauto.rb', line 54

def register_type(type, handler)
  types[type] = handler
end

.setupObject



26
27
28
29
# File 'lib/gelauto.rb', line 26

def setup
  enable_traces
  index_methods
end

.teardownObject



31
32
33
# File 'lib/gelauto.rb', line 31

def teardown
  disable_traces
end

.typesObject



58
59
60
# File 'lib/gelauto.rb', line 58

def types
  @types ||= Hash.new(Gelauto::Type)
end