How to hide parts of Ruby source code

Hi,

How can I hide parts of Ruby source code from another programmer
working on the same project? I plan to outsource development of parts
of my RoR web site to an overseas programmer. For example, I would
like him to work on only certain views, controllers or models, or
certain features such as the ability to login using a Facebook
account. I don't want him to have all the source code of the web site
because I don't want him to be able to clone the entire site easily
and operate it overseas. I am in the U.S. I am afraid that a non-
disclosure or non-compete agreement with him will be difficult and
expensive to enforce outside the U.S. under a developing country's
legal system.

Ideally, I would like my overseas programmer to be able to check in
his code into Github and test his code against the whole web site
while not being able to see the source code of other parts of the web
site.

Thanks.

Vincent.

If you’re using git and github, I believe adding files/directories to your .gitignore file should do what you want. It would hide a part of a file, however, but the entire file itself.

Thanks,
Culley

Hi,
How can I hide parts of Ruby source code from another programmer
working on the same project?

Ideally, don't. It's a lousy way of working. Understand the business drivers, but it's hard enough to work with developers that you trust.

That said, if you really have to, consider a web services based application. You write back end web services but just provide developer with stubs they can call for doing the UI. Or create separate silo'd apps for different parts of the problem domain and only outsource the commodity ones.

You could also ask the offshore dev to write a gem, writing them some automated functional tests it needs to pass so you can both agree on "done".

You could also write gems and get the dev to write the app around them. Then you just need to create a "stub" version of the gem that just responds in a static manner to calls so you're hiding your business logic but providing something they can use to test the interface.

You could also get them to create a project and then you could just pull elements from it and integrate them into your *real* project.

Understand that any of these approaches will have an overhead on your side - I'd suggest re-evaluating working with someone you don't trust as the overhead and verification may be greater than just working with someone you *can* trust (whether that means onshore or just someone offshore you have a better relationship with).

Best Wishes,
Peter

Sorry, I meant to say it would NOT hide part of a file, but the entire file itself.

CS

If you’re using git and github, I believe adding files/directories to your .gitignore file should do what you want. It would hide a part of a file, however, but the entire file itself.

But then the tests and the app may not work. You’d have to think carefully about not breaking automated testing - you’d also need to add the appropriate test files to your gitignore.

But then of course you’re stuck with no version control on those files - so now that I think about it, probably not a good idea.

Best Wishes,

Peter

Thanks Peter and Culley. What about something like RubyEncoder? If I
would like my overseas programmer to work on the views and controllers
(just the UI), can I encode all the model files and give them to him?
Will the automatic test scripts continue to work with the encoded
model files?

Using stubs for models sound good but does that mean I have to rewrite
lots of the integration testing scripts to accommodate for the fact
that the models are just stubs which do not return the results you
would expect from fully implemented models?

Thanks.

I am in the U.S. I am afraid that a non-disclosure or non-compete agreement with him will be difficult and expensive to enforce outside the U.S. under a developing country’s legal system.

You could save you’re self a lot of hassle and just hire a worker in the U.S. where you will be able to enforce the NDA and NCA. This route saves you an extremely cumbersome process of trying to constantly hide all your code. If you find someone in your own area/time zone it becomes easier to coordinate with them on code check-ins. The cost difference is well worth it for the sleep at night you will gain because your fears will be at ease.

B.

We tried this whole offshore thing in the late 90s. and found that the money saved on labor was more than eaten back up by longer production schedules and additional layers of communication. Not worth it.

Walter

We tried this whole offshore thing in the late 90s. and found that the money saved on labor was more than eaten back up by longer production schedules and additional layers of communication. Not worth it.

Been my experience too. Interestingly a number of manufacturers are coming to the same conclusions - cost isn't everything.

That said there are some awesome software engineers that don't happen to live in the US. The overhead of finding, mentoring and partnering with them is non-trivial though.

For a good example, check out how ThoughtWorks integrates their Indian offices with their US and UK teams. Long cross postings so the teams really bond and work well with each other - seems like a great model, but only if you've got the resources and need the team size to make it viable. Can't believe it'd be worth it if you only need 10-20 devs.

Best Wishes,
Peter

How can I hide parts of Ruby source code from another programmer
working on the same project? I plan to outsource development of parts
of my RoR web site to an overseas programmer. I don't want him to
be able to clone the entire site easily and operate it overseas.

It would probably be better to hire a developer you trust.

I am afraid that a non-disclosure or non-compete agreement with him
will be difficult and expensive to enforce outside the U.S. under a developing country's
legal system.

"a developing country's legal system" really?? That's your angle? It's
okay to take advantage of their cheap labour, but god forbid they
should try to take advantage of you?!
:-/