jruby

PDFBox Inconsistent PDTextField Autosize Behavior after setValue

我与影子孤独终老i 提交于 2019-12-02 12:30:01
I am using Apache PDFBox for configuration of PDTextField 's on a PDF document where I load Lato onto the document using: font = PDType0Font.load( @j_pd_document, java.io.FileInputStream.new('/path/to/Lato-Regular.ttf') ) # => Lato-Regular font_name = pd_default_resources.add(font).get_name # => F4 I then pass the font_name into a default_appearance_string for the PDTextField like so: j_text_field.set_default_appearance("/#{font_name} 0 Tf 0 g") # where font_name is # passed in from above The issue now occurs when I proceed to invoke setValue on the PDTextField . Because I set the font_size in

Sinatra doesn't know this ditty even when default route is implemented with modular style

…衆ロ難τιáo~ 提交于 2019-12-02 11:34:21
问题 I'm running MacOS mavericks whith jruby and am trying to write a basic modular sinatra app. Here's what my config.ru looks like require 'app/app' run Sinatra::Application I invoke it like this with rackup , you can see the 404 errors - rackup -s puma -p 8080 Puma 2.10.2 starting... * Min threads: 0, max threads: 16 * Environment: development * Listening on tcp://localhost:8080 127.0.0.1 - - [17/Jan/2015:18:32:37 -0500] "GET / HTTP/1.1" 404 437 0.0290 127.0.0.1 - - [17/Jan/2015:18:32:37 -0500]

require self made gem in jruby fails after update to jruby-1.7.13

回眸只為那壹抹淺笑 提交于 2019-12-02 07:57:41
I used jruby-1.7.0 and testing frame work Test::Unit::TestCase. Now I have updated some gems which caused me to use MiniTest::Test for testing, so I also upgraded to jruby-1.7.13. I have a rake task too which builds my gems with java *.class files instead of ruby *.rb files. Now many things dont work any more like 'rake test', or require "my_gem_xyz" from irb, getting errors like load error and ArrayIndexOutOfBoudsException. I have rvm installed to switch between rubies. How can I use *.class files in my self made gems like it worked before under jruby-1.7.0? (If I include the *.rb files in

Rails3 talks to SQL Server 2000-----ActiveRecord::JDBCError: 'ROW_NUMBER' is not a recognized function name

北城以北 提交于 2019-12-01 12:58:09
A simple Rails 3 application tries to talk to SQL Server 2000 using activerecord-jdbc-adapter. I tried both microsoft jdbc driver and jtds driver. seems to connect to database OK. when it is time to SHOW data I get this error: ActiveRecord::StatementInvalid in PencilsController#show ActiveRecord::JDBCError: 'ROW_NUMBER' is not a recognized function name.: SELECT t.* FROM (SELECT ROW_NUMBER() OVER(ORDER BY [pencils].id) AS _row_num, [pencils].* FROM [pencils] WHERE [pencils].[id] = 1) AS t WHERE t._row_num BETWEEN 1 AND 1 The real problem here is the DB do not support proper LIMIT and OFFSET

JRuby script with Rubeus and Swing exiting once packaged into jar using warble

醉酒当歌 提交于 2019-12-01 11:05:49
I am trying to package a simple JRuby script into a jar file. The script uses Rubeus::Swing and runs correctly when executed with the JRuby interpreter. require 'rubygems' require 'rubeus' class Example01 extend Rubeus::Swing def show JFrame.new("Rubeus Swing Example 01") do |frame| frame.visible = true end end end Example01.new.show Once I package the script into a JAR with warble , when I execute: java -jar jtest.jar ... the JFrame window shows up and instantly closes. There is no indication of errors of any kind. Does anyone know why this happens? Warbler calls System.exit() after your main

How can JVM implementations like Jython and JRuby beat their native counterparts?

纵然是瞬间 提交于 2019-12-01 07:07:33
I was watching this video here , where Robert Nicholson discusses P8, an implementation of PHP on the JVM. At some point he mentions that they aim to surpass native PHP in performance some time in the future. He mentions JRuby and Jython, which started out slower than their native counterparts, but eventually surpassed them. Quercus, another PHP interpreter on the JVM claims to be 4x faster than mod_php and is also worth of note. Does that mean that the general idea that the JVM is slower than C is wrong, or are there flaws in the original C implementations? Does that mean that the general

How can JVM implementations like Jython and JRuby beat their native counterparts?

安稳与你 提交于 2019-12-01 05:52:10
问题 I was watching this video here, where Robert Nicholson discusses P8, an implementation of PHP on the JVM. At some point he mentions that they aim to surpass native PHP in performance some time in the future. He mentions JRuby and Jython, which started out slower than their native counterparts, but eventually surpassed them. Quercus, another PHP interpreter on the JVM claims to be 4x faster than mod_php and is also worth of note. Does that mean that the general idea that the JVM is slower than

Shutdown hook for Rails

人盡茶涼 提交于 2019-12-01 03:09:43
I'd like to have some cleanup code run when Rails is shutting down - is that possible? My situation is that I have a few threads in the background (I'm using jruby and calling into java) that live for the life of the process and I need to let them know to shut themselves down Thanks! Probably should just use the Ruby exit handler, which is a Kernel method: $ irb >> at_exit do ?> puts 'bye...' >> end => #<Proc:0xb79a87e4@(irb):1> >> exit bye... $ Within the context of a Rails Application, the best place to put such a file is in config/initializers . In my app, I needed to Flush the Redis

Failed to build gem native extension with JRuby

南笙酒味 提交于 2019-12-01 00:59:17
I change the ruby version from ruby 1.9.3-p125 to JRuby 1.7.0-preview1 with ruby-build . When I execute jruby -S bundle install on my project, there are some errors as below, ... Using bson (1.6.2) Installing bson_ext (1.6.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/joshchang/.rbenv/versions/jruby-1.7.0-preview1/bin/jruby extconf.rb NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable. (root) at /Users/joshchang/.rbenv/versions/jruby-1.7.0

How to enable colors with rspec when using JRuby or bundle exec?

↘锁芯ラ 提交于 2019-11-30 23:52:48
问题 I'm trying to run my rspec's with JRuby: rake spec which results in: jruby -S bundle exec rspec --color spec/foo_spec.rb No colors show up, so I removed Jruby from the equation: bundle exec rspec --color spec/foo_spec.rb no colors. How can I get the "--color" option passed through to rspec? I've also got a .rspec file in the root directory of my project which doesn't seem to help in these cases. However, the .rspec file is picked-up or used when I just run: rspec spec/foo_spec.rb Any ideas?