We use the same monolithic code for two different contexts based on an environment variable.
For example, each class is as follows, where global variable context is assigned "A"
or "B"
based on an environment variable at initialization:
class Demo
class << self
def demo_method(xy, z)
if context == "A"
p "from app A"
else
p "from app B"
end
end
end
end
I want a tool that splits the whole code based on the variable, and generates two different code bases:
From our example, app A code will look like:
class Demo
class << self
def demo_method(xy, z)
p "from app A"
end
end
end
and app B code will look like:
class Demo
class << self
def demo_method(xy, z)
p "from app B"
end
end
end