Usign ruby to update local Linux environment variable

I answered you before with the same suggestion as Magnus - here

I specified two pipelines to keep the two processing paths clean and separate. LS 6.x can use multiple pipelines in the same LS instance.

Get two pipelines working first, then two can converge them into one by using if conditional blocks to separate the specific flows.