Is Ruby on Rails suitable for a non-web application? - ruby-on-rails

I am interested in developing a workstation-based application that communicates with a proprietary data server and that presents information from that server to the user. I am not intending the user interface to be browser-based, and have been considering Qt as my framework. Should I consider RoR for this? Thanks.

Rails is specifically a web application framework, however there are GUI toolkits that can be used with Ruby, including Qt (although not the open source version).

Rails is a web framework, so you should not use it. However, you should absolutely consider using Ruby. I've never used Ruby with Qt, but I've had a lot of success using JRuby with Swing. I use the Profligacy gem, which suits my needs quite well.

Being a web framework you may not use rails, but you may certainly use some parts of rails.
For example just use require 'active_record' and you instantly have access to AR and all its magic - validations, belongs_to, has_many and other similar associations.

You can use the ActiveRecord part of Ruby on Rails, which for a long time was the most interesting part of RoR. https://edgeguides.rubyonrails.org/active_record_basics.html
Alternatively, use another Ruby ORM, like DataMapper: http://datamapper.org/

The answer is yes. I've been working on a project, Qt on Rails, which combines Qt with a Rails back end. The end result is that you can develop your Qt app's in Ruby, harness the libraries of Rails and there's support for scaffolding of apps as well.
It’s still a 'Work In Progress' but the current latest version at the Qt on Rails github repository (http://github.com/theirishpenguin/qtonrails) will certainly give a flavour of where the project is headed. Contributors and feedback is most welcome and detailed blog post is available on the project.

Related

A Ruby On Rails-like migration tool

I like that Ruby On Rails allows you to write a simple schema in which you can create and update a database using. Is there any tool like Ruby On Rails's migration, as I would like to use the method without using Ruby On Rails for my website development?
There's no reason you can't use ActiveRecord::Migration outside of a rails app. In fact, you'll find plenty of examples of people doing this, as in http://exposinggotchas.blogspot.com/2011/02/activerecord-migrations-without-rails.html
If you're using mongo as the persistent store, check out mongrations for this.
I have heard this week on a little conference a talk about a tool called Liquibase, a database change management tool. It is based on Java (I think), but manages the database migrations in an XML file. The change sets you have to write are similar to the migrations you can write with Rails. If you use Liquibase inside an IDE like Eclipse, you get completion for all relevant parts of the change sets. It supports a lot of databases out of the box, so it could be an alternative, especially that nowadays Java is installed everywhere.
I recommend Python Alembic. It's not Ruby though.

Compiling / building ruby online from a working rails application

I'm totally new to Ruby but not to programming. All I did was going through try ruby and reading differences from other few languages I know better (mostly PHP and some Python). So I have no idea how Rails differ from Ruby and maybe this is an absurd question.
Anyways...
I don't want (or am able) to install Ruby on my machine and I'd still like to build a single working source file. Is it possible to have an online compiler of some sort? If so, how?
If I write a Rails web site (comprised of either one or many files) using any given host (that far I know I can), would I be able to use that same code with very minor modifications and just run as a Ruby app? Again, how?
(new) What about the other way around: a Ruby app turning into a Rails web page? Easy to do?
I really hope for a "yes" on them all, but I doubt on the 1st and not so much on the last. :)
There are online "IDEs" you can use to try out ruby:
http://ideone.com
http://codepad.org
But mind you that Ruby on Rails is a framework written in Ruby and those sites don't have RoR installed. Also note you that a Rails app has many, many files.
If you have the same code and same server configuration (version of ruby, database, plugins, etc.) you should only need minor modifications to the config file.
Ruby on Rails is on Ruby. So whatever works on Ruby should work just fine on RoR with minor modifications. However, you'll probably want to rewrite the app to take advantage of many of the features RoR provides.

A tool to automatically generate a UML diagram for a Rails Application

Looking for a good tool/gem that can automatically generate a nice looking UML diagram for an existing rails application.
(Im imagining such a tool would read the schema.rb file and then scan the models for relationships)
For Rails 3, try Railroady, it's maintained as well.
You could try Rails ERD as a an alternative to Railroad. It is maintained and works specifically for Rails 3.
RubyMine has a tool to do this; they call it a "model dependency diagram", but it generates a UML-like graph for your application models.
If you don't want to use RubyMine, check out RailRoad. It's a standalone tool that does similar, though RubyMine's is prettier, IMO.

