1. Brett Giles
  2. lqpl

Commits

Brett Giles  committed f8a29ca

Various refactors and some updates for JRuby 1.7

  • Participants
  • Parent commits 81a0ac6
  • Branches master

Comments (0)

Files changed (5)

File GUI/spec/spec_helper.rb

View file
   java.lang.System.exit(status)
 end
 
+where_am_i = File.expand_path(File.dirname(__FILE__))
+$LOAD_PATH << where_am_i+"/../src"
 
-$LOAD_PATH << File.expand_path(File.dirname(__FILE__))+"/../src"
-$CLASSPATH << File.expand_path(File.dirname(__FILE__))+"/../lib/java/jruby-complete.jar"
-$CLASSPATH << File.expand_path(File.dirname(__FILE__))+"/../devlib/java/jemmy-2.3.0.0.jar"
-$CLASSPATH << File.expand_path(File.dirname(__FILE__))+"/../lib/java/forms_rt.jar"
-$CLASSPATH << File.expand_path(File.dirname(__FILE__))+"/../lib/java/monkeybars-1.1.1.jar"
-$CLASSPATH << File.expand_path(File.dirname(__FILE__))+"/../../out/lqpl_gui"
+# java classpath
+$CLASSPATH << where_am_i+"/../lib/java/jruby-complete.jar"
+$CLASSPATH << where_am_i+"/../devlib/java/jemmy-2.3.0.0.jar"
+$CLASSPATH << where_am_i+"/../lib/java/forms_rt.jar"
+$CLASSPATH << where_am_i+"/../lib/java/monkeybars-1.1.1.jar"
+$CLASSPATH << where_am_i+"/../../out/lqpl_gui"
 
-TEST_QP_PATH=File.expand_path(File.dirname(__FILE__))+"/../testdata/qplprograms/"
+TEST_QP_PATH = where_am_i+"/../testdata/qplprograms/"
 
 require 'manifest'
 

File GUI/src/main.rb

View file
 
 
 
-case Config::CONFIG["host_os"]
+case RbConfig::CONFIG["host_os"]
 when /darwin/i # OSX specific code
   testing = java.lang.System.get_property("com.drogar.testing.jemmy")
   if !testing or testing != "true"

File GUI/src/manifest.rb

View file
 when Monkeybars::Resolver::IN_JAR_FILE
   # Files to be added only when run from inside a jar file
 end
-require "exceptions/server_process_not_found"
-require "exceptions/invalid_input"
-require "communications/lqpl_emulator_server_connection"
-require "utility/translate_line_ends"
-require "communications/compiler_server_connection"
-# 
-require "lqpl/lqpl_controller"
-require "panels/quantum_stack/quantum_stack_controller"
-require "panels/classical_stack/classical_stack_controller"
-require "panels/dump/dump_controller"
-require "panels/executable_code/executable_code_controller"
-require "panels/stack_translation/stack_translation_controller"
-require "dialogs/simulate_results/simulate_results_controller"
-require "dialogs/about/about_controller"
+["server_process_not_found", "invalid_input"].each do |f|
+  require "exceptions/"+f
+end
+
+["translate_line_ends","xml_decode"].each do |f|
+  require "utility/"+f
+end
+
+["lqpl_emulator_server_connection","compiler_server_connection"].each do |f|
+  require "communications/"+f
+end
+
+{ ""=>["lqpl"], 
+  "panels/" => ["quantum_stack", "classical_stack","dump","executable_code", "stack_translation"],
+  "dialogs/" =>["simulate_results", "about"]}.each do |k,v|
+    v.each {|f|   require k+f+"/"+f+"_controller" }
+end
+
 require "exit_handler"
-require "utility/xml_decode"
+
 
 

File features/support/env.rb

View file
 java_import org.netbeans.jemmy.JemmyProperties
 java_import org.netbeans.jemmy.TestOut
 
-java_import org.netbeans.jemmy.operators.JFileChooserOperator
-java_import org.netbeans.jemmy.operators.Operator
-
-java_import org.netbeans.jemmy.operators.JButtonOperator
-java_import org.netbeans.jemmy.operators.JLabelOperator
-java_import org.netbeans.jemmy.operators.ContainerOperator
-java_import org.netbeans.jemmy.operators.JSpinnerOperator
-java_import org.netbeans.jemmy.operators.JTabbedPaneOperator
-java_import org.netbeans.jemmy.operators.JTextAreaOperator
-java_import org.netbeans.jemmy.operators.JFrameOperator
-java_import org.netbeans.jemmy.operators.JDialogOperator
-java_import org.netbeans.jemmy.operators.JMenuBarOperator
-java_import org.netbeans.jemmy.operators.JMenuOperator
-java_import org.netbeans.jemmy.operators.JMenuItemOperator
+["JFileChooserOperator","Operator","JButtonOperator","JLabelOperator","ContainerOperator",
+  "JSpinnerOperator","JTabbedPaneOperator","JTextAreaOperator","JFrameOperator",
+  "JDialogOperator","JMenuBarOperator","JMenuOperator","JMenuItemOperator"].each do |c|
+    java_import "org.netbeans.jemmy.operators."+c
+end
+
 java_import org.netbeans.jemmy.drivers.menus.AppleMenuDriver
 
 
   puts "Exception from main: #{e}"
 end
 
-java_import org.netbeans.jemmy.operators.JFrameOperator
 $qe_frame = JFrameOperator.new "Quantum Emulator"
 
 at_exit {

File rakelib/building.rake

View file
 
 end
 mac=false
-case Config::CONFIG["host_os"]
+case RbConfig::CONFIG["host_os"]
 when /darwin/i # OSX specific code
   tech="x86_64-apple-darwin"
   tar_options = "--disable-copyfile"