luca
luca

Reputation: 12601

How to organize a Shoes Ruby app?

can I have some examples of how you organize your Shoes apps? I mean, simply using a Shoes.app{} block and instance variables is clumsy.. I'd like to achieve a MVC like structure.. I'm used to it (from rails, FLEX frameworks and others..) and would like to recreate something similar..

Upvotes: 2

Views: 962

Answers (2)

PragTob
PragTob

Reputation: 557

The way I usually manage this problem, is through the following separation:

  • Models - you ordinary model code/business logic (ripe for testing!)
  • Tabs/Views - separate views for different menu items embedded in the application

To achieve the latter I extracted a little slot handling library, which hasn't yet been extracted to its separate gem or even repository (waiting for shoes4 here).

The files needed are here in my pomdoro tracker project - it's slot.rb, slot_manager.rb and dynamic_slot.rb - you can see them being put to use in the aforementioned project.

Basically the slot manager hides the old view and loads the new view upon request. This code was initially extracted from the hacketyhack tabs.

Hope that helps!

Upvotes: 2

bennybdbc
bennybdbc

Reputation: 1425

I would take a look at some open-source shoes apps and see how the developers have organised them. A massive list of shoes products can be found at: http://the-shoebox.org/.

Upvotes: 0

Related Questions