jruby

Is there a way to debug a JRuby on Rails application running on a Tomcat server in eclipse?

ぐ巨炮叔叔 提交于 2019-12-06 13:55:50
问题 I have a JRuby on Rails application running on Tomcat 7 server. I use Eclipse as IDE. Is there a way to trigger breakpoints in the Ruby code? If not, is there any other way to debug the application? (and I rather not use messages be printed to the console). I suppose that if it doesn't work with Eclpse, it won't work with IntelliJ either. 回答1: The JRuby on Rails application that we are currently developing will ultimately be deployed to a Tomcat server. During development, however, we use the

Any tutorial-like articles out there that explain how to use jRuby on Android? [closed]

自作多情 提交于 2019-12-06 12:39:53
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm planning to perhaps purchase an android phone, and would love to be able to script some simple apps in Ruby on it. I found this article from back in August where the author was able to get the scripts working, but since I'm not a Java head, I had a hard time understanding all the steps. http://amazing

Error: private method `gsub' called for nil:NilClass with pik install ruby 1.9.3

戏子无情 提交于 2019-12-06 12:11:50
On Windows 7 machine, I have installed jruby 1.6.7 and then installed pik with 'gem install pik'. I then ran pik_install C:\bin which installed pik properly. I can run "pik ls" command properly. C:\Users\nir>pik ls * 167: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM)... My PATH is :- C:\Users\nir>echo %PATH% C:\Program Files\Java\jdk1.7.0\bin; C:\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\jruby-1.6.7\bin;C:\cygwin\bin; However, when I run "pik install ruby 1.9.3" command, I get the following error :- C:

Anyone using JRuby-Rack with Rails 3?

蹲街弑〆低调 提交于 2019-12-06 11:53:15
Is anyone else out there running Rails 3 and JRuby-Rack, or Jetty and Rails 3? Any trick to it? I'm going insane with some debugging, and at this point I just want to know that it's possible. These instructions work for me: http://mathias-biilmann.net/2010/2/jruby-and-rails-3-beta-step-by-step ranjib i am using jetty-rails + rails3 for a couple of projects. jetty-rails need to be fixed , require "activesupport" need to be changed to require "active_support" (for activesupport 3.0.3) and you have also do 'require "active_support/all"' to include hash extensions (otherwise symbolize! & reverse

possible to load nokogiri in jruby without installing nokogiri-java?

无人久伴 提交于 2019-12-06 11:21:36
问题 i need a way to run following nokogiri script #parser.rb require 'nokogiri' def parseit() //... end and call the parseit() while running below main.rb in jruby #main.rb require 'parser' parseit() Of course the problem is jruby cannot find 'nokogiri' as I have not installed it aka nokogiri-java via jruby -S gem install nokogiri The reason is there is some bug I found in nokogiri running under Jruby, so I have only installed nokogiri on Ruby not Jruby. The parser.rb runs perfectly under just

How to use H2 as embedded database in Postgres-compat mode, from jruby/rails

自古美人都是妖i 提交于 2019-12-06 10:48:55
问题 I'd like to launch a jruby/rails app to use Postgres. But I'd like to use H2 in Postgres compatibility mode when running in development and test. Its no problem bringing up the app in H2, or in postgresql, but how do I configure to run the postgresql adaptor, using an embedded H2 database? For example: something like this: database.yml development: # adapter: jdbch2 # database: db/development/database adapter: postgresql encoding: unicode database: database # driver: org.h2.Driver url: jdbc

Cross-Implementation Deterministic Array#shuffle

我的未来我决定 提交于 2019-12-06 08:36:27
It is possible to pass a random number generator to Array#shuffle that makes the shuffle deterministic. For example, in MRI 1.9.3p327: [1, 2, 3, 4].shuffle(random: Random.new(0)) # => [1, 2, 4, 3] [1, 2, 3, 4].shuffle(random: Random.new(0)) # => [1, 2, 4, 3] However, the random number generator implementation of Random isn't specified. Because of this, other implementations of Ruby have different results. In Rubinius 2.0.0rc1 (1.9.3 release 2012-11-02 JI): [1, 2, 3, 4].shuffle(random: Random.new(0)) # => [1, 3, 2, 4] [1, 2, 3, 4].shuffle(random: Random.new(0)) # => [1, 3, 2, 4] Incidentally,

How to extend DataMapper::Resource with custom method

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 08:22:49
问题 I have following code: module DataMapper module Resource @@page_size = 25 attr_accessor :current_page attr_accessor :next_page attr_accessor :prev_page def first_page? @prev_page end def last_page? @next_page end def self.paginate(page) if(page && page.to_i > 0) @current_page = page.to_i - 1 else @current_page = 0 end entites = self.all(:offset => @current_page * @@page_size, :limit => @@page_size + 1) if @current_page > 0 @prev_page = @current_page end if entites.size == @@page_size + 1

Understanding the source code for Ruby's repeated_permutation method

那年仲夏 提交于 2019-12-06 08:14:33
I've been building an intelligent Mastermind game in Ruby. In my game, if you select the option of having the computer play the role of code breaker, the computer makes educated guesses at what the code maker's code is. As part of my algorithm, the computer first looks at the entire list of ALL POSSIBLE CODES. For example, if there are 6 colors to choose from (red orange blue green purple yellow) and the code is made up of 4 colors (repeats are allowed), then to view all possible codes, you can do this: valid_colors = %w(red orange blue green purple yellow) all_possible_codes = valid_colors

Is there any tool to detect code/functionality which is no longer used?

感情迁移 提交于 2019-12-06 07:48:17
We have many applications running (consider all of them run on Java Platform) and we need to check which ones were used in the last, say, 3 months, and, among those active applications, which parts/functionalities (and how often) are still being used. Is that possible? The goal here is to detect applications or funcionalities which no longer are relevant to the business and remove them, so that we end up having less code to maintain and monitor. Is there any tool which could help us achieving that? We DO use agile methods, so when a new application gets into production it has only the