jruby

Compile SASS with Compass in Ant build.xml

主宰稳场 提交于 2019-12-06 07:40:59
问题 Does anyone know how to use JRuby and Compass modules to compile SASS (*.scss) files within build.xml? I'm able to use the Sass::Exec module within sass standalone installation to compile from *.scss to *.css in the following manner: <!-- Compile SCSS files copied to target folder --> <property name="stylesheetFolder" location="myproject/stylesheet"/> <property name="inputFiles" value="${stylesheetFolder}/[^_]*.scss" /> <echo message="Compiling SCSS files from ${stylesheetFolder}..." />

Convert bloc to lambda in JRuby

≡放荡痞女 提交于 2019-12-06 05:56:02
问题 How does one convert a bloc to a lambda in jruby? Basically what is the jruby answer for this: Ruby: convert proc to lambda?? 回答1: As long as you're running jruby 1.9-compatibly (e.g. jruby --1.9 -S irb ), it should be the same: my_proc = proc { |x| x } my_lambda = lambda &my_proc my_lambda.lambda? # => true 来源: https://stackoverflow.com/questions/13239338/convert-bloc-to-lambda-in-jruby

Cucumber 0.4.3 (cuke4duke) with java + maven gem issues

两盒软妹~` 提交于 2019-12-06 05:46:53
I recently embarked on installing a sample project for cucumber and tried running it with maven + java. I followed this guide http://www.goodercode.com/wp/using-cucumber-tests-with-maven-and-java/ First issue was when I run mvn cuke4duke:cucumber -DinstallGems=true I was getting an issue running gem command from the jruby-complete-1.5.6 jar I installed JRuby1.5.6 and installed the cuke4duke gem myself to the maven repository. Now when I run the command above I get an error in the script file "require 'rubygem'" and it cannot execute the gem command again. I am running on xp and tried this with

Selectively silence JRuby warnings

余生颓废 提交于 2019-12-06 05:10:28
I'm using the ruby-mysql library under JRuby and get the following warnings: /mysql/protocol.rb:530 warning: GC.disable does nothing on JRuby Is there any way to get JRuby to stop complaining about this? You have a couple options. First, you can run your program with the -W0 option which will disable all warnings. That's probably not what you want. However, applying -W0 is the same as setting $VERBOSE to nil -- so we can simply do that around the code where we want to suppress warnings. This is the second and much more preferable option. def suppress_all_warnings old_verbose = $VERBOSE begin

Issue getting ANSICON working on Windows 7 Enterprise 64-bit

百般思念 提交于 2019-12-06 04:23:41
问题 I have been trying to get 1.50 or 1.40 ANSICON (https://github.com/adoxa/ansicon) working and have looked at sooooo many pages telling about how to install this: http://blog.mmediasys.com/2010/11/24/we-all-love-colors/ http://carol-nichols.com/2011/03/the-system-cannot-find-the-path-specified/ etc.... So, I have my AutoRun set to "C:\usr\bin\ansi140\x64\ansicon.exe" -p and I also testing 150 but there was zero change. My entire team has this working with no issues but I cannot get this to

JRuby/Windows and (native) extensions how do I distinguish them?

人盡茶涼 提交于 2019-12-06 00:42:59
I've tried to use EventMachine etc., with JRuby. I get errors about native extensions. I believe this is due to Java limitations. I think the fact that I am on Windows further complicates the issue. Some clarification would be appreciated. What extensions can/can't be used with JRuby? How can I tell? Thanks. there is no really easy way to use native extensions in jruby. native extensions are calling c code that cant be called in jruby without implementing it in java. aside from that a few extensions are seeing jruby ports, for example EventMachine that you mentioned. and as far as i know the

How to set title for text_field?

☆樱花仙子☆ 提交于 2019-12-06 00:24:52
I know that is something simple, but I'm stuck. I have a several forms in my rails3 app to which I need to add tooltips, by using the tipsy . The text in tooltips should be determined in title\original-title, but I just can't figure it out, how to set it for text_field. <%= f.text_field :what %> gives me <input id="name_which" name="name[which]" size="30" type="text"> and I just can't figure it out, where to put the title text. For example, this one in html works fine <input type="text" name="tooltipform" title="Tooltip text"> In application.js it is determined by $(window).load(function() { $

JRuby calls the wrong method

旧时模样 提交于 2019-12-05 20:53:24
I got a strange problem with a call to a Java method from JRuby . In my Java class these methods are defined twice, and it appears JRuby calls the wrong one. So I tried to use java_method , but I always got a: TypeError: cannot convert instance of class org.jruby.RubyModule to class java.lang.Class Here's my Java code: public class Renderer { ... public void addRenderer(IElementRenderer r) { System.out.println("Added element render: " + r.getClass().toString()); basicRenderers.add(r); rendererMap.put(r.elementClass(), r); } public void addRenderer(IBasicRenderer r) { System.out.println("SHOULD

Can I define a Java subclass in ruby, then instantiate it in Java?

孤者浪人 提交于 2019-12-05 19:01:33
I'd like to define a superclass in Java, then define a subclass in Ruby, then make instances of that subclass in Java. A little something like this: // Java superclass package myPkg; public class Sup{ public Sup(){} public abstract void foo(String a); } -- # Ruby code include Java require 'jruby/core_ext' include_class 'myPkg.Sup' class RubySub < Java::myPkg.Sup def foo( a ) puts a; end end RubySub.become_java! RubySub -- // Back in Java land Ruby runtime = Ruby.newInstance(); IRubyObect ro = runtime.evalScriptlet(theRubyCodeAbove); Class<Sup> clz = (Class<Sup>) JavaEmbedUtils.rubyToJava

Casting Java Objects From JRuby

这一生的挚爱 提交于 2019-12-05 18:31:32
I'm working with a Java library in JRuby. I'm reading an object from a file, and I need to pass it as a different object type to a second constructor: @hmm_model = ObjectInputStream.new(FileInputStream.new(LINGPIPE_MODEL_PATH)) @tagger = HmmDecoder.new(@hmm_model) @hmm_model is of type ObjectInputStream, and needs to be cast to (HiddenMarkovModel). Obviously, that'd be easy in Java, it would just be: @tagger = HmmDecoder.new((HiddenMarkovModel)@hmm_model) But, of course, that doesn't work in JRuby. Is there actually any way to explicitly cast the @hmm_model to be of the correct type? So, I'm