How can I load the rails environment from within a gem? - ruby-on-rails-3

I need to require config/environment.rb. How can I do this from within a gem?

You need to create a new project to get the config/environment.rb file and all other support files like environment folder, app, etc.,
When you create a new project it should automatically created these files. You don't need to create it manually.

Related

mix: create new module in existing project

Is there any handy mix command to add a new module to an existing elixir project?
I use elixir 1.10.3 and I have such project structure:
apps
--api
----mix.exs
----lib
----test
--inventory
----mix.exs
----lib
----test
--mix.exs
I would like to add a monitoring module.
There is no command to create new modules, just add a file in the correct folder.

A Module For Installing Modules in Yii

I am wondering if there is a module that gives the ability to install modules via an interface instead of copy a module files and create database tables manually and add it to config/main.php .
Is there any ? I mean something like what is in Joomla or Drupal?
As of now, I don't think there is something like this on Yii.
What we did for our projects, is this.
We created our module, that will automatically create / copy the files and the same time, add the configuration files.

Random folders being created on assets directory Yii

Can someone explain me why random folders are being created at assets directory of my Yii project. Since I am using SVN to control the versions, is it necessary to commit those folders as well ?
Those folders are the js, css, and image files needed for various widgets and other parts of the Yii framework. You do NOT want to commit them to a repository, as Yii automatically regenerates a fresh copy if they don't exist.
Just create the folder for it, wipe out the contents of the folder if you upgrade to new versions of widgets, and don't add them to your repo.
http://www.yiiframework.com/wiki/148/understanding-assets/

Which folder to store design files in Rails App?

I have a few other files related to my Rails website I am building like a few wireframes, mocks, and other design files. I want to store them in the Rails website directory so that all the things relating to that project are in the same folder. Where should I store these non-essential, non-related files inside a Rails app? Public/, Lib/, Vendor/? Please help me out. Thanks!
If you want them to be easily accessible, use public/. Otherwise, I would suggest just creating a new directory for these things, design/ perhaps.

How do I create resource packages with a filetype? NSBundles?

I am not sure what it is called, but I'm looking for a way to create packages (a directory containing a bunch of non-executable files, i.e. images) with custom file extensions. For example, I want to create a theme package named example.theme, which contains a bunch of images. How can I achieve this?
Just create a directory with that name. On iOS, there is no file manager, so you don't have to worry about it appearing as a bundle or just as a regular directory.