P
Pito Salas
I am looking for best practices for using a multi-file body of ruby code
within a different multi-file body of ruby code.
In other words, let's say I have this:
system/
stand_alone_sub.rb
lib/
sub_alpha.rb
sub_bravo.rb
System is a nice program which runs by invoking stand_alone_sub.rb. Ah,
but now I have a new application:
newapplication/
na.rb
lib/
na_charlie.rb
na_delta.rb
And in na_delta I want to use the functionalities from 'system' above.
I have a few choices, I guess:
1) make system/ into a gem. I don't love this because it implies to me
that it's a general purpose service, and maybe it is, but off the cuff
it feels like overkill.
2) combine system/ and newapplication/ into one application. I don't
like this because they are separate and while one depends on the other,
the first is useful on its own.
3) copy the files from system/ into a subdirectory under newapplication.
And keep the files in sync. I don't like this because of many reasons.
4) Somehow be clever with the search paths when invoking system/ from
newapplicaiton/ I don't like this because I am not sure how to do it and
I fear it will not be robust
5) What else?
Any comments?
Thanks!
Pito
within a different multi-file body of ruby code.
In other words, let's say I have this:
system/
stand_alone_sub.rb
lib/
sub_alpha.rb
sub_bravo.rb
System is a nice program which runs by invoking stand_alone_sub.rb. Ah,
but now I have a new application:
newapplication/
na.rb
lib/
na_charlie.rb
na_delta.rb
And in na_delta I want to use the functionalities from 'system' above.
I have a few choices, I guess:
1) make system/ into a gem. I don't love this because it implies to me
that it's a general purpose service, and maybe it is, but off the cuff
it feels like overkill.
2) combine system/ and newapplication/ into one application. I don't
like this because they are separate and while one depends on the other,
the first is useful on its own.
3) copy the files from system/ into a subdirectory under newapplication.
And keep the files in sync. I don't like this because of many reasons.
4) Somehow be clever with the search paths when invoking system/ from
newapplicaiton/ I don't like this because I am not sure how to do it and
I fear it will not be robust
5) What else?
Any comments?
Thanks!
Pito