Homebrew - where do you recommend placing your applications? - homebrew

I have just installed Homebrew, which has set-up the /usr/local folder structure. Is there a suggested location that I should be placing my application code within this new structure (if not, where is recommended)?

Related

MSIX: Set Installation Path

How to change the MSIX installation path??
Referred this url - "https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes"
Always installer package is created in default location "C:\Program Files\WindowsApps"
Need to set the installer location to different location.
The installation path of an MSIX package cannot be changed. All the files you have included in your package are installed inside an app-specific folder under "C:\Program Files\WindowsApps<your app>\".
This is a design decision from Microsoft. Only for MSI/EXE installers you can change the install path.
If you want to add files in other folders too, you need to copy them the first time your application is launched. For that, you have multiple options. You can write your own code inside your application to copy the files in other folders or you can use tools like Advanced Installer to do it for you.
To understand more about MSIX and how files outside of the installation path can be managed I recommend this article/presentation I wrote last month.

Homebrew formula how and where to place media files needed by executables in /bin

First homebrew formula, trying to migrate a primarily Python project from disutils to homebrew as it now requires quite a lot more than just python modules.
I've written a cli, in python, that needs access to template files, a some media files like fonts and images.
My directory structure (in the repository) looks like this:
/klibs
/bin
klibs # the cli
/lib
/font
/img
/template
/klibs
__init__.py # and the rest of the custom module
If I understand things right, to install the CLI I simply need:
bin.install("bin/klibs")
But that program needs access to everything in lib. I broadly understand that I just need to install that lib folder somewhere (...though specifically, I don't fully understand where...) inside Cellar and then symlink it. But I don't understand how this is achieved, or perhaps how it's best achieved as per homebrew cannon.
Lil help?

What is the purpose of /usr/lib/vendor_ruby

I have been working through an issue with CANVAS LMS where what appears to be a stale version of ruby existed in /usr/lib/vendor_ruby.
When I removed the /usr/lib/vendor_ruby/rails and /usr/lib/vendor_ruby/rails.rb files, the issue with Canvas disappeared.
What is the purpose of the /usr/lib/vendor_ruby directory?
I am running ruby 1.9.3 on Ubuntu 13.04, and have upgraded from 1.8.7.
Can I safely remove the entire /usr/lib/vendor_ruby directory?
Thanks.
Don
According to this excerpt from The Ruby Programming Language book, the vendor_ruby directory is intended for customizations provided by the OS vendor. In my personal experience it is safe to remove, and doing so can (like probably also in your case) resolve conflicts with Gems installed into the other directories.

virtual ruby development environment

I mainly do ruby on rails development on my machine but from time to time I end up using other laptops for RoR development. It would be nice if there was something (maybe shell?) which basically bring all the gems installed on my machine to some other machine without leaving any footprints. It's basically a really light VM without the OS stuff.
If it matters, I'm using a mac. Ideally I would like to keep that virtual environment in my dropbox and basically when I use some other machine, I would just get it from my dropbox and start coding and not have to worry about setting up the environment.
Similar to Jacob's answer, I'd recommend using RVM, but I'll expand on it. Here's some brainstorming ideas:
RVM stores its sandbox in your home directory at ~/.rvm. All Ruby instances, plus the associated gems will be stored there. It's a simple addition to the ~/.bashrc file in your Mac to initialize RVM so it's known by the shell when you log into the account. It's also a simple rm -rf ~/.rvm from the commandline to remove the RVM sandbox from the account, followed by removing the line from the ~/.bashrc.
So, basically, by setting up RVM correctly and installing your Ruby installation on one machine, you're 90% of the way to having it available for multiple machines.
I'm pretty sure Ruby will install without any dependencies on a current Mac OS using RVM, but there's a couple libraries that can improve the experience. After installing RVM, but before installing any Rubies, run rvm notes. That will show you what else to install. You'll need the current XCode to compile a Ruby, but only on the machine you do the compiling on. Once it's installed you should be able to move a RVM controlled Ruby around to other Macs by copying the ~/.rvm directory. So, not only would you have the gems, you could have a particular version, or versions, of Ruby, plus the associated gems, so your regression tests could work too.
If you use MacVim you could install it in ~/bin and have the GUI version. I haven't tried running it from there, but it seems like it'd work. You might need to create an alias from /Applications to the one in ~/bin for double-clicking.
MacVim comes with a shell script called mvim to launch it from the command-line. I have a bunch of softlinks to mine letting me call it from the command-line in various ways: gvim, and the gvim varients like gvimdiff and gview. You could do the same by adding ~/bin to your PATH and making the links locally in that dir to MacVim's mvim.
You could build a tarball of the vim config, vim installation and RVM sandbox, copy that to another Mac, expand it, add ~/bin to your PATH and append the needed RVM initialization line in ~/.bashrc, open a new command-line, and have your editor plus Ruby sandboxes.
It's a minor variation on how my Mac and Linux boxes are set up. I haven't tried bundling everything together, but, on Macs that are the same OS version, it should work.
Consider using rvm to manage different gem configurations. If you want you can store your rvm configurations in your dropbox (rather than in ~/.rvm, where they go by default) so that your gemsets are synced across machines.

What are the .channels and .registry folders in the symfony /plugins folder?

I am upgrading a Symfony website from 1.2.9 to 1.4.1 and having a lot of fun in the process (NOT!).
I have decided to clean up all unecessary files and folders and leave things to the bear minimum, in the process - since I had acquired a lot of plugins etc over a period of time - some of which were installed by PEAR and others (mostly), manually. Since I dont like using PEAR in any case, I will be installing all plugins manually hence forth (from now on).
As part of the cleanup process, I want to get rid of the /plugins folder. I suspect that these are to do with PEAR, but I dont know if symfony needs them to run. In my 1.4 website, I will be installing all the plugins that I (actually use) manually. So can I get rid of the following files (in /plugins) ?
.channels
.depdb
.depdblock
.filemap
.lock
.registry
Yes these are pear related. You can get rid of them.
I'm doing the same move from pear to manual install.

Resources