You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2013/09/24 12:51:51 UTC

svn commit: r1525840 - /buildr/trunk/lib/buildr/ide/idea.rb

Author: donaldp
Date: Tue Sep 24 10:51:51 2013
New Revision: 1525840

URL: http://svn.apache.org/r1525840
Log:
Improve the generation of the jruby facet by inspecting the .ruby-version file and generating an appropriate rbenv environment

Modified:
    buildr/trunk/lib/buildr/ide/idea.rb

Modified: buildr/trunk/lib/buildr/ide/idea.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/ide/idea.rb?rev=1525840&r1=1525839&r2=1525840&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/ide/idea.rb (original)
+++ buildr/trunk/lib/buildr/ide/idea.rb Tue Sep 24 10:51:51 2013
@@ -323,10 +323,15 @@ module Buildr #:nodoc:
 
       def add_jruby_facet(options = {})
         name = options[:name] || "JRuby"
-        jruby_version = options[:jruby_version] || "jruby-1.5.2-p249"
+
+        ruby_version_file = buildr_project._('.ruby-version')
+        default_jruby_version = File.exist?(ruby_version_file) ? "rbenv: #{IO.read(ruby_version_file).strip}" : 'jruby-1.6.7.2'
+        jruby_version = options[:jruby_version] || default_jruby_version
         add_facet(name, "JRUBY") do |f|
-          f.configuration(:number => 0) do |c|
+          f.configuration do |c|
             c.JRUBY_FACET_CONFIG_ID :NAME => "JRUBY_SDK_NAME", :VALUE => jruby_version
+            c.LOAD_PATH :number => "0"
+            c.I18N_FOLDERS :number => "0"
           end
         end
       end