我正在尝试使用JRuby的samppipe.我已经看过从JRuby调用Java 的指南,并且已经成功地将它用于另一个Java包,但是无法弄清楚为什么同样的东西不能用于samppipe.
我试图基本上从JRuby做相当于这个Java:
URL url = new URL("http://www.example.com/some-location/index.html");
String text = ArticleExtractor.INSTANCE.getText(url);
Run Code Online (Sandbox Code Playgroud)
在JRuby尝试过这个:
require 'java'
url = java.net.URL.new("http://www.example.com/some-location/index.html")
text = Java::DeL3sBoilerpipeExtractors::ArticleExtractor.INSTANCE.getText(url)
Run Code Online (Sandbox Code Playgroud)
这是基于用于samppipe 的API Javadocs.这是错误:
jruby-1.6.0 :042 > Java::DeL3sBoilerpipeExtractors::ArticleExtractor
NameError: cannot load Java class deL3sBoilerpipeExtractors.ArticleExtractor
from org/jruby/javasupport/JavaClass.java:1195:in `for_name'
from org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:45:in `const_missing'
from (irb):42:in `evaluate'
from org/jruby/RubyKernel.java:1087:in `eval'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/1.8/irb.rb:158:in `eval_input'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/1.8/irb.rb:271:in `signal_status'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/1.8/irb.rb:270:in `signal_status'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1417:in `loop'
from org/jruby/RubyKernel.java:1190:in `catch'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/1.8/irb.rb:154:in `eval_input'
from /usr/local/rvm/rubies/jruby-1.6.0/lib/ruby/1.8/irb.rb:71:in `start'
from …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种快速简便的方法来在Rails中生成唯一的每个请求ID,然后将其用于记录特定请求。
理想情况下,任何解决方案都不应过多使用默认的日志记录代码,因为我同时在jruby和ruby下运行该应用程序。
我正在使用jRuby和Rails一段时间,但我没有感觉到我已经找到了这个圣杯:我正在做很多宝石,它们是实际java库的包装器,我问自己什么是包装这些宝石的最佳选择.将它们打包为"本土宝石"是一个好主意,让宝石在安装宝石时被打包?有没有办法在.m2目录中安装jar,让捆绑器和maven同时能够做到最好?
最好,
托比亚斯
我没有太多运气搜索谷歌这个 - 是否有任何JRuby单元测试框架的Java代码与Eclipse或Maven集成?是否有可能与Eclipse集成的Cucumber风味,如果是这样,有人可以指向我快速入门指南解释如何做到这一点吗?:-(
任何教程或博客都可以从JRuby on Rails开始,
它指导我进行安装和小型JRuby on Rails应用程序?我已经完成了本演练和教程(https://github.com/jruby/jruby/wiki/WalkthroughsAndTutorials)链接,但大多数JRuby on Rails链接都已损坏.
问题1) 我想知道轨道上的红宝石是否具有功能类似于primefaces的宝石.为什么我要问的是
如果你使用primefaces(http://www.primefaces.org/showcase-labs/ui/home.jsf),开发人员无需担心javascript或jquery的东西.
据我所知,JSF是一个规范,基于规范可用的各种实现,primefaces是这些实现的ui框架,primefaces有很多基于jquery和javascript库的组件.或多或少的primefaces只是作为一个javascript包装器.我使用primefaces,你主要专注于业务逻辑,不需要担心UI.
我受到红宝石轨道方法的启发,并且有很多宝石可供选择.
我的问题是,是否有可用于轨道上的ruby的gem或UI框架,类似于由primefaces驱动的UI魔术
注意:我不是在寻找纯粹的jquery或dojo东西,我正在寻找用于ruby on rails的UI组件驱动的东西.使用曲面工作项目的人和使用rails的项目将100%理解我的问题.
问题2) 我想知道与用户界面相关的宝石列表.我要问的是为了在轨道上的ruby上创建非常小众的用户界面需要什么东西(框架或宝石).
我从MRI来到JRuby主要是为了SWT和Java库,用于桌面开发.
通过一些小实验,我发现它可用于我的目的.但它看起来像使用等效的ruby语法编写的java代码.

我在SWT上四处寻找任何红宝石包装或DSL.我发现了一丝微光.但我不确定状态,看起来没有维护.
使用JRuby对SWT有哪些其他选择?你对他们的体验是什么?
我是rubyrep的新手,目前正在使用rubyrep-1.2.0版本进行PostgreSQL Master-Master复制.除bytea之外的所有数据类型都正在被正确复制.在复制bytea列时,似乎数据被转义两次.我正在使用postgreSQL9.2版本,我 在postgres配置中尝试了bytea_output ='hex'和bytea_output ='escape'选项而没有任何运气.
left database bytea列值:
\xc30d0409030220f8eef5543ac6906cd234018e307bd602ca16a61e674a6c4368f8018b01c3ae3007ae0313a9e44dc661a97a61cc94032f3ed1921e5987e92ff723f674a903
Run Code Online (Sandbox Code Playgroud)
左侧的bytea数据被复制到右侧数据库:
\x5c3330335c3031355c3030345c3031315c3030335c3030325c3034305c3337305c3335365c3336355c3132345c3037325c3330365c3232305c3135345c3332325c3036345c3030315c3231365c3036305c3137335c3332365c3030325c3331325c3032365c3234365c3033365c3134375c3131325c3135345c3130335c3135305c3337305c3030315c3231335c3030315c3330335c3235365c3036305c3030375c3235365c3030335c3032335c3235315c3334345c3131355c3330365c3134315c3235315c3137325c3134315c3331345c3232345c3030335c3035375c3037365c3332315c3232325c3033365c3133315c3230375c3335315c3035375c3336375c3034335c3336365c3136345c3235315c303033
Run Code Online (Sandbox Code Playgroud)
什么,我在rubyrep/postgresql配置中遗漏了吗?
将Torquebox(2.3)实现到现有JBoss环境中的方法是什么?我在配置文件(standalone.xml)中找到了扩展:
<extension module="org.torquebox.bootstrap"/>
<extension module="org.torquebox.core"/>
<extension module="org.torquebox.services"/>
<extension module="org.torquebox.web"/>
<extension module="org.torquebox.messaging"/>
<extension module="org.torquebox.jobs"/>
<extension module="org.torquebox.security"/>
<extension module="org.torquebox.cdi"/>
<extension module="org.torquebox.stomp"/>
<extension module="org.projectodd.polyglot.hasingleton"/>
<extension module="org.projectodd.polyglot.cache"/>
<extension module="org.projectodd.polyglot.stomp"/>
Run Code Online (Sandbox Code Playgroud)
......和
<subsystem xmlns="urn:jboss:domain:torquebox-core:1.0"/>
<subsystem xmlns="urn:jboss:domain:torquebox-services:1.0"/>
<subsystem xmlns="urn:jboss:domain:torquebox-web:1.0"/>
<subsystem xmlns="urn:jboss:domain:torquebox-messaging:"/>
<subsystem xmlns="urn:jboss:domain:torquebox-jobs:1.0"/>
<subsystem xmlns="urn:jboss:domain:torquebox-security:1.0"/>
<subsystem xmlns="urn:jboss:domain:torquebox-cdi:1.0"/>
<subsystem xmlns="urn:jboss:domain:torquebox-stomp:1.0"/>
<subsystem xmlns="urn:jboss:domain:polyglot-hasingleton:1.0"/>
<subsystem xmlns="urn:jboss:domain:polyglot-cache:1.0"/>
<subsystem xmlns="urn:jboss:domain:polyglot-stomp:1.0" socket-binding="stomp"/>
Run Code Online (Sandbox Code Playgroud)
...和一些端口绑定一样
<socket-binding name="stomp" port="8675"/>
Run Code Online (Sandbox Code Playgroud)
和一个目录差异(空白JBoss 7.1.1与Torquebox 2.3与JBoss 7.1.1给了我很多差异.
我假设不仅仅是以上几行:我已经看到了Hornet集成和更多模块.是否有人在过去做过这个并且可以分享经验,安装/实现脚本,一些文档或模块列表以及受尊重的配置设置?
任何提示,作弊,提示和技巧都是受欢迎的!
给定一个打开的示例脚本/dev/tty:
# sample.rb
tty=File.open("/dev/tty", "w+")
tty.print "> "
tty.puts tty.gets.upcase
Run Code Online (Sandbox Code Playgroud)
我可以用正常的jruby运行它就好了:
% jruby sample.rb
> hello
HELLO
%
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试使用/dev/ttynailgun,那么tty绑定到nailgun服务器,而不是客户端:
# server terminal | # client terminal
% jruby --ng-server |
NGServer 0.9.1 started on all interfaces, port 2113. |
| % jruby --ng sample.rb
> hello |
HELLO |
| %
Run Code Online (Sandbox Code Playgroud)
(垂直间距是显示时间,每个实际输出缺少空行)
这是预期的行为,还是一个错误?
如果它是预期的行为,有没有办法我可以检测脚本是否正在运行,--ng所以我可以避免打开/dev/tty?
jruby ×10
ruby ×4
java ×2
maven ×2
bundler ×1
bytea ×1
deployment ×1
dsl ×1
eclipse ×1
gui-toolkit ×1
installation ×1
jboss ×1
jrubyonrails ×1
jsf-2 ×1
nailgun ×1
postgresql ×1
replication ×1
rubygems ×1
swt ×1
torquebox ×1
tty ×1
unit-testing ×1