Adding Gems to Scala play application - heroku

I am currently deploying my application on Heroku.
I require access to some gems from within my Scala (Play framework) application. Is there any way to do this? I tried including a Gemfile, but that makes it into a Ruby application. From what I understand their documentation says that it is only possible for Ruby/Rails applications.

As said, Play is Scala, and so as nothing to do with Ruby gem.

Related

How to run unit tests before building a ruby gem?

I am developing a gem and I have my unit tests in lib/spec directory. Currently I manually run unit tests using rspec lib/spec. And then I build gem using gem build mygem.gemspec (which builds a .gem file).
How can I run my unit tests along with gem build command? (Just like how we do production builds using npm)
If you have a build process that consists of multiple tasks (e.g. testing, creating a gem, publishing a gem), and has dependencies between those tasks (e.g. the gem should only be created if the tests are successful, in order to publish the gem, it needs to be created first), you can use a build tool to automate that.
Actually, build tools can be used for much more than just building, which is why some people prefer the term task-oriented programming or (my personal favority) dependency-oriented programming for that.
The most famous of such dependency-oriented programming tools is probably make. If you are familiar with the Java ecosystem, you probably know Apache Ant and Gradle. In the Microsoft world, there is the Microsoft Build Engine (MSBuild). From the ECMAScript ecosystem, you may know Grunt or Gulp. The hot new kid on the block is Google's Bazel.
Ruby also has its own share of such tools, the most widely-used one is Rake.
A lot of Ruby libraries and tools come with their own ready-made Rake Tasks, so that you don't have to write them yourself. For your particular use case, for example, there are ready-made tasks for building gems and for running RSpec tests.

Manually setting up ruby on rails eclipse

I've been developing RoR applications since beginning of this year, and I've been using vim and it's plugins to develop all of my applications. AFAIK, RoR has been build to be used with a simple text editor.
However, I have a project that keeps growing, so sooner or later, I think that an IDE would become a necessary tool to continue building my projects.
I've been researching on the internet, and Netbeans is not a good solution, because of it's few developers, today there is no more support for rails, and the plugins are quite obsolete.
I've found also EasyEclipse, but this projects also is quite abandoned, and rails plugins have problems to work properly with different Eclipse versions.
What I've been thinking -since Eclipse is a highly customizable IDE- maybe I could install a generic ruby plugin (since a generic ruby plugin may be stable on time) and manually customize it myself in order to use it for ruby on rails application (establish my gems path, ruby path, etc).
I've found Ruby DLTK 5.0 Kepler plugin, and I think maybe it is a good start point. But since I'm pretty new to Eclipse, I don't know which other tools/plugins are necessary in order to achieve my goal (¿maybe a server plugin?), nor the important settings that I must tweak up.
Does anybody know if it's possible to configure Eclipse this way?
There is RubyMine, it is great but not free unfortulantly

How to upgrade ruby 1.9 cartridge in exsting OpenShift Online application?

I have an existing OpenShift Online app that I created with a Ruby 1.9 cartridge.
Now that the Ruby 2.0 cartridge is available I'd like to "upgrade" my app to use that, but I can't figure out how to do it.
I tried doing an 'rhc cartridge-add ruby-2.0 -a ' but it says the cartridge isn't available.
I created a sample rails 4/ruby 2.0 app in my OpenShift Online account so I know the cartridge exists, but for some reason my ruby 1.9 app doesn't know about it.
I'm hoping I don't have to create a whole new app and then migrate my code over, re-populate the database, modify the Gemfile, etc.
Has anyone tried to do this and had success? This will be a periodic task for me, upgrading ruby and rails as they become available. I've upgraded rails already and that mostly involved gem and Gemfile changes, but the ruby cartridge upgrade seems different.
I'm thinking this has to have been worked out. Otherwise, established production apps could never have their language cartridges upgraded...?
You can not remove or upgrade a web cartridge (the main cartridge for your application). You will have to create a new application with the upgraded cartridge that you want to use and migration your application over manually. You might be able to use the rhc snapshot save & rhc snapshot restore commands, but I'm not sure if that works between different versions of the same cartridge.

In order to get my Gem published, do I absolutely need to write tests?

I would like to publish a Gem I wrote so it can be installed by users via gem install my-gem. The RubyGems guide on how to Make Your Own Gem has a section on using Test::Unit and rake to test my code.
Writing tests is going to add significant development time to a Gem that (in this case) is somewhat trivial in nature. I'd like to avoid it if possible.
Is it necessary to write tests in order to publish a Gem or just a suggestion?
It is a (good) suggestion, and is in no way required to publish a gem.

When packaging gems with an application, can one run the application one another computer with only installing the correct ruby version?

I have a ruby application I would like to package and distribute. The application is dependent on a few gems. This is a question about user experience.
I want the user to be able to download a folder and run my application. At most, the user will have to download and install the correct version of Ruby as a requirement.
Will running 'bundle package' be enough to cover the gem dependencies?
I have also explored bundling the running environment with ocra but I think that is over kill and to much of a knock on performance.

Resources