Any suggestion for Ruby on Rails multilingual translation management?

I am developing a Ruby on Rails application with multilingual support. Now I have 4 languages, each have a separate yml file. I found this is inconvenience that when I add a new translation, I need to add all the lines manually to each yml file.
Does any good translation management tools can help me on this?
Thanks everyone. :)
Here are some links that I've gathered
Free (gems)
https://github.com/firmafon/iye IYE makes it easy to translate your Rails I18N files and keeps them up to date
https://github.com/tolk/tolk Tolk is a web interface for doing i18n
translations packaged as an engine for Rails 4 applications
https://github.com/local-ch/i18n-docs Maintain translations in Google
Docs and export them to your Rails project.
https://github.com/mynewsdesk/translate A Ruby on Rails plugin with a
web interface for translating I18n texts
https://github.com/mose/rails-i18nterface A rails 3/4 engine based
interface for translating and writing translation files
https://github.com/fourmach/i18n_dashboard Rails Engine for I18n
management with redis as backend
https://github.com/grosser/fast_gettext Ruby GetText, but 3.5x faster
... https://github.com/copycopter/copycopter-server /
http://copycopter.com Copycopter Server is open source. Run it as a
web service.
https://github.com/nijel/weblate / http://weblate.org/
/ Web based translation tool with tight Git integration.
Paid (apps)
http://www.tr8nhub.com/pricing (starting free - https://github.com/tr8n/tr8n)
https://www.localeapp.com/pricing (24€/month)
https://translationexchange.com/pricing ($39/month)
https://phraseapp.com/ ($9/month /language/project)
more advices http://eng.joingrouper.com/blog/2014/04/03/rails-internationalization-translation/
http://www.smartling.com/product (Contact Sales - complex)
Personally I'm using http://99translations.com/ Easy to use for non-programmers, eg. translators and free for the open source projects.
Another service https://webtranslateit.com/ is growing and in active development (blog is updating frequently). They have also free plan, on which you can store up to 500 strings, even for non open source project.
Both have API, for which they have rake task to update translations on your local machine and also on their server. Actually never used, but I think it's good when you have > than 1000 strings and updates are frequent.
Tolk can help you to do that: http://github.com/tolk/tolk
You can try using Translate to edit YML files.
There's https://github.com/berk/tr8n but it looks pretty hard core and it focuses more on the front end crowdsourcing component.

Coming back to Rails

So I've decided after a few years away, that I want to get back into Ruby on Rails for some of my personal projects. What I'm wondering is what are the best resources to find out what the new features are in rails? I haven't really even touched Rails since 1.2 was new.
Oh yeah, and is TextMate still the defacto editor for RoR on the Mac, or has something better come along?
Check out the official Rails Guides. These should provide a nice overview of Rails (if you are rusty) and are kept up-to-date with the latest versions.
You may want to check out Ryan Daigle's Edge Rails posts which covered features as they were added to the new versions. Use the dates to determine where to start and go through each one. He also has a PDF for $9 which covers upgrading to Rails 2.1.
I have also covered the changes on Railscasts. Check out the various tags for each version to see them: 2.0, 2.1, 2.2, 2.3.
Update: Thoughtbot blog has posted about upgrading to Rails 2.1 and 2.3.2.
I found the book Agile Web Development With Rails (3rd edition) to be the most helpful to get me going again earlier this year. In particular it notes some concepts that have changed as well as introducing the new items.
Regarding editing, Textmate still seems to be #1 among the MacRails folks, the text-editing ones, at least.
Beyond that, there are some IDEs around now, if that's your preference. They're starting to become fairly not-awful, which is pretty impressive really. There are plenty of questions here that touch on the topic: try searching for "ruby rails ide"
The Ruby Toolbox is a great and fairly new resource for seeing what gems/plugins/tools are popular for various aspects of your application such as authentication, testing frameworks, search, etc. It's based on the number of watchers and forks each project has on GitHub, which is a reasonably good way of judging popularity.
As for a newer editor ...
I have found that sublime text is a great editor for ruby and rails projects, it has great syntax highlighting out of the box, Vim keybindings available (vintage mode), a sweet package system to add functionality for other languages like SASS or Coffeescript and an excellent file browser that helps with complex folder structure that can happen in a rails project.
Also, it is highly extendible and configurable, I switched to it from Vim.
http://www.sublimetext.com/

Resources