Rails: tools for auto-building existing project features/structure - ruby-on-rails

I need to create new version of my current project - take all features and rewrite it, add new features.
What tools or gems do we have for Rails project to build for me some kind of catalogue of existing features? Maybe in form of models and associations between it or some kind of graphs.
After it I will be able to customize such information for my needs. Anyway it should be simpler than go through all code and make it from scratch by myself.
All help appreciated.

I found such gem for my case:
https://github.com/voormedia/rails-erd
It's not totally what I was seeking for, but still useful.

Related

ZF2 shared installation for many virtual hosts

I have many projects in the same Centos server and I'd rather like to install ZF2 once in a location like /usr/share/zf2 instead installing it with Skeleton all the time as duplicate libraries with projects and use ZF2_PATH in all my applications. Naturally, I'd like to use composer to update this shared zf2 library as well.
I can make it work in my way but I'd like to know if there is a conventional/preferred way to do this.
What I would do is:
1- Install ZF2 in /usr/share/zf2
2- Set ZF2_PATH environment
3- Remove Zend Framework 2 requirement from composer.json of the projects and update all as necessary.
I am just trying to follow a proven/accepted/easy-to-maintain method instead discovering it.
Thank you very much.
This is unconventional, there is no "proven/accepted" way of doing it and many people will have different opinions.
Downside of your solution is the need of testing all 3 apps when upgrading Zend Framework, I am sure you can imagine multiple scenarios when it could be handy to upgrade it just for one. If anything goes wrong, and things do go wrong, you will end-up breaking all 3 apps, not just one.
The only upside is saving space, but is that really an upside any more? Isn't disk space very cheap. Breaking your code is definitely more expensive (I am talking about cost of your time, potential loss of data or users).
If you still want to proceed you can create a 4th project with its own composer.json file and use it for any shared dependencies.

Use one "main project" as source for many projects: how to do it best with GitHub?

I'm planning 3-4 Rails projects. All of them share some basic functionalities, and I want to use the same development tools (e.g. RSpec) for all of them. But I don't feel like configuring every project completely from the ground up.
So I'm thinking of starting with one "base project" in which I configure all needed tools, and then to create a fork of it for all of the "real" projects. Everything all projects share is developed within "base project" and then synced into the forks.
Is this a good idea? I know that there are other possibilities to share common code (like gems or even gemified engines), but for a fast start I think my idea is quite effective.
Anyone has done this before? With good or rather bad results?
Any other ideas or hints are highly appreciated.
Update
Damn it, I just found out that I can't fork a repository into its own repository. Hm, I think there's a reason why people don't seem to do this. But simply copy&paste a project doesn't seem useful to me, as I also want to get stuff from a "real project" back into the "base project" when I think that it's useful for all other projects, too. I could do that with creating patches and stuff, but this seems rather cumbersome.
Update
I found a quite easy way to fork own projects in the same repository: http://bitdrift.com/post/4534738938/fork-your-own-project-on-github
Look at the comments though, there the easiest method is described.
Templates
You should look at using templates -
an inbuilt Rails feature which allows you to define certain attributes of a project (gems etc), and then "inherit" them in other projects
I've never used them myself, so I can't provide any code right now, but the tutorial seems pretty good :)

How To Version My Custom Classes

I have written some custom classes for coredata for use in projects. These will be updated over time.
Besides using git, what is the best way to manage versioning for my custom classes in my iOS projects?
There's really nice new feature In Xcode4.x for version control, you can take help of that in order to achieve that.
For details on it: Check this link:
http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode_User_Guide/000-About_Xcode/about.html

zend framework 2 simple integration

I am planning to build a project using zend framework 2.
But i find it very hard to setup zf2.
It is not easy to setup the framework and start working.
What i am looking is copy required zf2 files, put into the project and start working.
Like in cakephp where you need to make changes in database configurations and start working.
Can anybody help for this issue. this will be useful for many other developers also.
Thanks in advance for any help.
Have you tried the SkeletonApplication? It provides everything you need: Pre-setup bootstrapping, the directory structure, a basic application configuration.
Just clone it into your web directory and make sure that vendor/ZF2 gets cloned as well (--recursive flag).
This is currently the easiest approach to get started with a new ZF2 project.
If you need further assistance, please state your question more specificly.
// Edit: Although it makes sense to use composer or at least git to pull everything directly, you can just download the project (SekeletonApplication and ZF2) from Git. In my opinion, you shouldn't be too lazy here. Using composer etc. will save you a lot of time that you can spend on implementation.
Setting up ZF2 without the use of the command line is MUCH more of a pita than using it. Sure, you can download the SkeletonApplication and then you can Download ZF2 Core Library and put it into your include_path, but that's not too great.
I really suggest learning about the command line. I'm a windows user myself and hated it at first, but after getting around the first problems, i - now - find it really handy.
If you have trouble setting up your stuff or understanding it all, you may find my tutorial helpful which you can find right here: Zend Framework 2 Installation on Xampp for Windows
I had the same issue as you. I found the Skeleton application easy and quick to install, but I didn't need the translations that are included. As a result I created a stripped down, bare bones version which you are welcome to use.
You will find the ZendMinimumApplication on github.

Ruby on Rails plugin development process

I'm considering developing aspects of a website as Rails plugins for reuse. My question is about the development process. Since each of these plugins will provide a "slice" of functionality, should I develop each "slice" as it's own application and then extract the code from each application into a plugin? Or, should I write them as plugins right in an application? Ultimately I will be linking to these plugins from each site to keep it DRY.
I guess the main question is what would be the development process for creating multiple "Engine" type plugins?
Thanks in advance for any help.
Either approach is valid.
When writing a basic plugin I usually find it easier to write it in tandem with the application that will use it. Because I find it easier to design/test around something that already exists.
However, when it comes to Engine plugins, I prefer to develop them as a separate application and then rip out all the unnecessary bits when I move it into a plugin. They are in essence mini applications, and they should be completely functional when installed on a freshly created rails project.
By designing them as their own application I'm ensuring proper compartmentalization. This ensures that I'm not accidentally referring to code models/controllers/views/helpers that are not a part of the engine I'm developing.
If you're developing multiple engine type plugins this way, you might want to condense a few of the steps with a utility script. Such as one that streamlines the process of turning an application into an Engine plugin.
It should restructure your app as necessary and populate the files that plugins should have, such as init.rb.
You might want to give a look to Desert framework as well .

Resources