Skip to content
Browse files

Build: Removing JRuby

git-svn-id: https://svn.openqa.org/svn/selenium-grid/trunk@355 22590ab4-ef3b-0410-9bef-a9f5a1089f47
  • Loading branch information...
1 parent dbb1624 commit 2f1368a36fb3975245c0c99e5304cf09c9fa1efe ph7 committed Aug 18, 2008
Showing with 113 additions and 14,701 deletions.
  1. +0 −10 Selenium Grid.ipr
  2. +113 −63 Selenium Grid.iws
  3. +0 −13 build.xml
  4. +0 −8 lib/build/common-build.xml
  5. +0 −31 src/scripts/jruby_sanity_check.rb
  6. +0 −2 tools/build.xml
  7. BIN vendor/jruby-1.1-RC2/bsf.jar
  8. BIN vendor/jruby-1.1-RC2/jruby.jar
  9. +0 −106 vendor/jruby-1.1-RC2/ruby/1.8/.document
  10. +0 −155 vendor/jruby-1.1-RC2/ruby/1.8/English.rb
  11. +0 −18 vendor/jruby-1.1-RC2/ruby/1.8/Env.rb
  12. +0 −96 vendor/jruby-1.1-RC2/ruby/1.8/README
  13. +0 −103 vendor/jruby-1.1-RC2/ruby/1.8/abbrev.rb
  14. +0 −133 vendor/jruby-1.1-RC2/ruby/1.8/base64.rb
  15. +0 −569 vendor/jruby-1.1-RC2/ruby/1.8/benchmark.rb
  16. +0 −85 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/jacobian.rb
  17. +0 −84 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/ludcmp.rb
  18. +0 −235 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/math.rb
  19. +0 −77 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/newton.rb
  20. +0 −65 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/util.rb
  21. +0 −272 vendor/jruby-1.1-RC2/ruby/1.8/cgi-lib.rb
  22. +0 −2,303 vendor/jruby-1.1-RC2/ruby/1.8/cgi.rb
  23. +0 −2 vendor/jruby-1.1-RC2/ruby/1.8/cgi/.document
  24. +0 −484 vendor/jruby-1.1-RC2/ruby/1.8/cgi/session.rb
  25. +0 −111 vendor/jruby-1.1-RC2/ruby/1.8/cgi/session/pstore.rb
  26. +0 −631 vendor/jruby-1.1-RC2/ruby/1.8/complex.rb
  27. +0 −992 vendor/jruby-1.1-RC2/ruby/1.8/csv.rb
  28. +0 −1,708 vendor/jruby-1.1-RC2/ruby/1.8/date.rb
  29. +0 −1,088 vendor/jruby-1.1-RC2/ruby/1.8/date/format.rb
  30. +0 −5 vendor/jruby-1.1-RC2/ruby/1.8/date2.rb
  31. +0 −949 vendor/jruby-1.1-RC2/ruby/1.8/debug.rb
  32. +0 −335 vendor/jruby-1.1-RC2/ruby/1.8/delegate.rb
  33. +0 −254 vendor/jruby-1.1-RC2/ruby/1.8/dl.rb
  34. +0 −2 vendor/jruby-1.1-RC2/ruby/1.8/drb.rb
  35. +0 −146 vendor/jruby-1.1-RC2/ruby/1.8/drb/acl.rb
  36. +0 −1,763 vendor/jruby-1.1-RC2/ruby/1.8/drb/drb.rb
  37. +0 −16 vendor/jruby-1.1-RC2/ruby/1.8/drb/eq.rb
  38. +0 −64 vendor/jruby-1.1-RC2/ruby/1.8/drb/extserv.rb
  39. +0 −96 vendor/jruby-1.1-RC2/ruby/1.8/drb/extservm.rb
  40. +0 −122 vendor/jruby-1.1-RC2/ruby/1.8/drb/gw.rb
  41. +0 −36 vendor/jruby-1.1-RC2/ruby/1.8/drb/invokemethod.rb
  42. +0 −22 vendor/jruby-1.1-RC2/ruby/1.8/drb/observer.rb
  43. +0 −190 vendor/jruby-1.1-RC2/ruby/1.8/drb/ssl.rb
  44. +0 −91 vendor/jruby-1.1-RC2/ruby/1.8/drb/timeridconv.rb
  45. +0 −108 vendor/jruby-1.1-RC2/ruby/1.8/drb/unix.rb
  46. +0 −195 vendor/jruby-1.1-RC2/ruby/1.8/e2mmap.rb
  47. +0 −826 vendor/jruby-1.1-RC2/ruby/1.8/erb.rb
  48. +0 −37 vendor/jruby-1.1-RC2/ruby/1.8/eregex.rb
Sorry, we could not display the entire diff because too many files (2,421) changed.
View
10 Selenium Grid.ipr
@@ -762,16 +762,6 @@
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/core/src/main" recursive="false" />
</library>
- <library name="Embedded JRuby">
- <CLASSES>
- <root url="file://$PROJECT_DIR$/vendor/jruby-1.1-RC2/ruby/1.8" />
- <root url="file://$PROJECT_DIR$/vendor/jruby-1.1-RC2/ruby" />
- <root url="jar://$PROJECT_DIR$/vendor/jruby-1.1-RC2/bsf.jar!/" />
- <root url="jar://$PROJECT_DIR$/vendor/jruby-1.1-RC2/jruby.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
<library name="TestNG">
<CLASSES>
<root url="jar://$PROJECT_DIR$/vendor/testng-5.7-jdk15.jar!/" />
View
176 Selenium Grid.iws
@@ -69,15 +69,11 @@
<list name="Failed commit: Failed commit: Failed commit: Default" comment="Renamed to com.thoughtworks.selenium.grid" />
<list name="Failed commit: Default (2)" comment="Renamed to com.thoughtworks.selenium.grid" />
<list default="true" name="All Uncommited Changes" comment="">
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/infrastructure/core/src/main/com/thoughtworks/selenium/grid/HttpParameters.java" afterPath="$PROJECT_DIR$/infrastructure/core/src/main/com/thoughtworks/selenium/grid/HttpParameters.java" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/remote-control/Remote Control.iml" afterPath="$PROJECT_DIR$/remote-control/Remote Control.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/All.iml" afterPath="$PROJECT_DIR$/All.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/hub/Hub.iml" afterPath="$PROJECT_DIR$/hub/Hub.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/MainServlet.java" afterPath="$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/MainServlet.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Selenium Grid.ipr" afterPath="$PROJECT_DIR$/Selenium Grid.ipr" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/tools/build.xml" afterPath="$PROJECT_DIR$/tools/build.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Selenium Grid.iws" afterPath="$PROJECT_DIR$/Selenium Grid.iws" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/infrastructure/core/Core.iml" afterPath="$PROJECT_DIR$/infrastructure/core/Core.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/infrastructure/webserver/src/test/unit/java/com/thoughtworks/selenium/grid/webserver/MainServletTest.java" afterPath="$PROJECT_DIR$/infrastructure/webserver/src/test/unit/java/com/thoughtworks/selenium/grid/webserver/MainServletTest.java" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/AgentResourceTest.java" afterPath="$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/AgentResourceTest.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/build/common-build.xml" afterPath="$PROJECT_DIR$/lib/build/common-build.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/build.xml" afterPath="$PROJECT_DIR$/build.xml" />
</list>
<ignored path="Selenium Grid.iws" />
<ignored path=".idea/workspace.xml" />
@@ -516,7 +512,7 @@
<file leaf-file-name="Resource.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/Resource.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="27" selection-start="175" selection-end="175" vertical-scroll-proportion="0.2">
+ <state line="8" column="27" selection-start="175" selection-end="175" vertical-scroll-proportion="0.21052632">
<folding />
</state>
</provider>
@@ -525,7 +521,7 @@
<file leaf-file-name="MainServlet.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/MainServlet.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="22" column="80" selection-start="599" selection-end="599" vertical-scroll-proportion="0.40215054">
+ <state line="22" column="80" selection-start="599" selection-end="599" vertical-scroll-proportion="0.4240363">
<folding />
</state>
</provider>
@@ -534,61 +530,61 @@
<file leaf-file-name="MainServletTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/test/unit/java/com/thoughtworks/selenium/grid/webserver/MainServletTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="136" column="84" selection-start="4644" selection-end="4644" vertical-scroll-proportion="0.33548388">
+ <state line="136" column="84" selection-start="4644" selection-end="4644" vertical-scroll-proportion="0.3537415">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="AgentResourceTest.java" pinned="false" current="true" current-in-tab="true">
+ <file leaf-file-name="AgentResourceTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/AgentResourceTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="98" selection-start="342" selection-end="342" vertical-scroll-proportion="0.2580645">
+ <state line="14" column="0" selection-start="360" selection-end="360" vertical-scroll-proportion="0.3809524">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="InvalidRouteException.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/InvalidRouteException.java">
+ <file leaf-file-name="Selenium Grid.ipr" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/Selenium Grid.ipr">
<provider selected="true" editor-type-id="text-editor">
- <state line="22" column="0" selection-start="478" selection-end="478" vertical-scroll-proportion="0.55">
+ <state line="764" column="19" selection-start="45904" selection-end="45904" vertical-scroll-proportion="0.56462586">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="RouteResolver.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/RouteResolver.java">
+ <file leaf-file-name="build.xml" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="13" selection-start="204" selection-end="204" vertical-scroll-proportion="0.225">
+ <state line="25" column="0" selection-start="997" selection-end="997" vertical-scroll-proportion="0.3035294">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="RouteResolver.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/RouteResolver.java">
+ <file leaf-file-name="common-build.xml" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/build/common-build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="23" selection-start="692" selection-end="692" vertical-scroll-proportion="0.475">
+ <state line="86" column="0" selection-start="2923" selection-end="2923" vertical-scroll-proportion="0.9435294">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="RouteResolverTest.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/RouteResolverTest.java">
+ <file leaf-file-name="build.xml" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/tools/build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="49" column="46" selection-start="1777" selection-end="1777" vertical-scroll-proportion="1.225">
+ <state line="22" column="51" selection-start="808" selection-end="808" vertical-scroll-proportion="0.5764706">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="RemoteControlCommand.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/RemoteControlCommand.java">
+ <file leaf-file-name="InvalidRouteException.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/InvalidRouteException.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="20" selection-start="301" selection-end="301" vertical-scroll-proportion="0.275">
+ <state line="22" column="0" selection-start="478" selection-end="478" vertical-scroll-proportion="0.57894737">
<folding />
</state>
</provider>
@@ -597,7 +593,7 @@
<file leaf-file-name="HttpParameters.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/infrastructure/core/src/main/com/thoughtworks/selenium/grid/HttpParameters.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="26" column="32" selection-start="679" selection-end="679" vertical-scroll-proportion="0.33333334">
+ <state line="26" column="32" selection-start="679" selection-end="679" vertical-scroll-proportion="0.3508772">
<folding />
</state>
</provider>
@@ -828,6 +824,60 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
</PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="Selenium Grid" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="All" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:/Users/ph7/Projects/Selenium Grid" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="Selenium Grid" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="All" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:/Users/ph7/Projects/Selenium Grid" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:/Users/ph7/Projects/Selenium Grid/src" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:/Users/ph7/Projects/Selenium Grid/src/scripts" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="Selenium Grid" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="All" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:/Users/ph7/Projects/Selenium Grid" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:/Users/ph7/Projects/Selenium Grid/src" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
</subPane>
</component>
<component name="ProjectReloadState">
@@ -1519,7 +1569,7 @@
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293011" order="6" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3661865" order="0" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.31417114" order="1" />
+ <window_info id="Find" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.31417114" order="1" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24927114" order="1" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.31417114" order="11" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39784947" order="5" />
@@ -1530,7 +1580,7 @@
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3921283" order="1" />
<window_info id="Maven projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32994923" order="4" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32436472" order="8" />
- <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.28208557" order="2" x="25" y="383" width="1379" height="169" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.28208557" order="2" x="25" y="383" width="1379" height="169" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24945612" order="2" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="0" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3957219" order="3" />
@@ -1663,114 +1713,114 @@
</buildFile>
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/remote-control/src/main/java/com/thoughtworks/selenium/grid/remotecontrol/OptionParser.java">
+ <entry file="file://$PROJECT_DIR$/agent/src/test/functional/java/com/thoughtworks/selenium/grid/agent/JMVMLauncherTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="13" selection-start="229" selection-end="229" vertical-scroll-proportion="0.2580645">
+ <state line="28" column="4" selection-start="934" selection-end="934" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/remote-control/src/main/java/com/thoughtworks/selenium/grid/remotecontrol/SelfRegisteringRemoteControl.java">
+ <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/AgentResource.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="13" column="41" selection-start="372" selection-end="400" vertical-scroll-proportion="0.33548388">
+ <state line="10" column="47" selection-start="303" selection-end="303" vertical-scroll-proportion="0.25">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/AgentRegistryTest.java">
+ <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/RouteResolver.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="13" selection-start="173" selection-end="173" vertical-scroll-proportion="0.15789473">
+ <state line="9" column="13" selection-start="204" selection-end="204" vertical-scroll-proportion="0.225">
<folding />
</state>
</provider>
</entry>
- <entry file="jar://$PROJECT_DIR$/vendor/servlet-api-2.5-6.1.5.jar!/javax/servlet/http/HttpServletRequest.class">
+ <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/RouteResolver.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="25" column="21" selection-start="785" selection-end="785" vertical-scroll-proportion="0.65789473">
+ <state line="19" column="23" selection-start="692" selection-end="692" vertical-scroll-proportion="0.475">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/test/functional/java/com/thoughtworks/selenium/grid/agent/JMVMLauncherTest.java">
+ <entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/RouteResolverTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="28" column="4" selection-start="934" selection-end="934" vertical-scroll-proportion="0.0">
+ <state line="49" column="46" selection-start="1777" selection-end="1777" vertical-scroll-proportion="1.2894737">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/AgentResource.java">
+ <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/RemoteControlCommand.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="47" selection-start="303" selection-end="303" vertical-scroll-proportion="0.25">
+ <state line="11" column="20" selection-start="301" selection-end="301" vertical-scroll-proportion="0.28947368">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/RouteResolver.java">
+ <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/InvalidRouteException.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="13" selection-start="204" selection-end="204" vertical-scroll-proportion="0.225">
+ <state line="22" column="0" selection-start="478" selection-end="478" vertical-scroll-proportion="0.57894737">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/RouteResolver.java">
+ <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/Resource.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="23" selection-start="692" selection-end="692" vertical-scroll-proportion="0.475">
+ <state line="8" column="27" selection-start="175" selection-end="175" vertical-scroll-proportion="0.21052632">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/RouteResolverTest.java">
+ <entry file="file://$PROJECT_DIR$/infrastructure/core/src/main/com/thoughtworks/selenium/grid/HttpParameters.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="49" column="46" selection-start="1777" selection-end="1777" vertical-scroll-proportion="1.225">
+ <state line="26" column="32" selection-start="679" selection-end="679" vertical-scroll-proportion="0.3508772">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/main/java/com/thoughtworks/selenium/grid/agent/RemoteControlCommand.java">
+ <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/MainServlet.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="20" selection-start="301" selection-end="301" vertical-scroll-proportion="0.275">
+ <state line="22" column="80" selection-start="599" selection-end="599" vertical-scroll-proportion="0.4240363">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/InvalidRouteException.java">
+ <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/test/unit/java/com/thoughtworks/selenium/grid/webserver/MainServletTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="22" column="0" selection-start="478" selection-end="478" vertical-scroll-proportion="0.55">
+ <state line="136" column="84" selection-start="4644" selection-end="4644" vertical-scroll-proportion="0.3537415">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/Resource.java">
+ <entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/AgentResourceTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="27" selection-start="175" selection-end="175" vertical-scroll-proportion="0.2">
+ <state line="14" column="0" selection-start="360" selection-end="360" vertical-scroll-proportion="0.3809524">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/infrastructure/core/src/main/com/thoughtworks/selenium/grid/HttpParameters.java">
+ <entry file="file://$PROJECT_DIR$/Selenium Grid.ipr">
<provider selected="true" editor-type-id="text-editor">
- <state line="26" column="32" selection-start="679" selection-end="679" vertical-scroll-proportion="0.33333334">
+ <state line="764" column="19" selection-start="45904" selection-end="45904" vertical-scroll-proportion="0.56462586">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/main/java/com/thoughtworks/selenium/grid/webserver/MainServlet.java">
+ <entry file="file://$PROJECT_DIR$/build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="22" column="80" selection-start="599" selection-end="599" vertical-scroll-proportion="0.40215054">
+ <state line="25" column="0" selection-start="997" selection-end="997" vertical-scroll-proportion="0.3035294">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/infrastructure/webserver/src/test/unit/java/com/thoughtworks/selenium/grid/webserver/MainServletTest.java">
+ <entry file="file://$PROJECT_DIR$/lib/build/common-build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="136" column="84" selection-start="4644" selection-end="4644" vertical-scroll-proportion="0.33548388">
+ <state line="86" column="0" selection-start="2923" selection-end="2923" vertical-scroll-proportion="0.9435294">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/agent/src/test/unit/java/com/thoughtworks/selenium/grid/agent/AgentResourceTest.java">
+ <entry file="file://$PROJECT_DIR$/tools/build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="98" selection-start="342" selection-end="342" vertical-scroll-proportion="0.2580645">
+ <state line="22" column="51" selection-start="808" selection-end="808" vertical-scroll-proportion="0.5764706">
<folding />
</state>
</provider>
View
13 build.xml
@@ -24,19 +24,6 @@
</condition>
<fail message="Your must use Java 1.5 or newer. You are currrenltly using '${ant.java.version}'." unless="java-5"/>
- <path id="jruby.classpath">
- <fileset dir="${basedir}/vendor/jruby-1.1-RC2">
- <include name="*.jar"/>
- </fileset>
- <pathelement path="${basedir}/vendor/jruby-1.1-RC2/ruby/1.8"/>
- </path>
-
- <java classname="org.jruby.Main" fork="true" failonerror="true">
- <classpath refid="jruby.classpath"/>
-
- <arg value="${basedir}/src/scripts/jruby_sanity_check.rb"/>
- </java>
-
<echo/>
<echo>******************************************************</echo>
<echo>Congratulations, your setup looks good. Happy hacking!</echo>
View
8 lib/build/common-build.xml
@@ -14,14 +14,6 @@
<property name="metrics.pmd.reports" location="${metrics.reports}/pmd"/>
<property name="metrics.coverage.reports" location="${metrics.reports}/coverage"/>
<property environment="env"/>
- <property name="jruby.test.dir" value="${basedir}/src/test/unit" />
-
- <path id="jruby.classpath">
- <fileset dir="${rootdir}/vendor/jruby-1.1-RC2">
- <include name="jruby.jar"/>
- </fileset>
- <pathelement path="${rootdir}/vendor/jruby-1.1-RC2/ruby/1.8"/>
- </path>
<path id="mocking.classpath">
<fileset dir="${rootdir}/vendor">
View
31 src/scripts/jruby_sanity_check.rb
@@ -1,31 +0,0 @@
-#
-# Validates JRuby Installation
-#
-
-EXPECTED_JRUBY_VERSION = "1.1RC2"
-FORUM_URL = "http://forums.openqa.org/forum.jspa?forumID=42"
-
-unless defined? JRUBY_VERSION
- raise "Sorry you must run this script with JRuby"
-end
-
-puts "Detected JRuby #{JRUBY_VERSION}"
-unless JRUBY_VERSION == EXPECTED_JRUBY_VERSION
- raise <<-EOS
- Selenium Grid has been tested with JRuby #{EXPECTED_JRUBY_VERSION}. You are using #{JRUBY_VERSION}.
- Download it at http://jruby.codehaus.org
- EOS
-end
-
-begin
- $: << File.expand_path(File.dirname(__FILE__) + '/../../vendor/gems/mocha-0.5.5/lib')
- require File.expand_path(File.dirname(__FILE__) + '/../../vendor/gems/mocha-0.5.5/lib/mocha')
- puts "Successfully loaded Mocha library."
-rescue
- puts <<-EOS
- Sorry, we could not load the Mocha library, feel free to report your problem
- on Selenium Grid forums (#{FORUM_URL}).
- We will do our best to help you get started.
- EOS
- raise
-end
View
2 tools/build.xml
@@ -20,8 +20,6 @@
<pathelement path="${java.class.path}/"/>
</path>
- <target name="jruby-test" depends="compile" description="Run JRuby Tests" />
-
<target name="package-standalone" depends="package" description="Package as a jar including all dependencies">
<package-standalone-jar main-class="">
<dependencies>
View
BIN vendor/jruby-1.1-RC2/bsf.jar
Binary file not shown.
View
BIN vendor/jruby-1.1-RC2/jruby.jar
Binary file not shown.
View
106 vendor/jruby-1.1-RC2/ruby/1.8/.document
@@ -1,106 +0,0 @@
-# We only run RDoc on the top-level files in here: we skip
-# all the helper stuff in sub-directories
-
-# Eventually, we hope to see...
-# *.rb
-
-# But for now
-
-English.rb
-Env.rb
-README
-abbrev.rb
-base64.rb
-benchmark.rb
-cgi
-cgi.rb
-cgi-lib.rb
-complex.rb
-csv.rb
-date
-date.rb
-date2.rb
-debug.rb
-delegate.rb
-drb
-drb.rb
-e2mmap.rb
-erb.rb
-eregex.rb
-fileutils.rb
-finalize.rb
-find.rb
-forwardable.rb
-ftools.rb
-generator.rb
-getoptlong.rb
-getopts.rb
-gserver.rb
-importenv.rb
-ipaddr.rb
-irb
-irb.rb
-jcode.rb
-logger.rb
-mailread.rb
-mathn.rb
-matrix.rb
-mkmf.rb
-monitor.rb
-mutex_m.rb
-net
-observer.rb
-open-uri.rb
-open3.rb
-optparse
-optparse.rb
-ostruct.rb
-parsearg.rb
-parsedate.rb
-pathname.rb
-ping.rb
-pp.rb
-prettyprint.rb
-profile.rb
-profiler.rb
-pstore.rb
-racc
-rational.rb
-rdoc
-readbytes.rb
-resolv-replace.rb
-resolv.rb
-rexml
-rinda
-rss
-rss.rb
-rubyunit.rb
-runit
-scanf.rb
-set.rb
-shell
-shell.rb
-shellwords.rb
-singleton.rb
-soap
-sync.rb
-tempfile.rb
-test
-thread.rb
-thwait.rb
-time.rb
-timeout.rb
-tmpdir.rb
-tracer.rb
-tsort.rb
-un.rb
-uri
-uri.rb
-weakref.rb
-webrick
-webrick.rb
-wsdl
-xmlrpc
-xsd
-yaml
-yaml.rb
View
155 vendor/jruby-1.1-RC2/ruby/1.8/English.rb
@@ -1,155 +0,0 @@
-# Include the English library file in a Ruby script, and you can
-# reference the global variables such as \VAR{\$\_} using less
-# cryptic names, listed in the following table.% \vref{tab:english}.
-#
-# Without 'English':
-#
-# $\ = ' -- '
-# "waterbuffalo" =~ /buff/
-# print $", $', $$, "\n"
-#
-# With English:
-#
-# require "English"
-#
-# $OUTPUT_FIELD_SEPARATOR = ' -- '
-# "waterbuffalo" =~ /buff/
-# print $LOADED_FEATURES, $POSTMATCH, $PID, "\n"
-
-
-# The exception object passed to +raise+.
-alias $ERROR_INFO $!
-
-# The stack backtrace generated by the last
-# exception. <tt>See Kernel.caller</tt> for details. Thread local.
-alias $ERROR_POSITION $@
-
-# The default separator pattern used by <tt>String.split</tt>. May be
-# set from the command line using the <tt>-F</tt> flag.
-alias $FS $;
-
-# The default separator pattern used by <tt>String.split</tt>. May be
-# set from the command line using the <tt>-F</tt> flag.
-alias $FIELD_SEPARATOR $;
-
-# The separator string output between the parameters to methods such
-# as <tt>Kernel.print</tt> and <tt>Array.join</tt>. Defaults to +nil+,
-# which adds no text.
-alias $OFS $,
-
-# The separator string output between the parameters to methods such
-# as <tt>Kernel.print</tt> and <tt>Array.join</tt>. Defaults to +nil+,
-# which adds no text.
-alias $OUTPUT_FIELD_SEPARATOR $,
-
-# The input record separator (newline by default). This is the value
-# that routines such as <tt>Kernel.gets</tt> use to determine record
-# boundaries. If set to +nil+, +gets+ will read the entire file.
-alias $RS $/
-
-# The input record separator (newline by default). This is the value
-# that routines such as <tt>Kernel.gets</tt> use to determine record
-# boundaries. If set to +nil+, +gets+ will read the entire file.
-alias $INPUT_RECORD_SEPARATOR $/
-
-# The string appended to the output of every call to methods such as
-# <tt>Kernel.print</tt> and <tt>IO.write</tt>. The default value is
-# +nil+.
-alias $ORS $\
-
-# The string appended to the output of every call to methods such as
-# <tt>Kernel.print</tt> and <tt>IO.write</tt>. The default value is
-# +nil+.
-alias $OUTPUT_RECORD_SEPARATOR $\
-
-# The number of the last line read from the current input file.
-alias $INPUT_LINE_NUMBER $.
-
-# The number of the last line read from the current input file.
-alias $NR $.
-
-# The last line read by <tt>Kernel.gets</tt> or
-# <tt>Kernel.readline</tt>. Many string-related functions in the
-# +Kernel+ module operate on <tt>$_</tt> by default. The variable is
-# local to the current scope. Thread local.
-alias $LAST_READ_LINE $_
-
-# The destination of output for <tt>Kernel.print</tt>
-# and <tt>Kernel.printf</tt>. The default value is
-# <tt>$stdout</tt>.
-alias $DEFAULT_OUTPUT $>
-
-# An object that provides access to the concatenation
-# of the contents of all the files
-# given as command-line arguments, or <tt>$stdin</tt>
-# (in the case where there are no
-# arguments). <tt>$<</tt> supports methods similar to a
-# +File+ object:
-# +inmode+, +close+,
-# <tt>closed?</tt>, +each+,
-# <tt>each_byte</tt>, <tt>each_line</tt>,
-# +eof+, <tt>eof?</tt>, +file+,
-# +filename+, +fileno+,
-# +getc+, +gets+, +lineno+,
-# <tt>lineno=</tt>, +path+,
-# +pos+, <tt>pos=</tt>,
-# +read+, +readchar+,
-# +readline+, +readlines+,
-# +rewind+, +seek+, +skip+,
-# +tell+, <tt>to_a</tt>, <tt>to_i</tt>,
-# <tt>to_io</tt>, <tt>to_s</tt>, along with the
-# methods in +Enumerable+. The method +file+
-# returns a +File+ object for the file currently
-# being read. This may change as <tt>$<</tt> reads
-# through the files on the command line. Read only.
-alias $DEFAULT_INPUT $<
-
-# The process number of the program being executed. Read only.
-alias $PID $$
-
-# The process number of the program being executed. Read only.
-alias $PROCESS_ID $$
-
-# The exit status of the last child process to terminate. Read
-# only. Thread local.
-alias $CHILD_STATUS $?
-
-# A +MatchData+ object that encapsulates the results of a successful
-# pattern match. The variables <tt>$&</tt>, <tt>$`</tt>, <tt>$'</tt>,
-# and <tt>$1</tt> to <tt>$9</tt> are all derived from
-# <tt>$~</tt>. Assigning to <tt>$~</tt> changes the values of these
-# derived variables. This variable is local to the current
-# scope. Thread local.
-alias $LAST_MATCH_INFO $~
-
-# If set to any value apart from +nil+ or +false+, all pattern matches
-# will be case insensitive, string comparisons will ignore case, and
-# string hash values will be case insensitive. Deprecated
-alias $IGNORECASE $=
-
-# An array of strings containing the command-line
-# options from the invocation of the program. Options
-# used by the Ruby interpreter will have been
-# removed. Read only. Also known simply as +ARGV+.
-alias $ARGV $*
-
-# The string matched by the last successful pattern
-# match. This variable is local to the current
-# scope. Read only. Thread local.
-alias $MATCH $&
-
-# The string preceding the match in the last
-# successful pattern match. This variable is local to
-# the current scope. Read only. Thread local.
-alias $PREMATCH $`
-
-# The string following the match in the last
-# successful pattern match. This variable is local to
-# the current scope. Read only. Thread local.
-alias $POSTMATCH $'
-
-# The contents of the highest-numbered group matched in the last
-# successful pattern match. Thus, in <tt>"cat" =~ /(c|a)(t|z)/</tt>,
-# <tt>$+</tt> will be set to "t". This variable is local to the
-# current scope. Read only. Thread local.
-alias $LAST_PAREN_MATCH $+
View
18 vendor/jruby-1.1-RC2/ruby/1.8/Env.rb
@@ -1,18 +0,0 @@
-# Env.rb -- imports environment variables as global variables, Perlish ;(
-# Usage:
-#
-# require 'Env'
-# p $USER
-# $USER = "matz"
-# p ENV["USER"]
-
-require 'importenv'
-
-if __FILE__ == $0
- p $TERM
- $TERM = nil
- p $TERM
- p ENV["TERM"]
- $TERM = "foo"
- p ENV["TERM"]
-end
View
96 vendor/jruby-1.1-RC2/ruby/1.8/README
@@ -1,96 +0,0 @@
-English.rb lets Perl'ish global variables have English names
-Env.rb loads importenv.rb
-README this file
-base64.rb encodes/decodes base64 (obsolete)
-benchmark.rb a benchmark utility
-cgi-lib.rb simple CGI support library (old style)
-cgi.rb CGI support library
-cgi/session.rb CGI session class
-complex.rb complex number support
-csv.rb CSV parser/generator
-date.rb date object
-date/format.rb date parsing and formatting
-date2.rb date object (obsolete; use date)
-debug.rb ruby debugger
-delegate.rb delegates messages to other object
-drb.rb distributed Ruby
-e2mmap.rb exception utilities
-erb.rb tiny eRuby library
-eregex.rb extended regular expression (just a proof of concept)
-fileutils.rb file utilities
-finalize.rb adds finalizer to the object
-find.rb traverses directory tree
-forwardable.rb explicit delegation library
-ftools.rb file tools
-getoptlong.rb GNU getoptlong compatible
-getopts.rb parses command line options (use getoptlong)
-gserver.rb general TCP server
-importenv.rb imports environment variables as global variables
-ipaddr.rb defines the IPAddr class
-irb.rb interactive ruby
-jcode.rb Japanese text handling (replace String methods)
-logger.rb simple logging utility
-mailread.rb reads mail headers
-mathn.rb extended math operation
-matrix.rb matrix calculation library
-mkmf.rb Makefile maker
-monitor.rb exclusive region monitor for thread
-mutex_m.rb mutex mixin
-net/ftp.rb ftp access
-net/http.rb HTTP access
-net/imap.rb IMAP4 access
-net/pop.rb POP3 access
-net/protocol.rb abstract class for net library (DO NOT USE)
-net/smtp.rb SMTP access
-net/telnet.rb telnet library
-observer.rb observer desing pattern library (provides Observable)
-open-uri.rb easy-to-use network interface using URI and Net
-open3.rb opens subprocess connection stdin/stdout/stderr
-optparse.rb command line option analysis
-ostruct.rb python style object
-parsearg.rb argument parser using getopts
-parsedate.rb parses date string
-pathname.rb Object-Oriented Pathname Class
-ping.rb checks whether host is up, using TCP echo.
-pp.rb pretty print objects
-prettyprint.rb pretty printing algorithm
-profile.rb runs ruby profiler
-profiler.rb ruby profiler module
-pstore.rb persistent object strage using marshal
-racc/parser.rb racc (Ruby yACC) runtime
-rational.rb rational number support
-rdoc source-code documentation tool
-readbytes.rb define IO#readbytes
-resolv-replace.rb replace Socket DNS by resolve.rb
-resolv.rb DNS resolver in Ruby
-rexml an XML parser for Ruby, in Ruby
-rubyunit.rb original Ruby Unit testing framework
-scanf.rb scanf for Ruby
-set.rb defines the Set class
-shell.rb runs commands and does pipeline operations like shell
-shellwords.rb split into words like shell
-singleton.rb singleton design pattern library
-soap SOAP 1.1 implementation
-sync.rb 2 phase lock
-tempfile.rb temporary file with automatic removal
-test/unit Ruby Unit Testing Framework
-thread.rb thread support
-thwait.rb thread syncronization class
-time.rb RFC2822, RFC2616, ISO8601 style time formatting/parsing
-timeout.rb provides timeout
-tmpdir.rb retrieve temporary directory path
-tracer.rb execution tracer
-tsort.rb topological sorting
-un.rb Utilities to replace common UNIX commands in Makefiles etc
-uri.rb URI support
-uri/ftp.rb ftp scheme support
-uri/http.rb http scheme support
-uri/https.rb https scheme support
-uri/ldap.rb ldap scheme support
-uri/mailto.rb mailto scheme support
-weakref.rb weak reference class
-webrick.rb WEB server toolkit
-wsdl WSDL 1.1 implementation
-xmlrpc XML-RPC implementation
-xsd XML Schema Datatypes implementation
-yaml.rb YAML implementation
View
103 vendor/jruby-1.1-RC2/ruby/1.8/abbrev.rb
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-=begin
-#
-# Copyright (c) 2001,2003 Akinori MUSHA <knu@iDaemons.org>
-#
-# All rights reserved. You can redistribute and/or modify it under
-# the same terms as Ruby.
-#
-# $Idaemons: /home/cvs/rb/abbrev.rb,v 1.2 2001/05/30 09:37:45 knu Exp $
-# $RoughId: abbrev.rb,v 1.4 2003/10/14 19:45:42 knu Exp $
-# $Id: abbrev.rb 2906 2007-02-02 00:35:06Z headius $
-=end
-
-# Calculate the set of unique abbreviations for a given set of strings.
-#
-# require 'abbrev'
-# require 'pp'
-#
-# pp Abbrev::abbrev(['ruby', 'rules']).sort
-#
-# <i>Generates:</i>
-#
-# [["rub", "ruby"],
-# ["ruby", "ruby"],
-# ["rul", "rules"],
-# ["rule", "rules"],
-# ["rules", "rules"]]
-#
-# Also adds an +abbrev+ method to class +Array+.
-
-module Abbrev
-
- # Given a set of strings, calculate the set of unambiguous
- # abbreviations for those strings, and return a hash where the keys
- # are all the possible abbreviations and the values are the full
- # strings. Thus, given input of "car" and "cone", the keys pointing
- # to "car" would be "ca" and "car", while those pointing to "cone"
- # would be "co", "con", and "cone".
- #
- # The optional +pattern+ parameter is a pattern or a string. Only
- # those input strings matching the pattern, or begging the string,
- # are considered for inclusion in the output hash
-
- def abbrev(words, pattern = nil)
- table = {}
- seen = Hash.new(0)
-
- if pattern.is_a?(String)
- pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix
- end
-
- words.each do |word|
- next if (abbrev = word).empty?
- while (len = abbrev.rindex(/[\w\W]\z/)) > 0
- abbrev = word[0,len]
-
- next if pattern && pattern !~ abbrev
-
- case seen[abbrev] += 1
- when 1
- table[abbrev] = word
- when 2
- table.delete(abbrev)
- else
- break
- end
- end
- end
-
- words.each do |word|
- next if pattern && pattern !~ word
-
- table[word] = word
- end
-
- table
- end
-
- module_function :abbrev
-end
-
-class Array
- # Calculates the set of unambiguous abbreviations for the strings in
- # +self+. If passed a pattern or a string, only the strings matching
- # the pattern or starting with the string are considered.
- #
- # %w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
- # "co" => "cone", "con" => cone",
- # "cone" => "cone" }
- def abbrev(pattern = nil)
- Abbrev::abbrev(self, pattern)
- end
-end
-
-if $0 == __FILE__
- while line = gets
- hash = line.split.abbrev
-
- hash.sort.each do |k, v|
- puts "#{k} => #{v}"
- end
- end
-end
View
133 vendor/jruby-1.1-RC2/ruby/1.8/base64.rb
@@ -1,133 +0,0 @@
-#
-# = base64.rb: methods for base64-encoding and -decoding stings
-#
-# Author:: Yukihiro Matsumoto
-# Documentation:: Dave Thomas and Gavin Sinclair
-#
-# Until Ruby 1.8.1, these methods were defined at the top-level. Now
-# they are in the Base64 module but included in the top-level, where
-# their usage is deprecated.
-#
-# See Base64 for documentation.
-#
-
-require "kconv"
-
-
-# The Base64 module provides for the encoding (#encode64) and decoding
-# (#decode64) of binary data using a Base64 representation.
-#
-# The following particular features are also provided:
-# - encode into lines of a given length (#b64encode)
-# - decode the special format specified in RFC2047 for the
-# representation of email headers (decode_b)
-#
-# == Example
-#
-# A simple encoding and decoding.
-#
-# require "base64"
-#
-# enc = Base64.encode64('Send reinforcements')
-# # -> "U2VuZCByZWluZm9yY2VtZW50cw==\n"
-# plain = Base64.decode64(enc)
-# # -> "Send reinforcements"
-#
-# The purpose of using base64 to encode data is that it translates any
-# binary data into purely printable characters. It is specified in
-# RFC 2045 (http://www.faqs.org/rfcs/rfc2045.html).
-
-module Base64
- module_function
-
- # Returns the Base64-decoded version of +str+.
- #
- # require 'base64'
- # str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' +
- # 'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' +
- # 'ZSB0aHJlZQpBbmQgc28gb24uLi4K'
- # puts Base64.decode64(str)
- #
- # <i>Generates:</i>
- #
- # This is line one
- # This is line two
- # This is line three
- # And so on...
-
- def decode64(str)
- str.unpack("m")[0]
- end
-
-
- # Decodes text formatted using a subset of RFC2047 (the one used for
- # mime-encoding mail headers).
- #
- # Only supports an encoding type of 'b' (base 64), and only supports
- # the character sets ISO-2022-JP and SHIFT_JIS (so the only two
- # encoded word sequences recognized are <tt>=?ISO-2022-JP?B?...=</tt> and
- # <tt>=?SHIFT_JIS?B?...=</tt>). Recognition of these sequences is case
- # insensitive.
-
- def decode_b(str)
- str.gsub!(/=\?ISO-2022-JP\?B\?([!->@-~]+)\?=/i) {
- decode64($1)
- }
- str = Kconv::toeuc(str)
- str.gsub!(/=\?SHIFT_JIS\?B\?([!->@-~]+)\?=/i) {
- decode64($1)
- }
- str = Kconv::toeuc(str)
- str.gsub!(/\n/, ' ')
- str.gsub!(/\0/, '')
- str
- end
-
- # Returns the Base64-encoded version of +str+.
- #
- # require 'base64'
- # Base64.b64encode("Now is the time for all good coders\nto learn Ruby")
- #
- # <i>Generates:</i>
- #
- # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
- # UnVieQ==
-
- def encode64(bin)
- [bin].pack("m")
- end
-
- # _Prints_ the Base64 encoded version of +bin+ (a +String+) in lines of
- # +len+ (default 60) characters.
- #
- # require 'base64'
- # data = "Now is the time for all good coders\nto learn Ruby"
- # Base64.b64encode(data)
- #
- # <i>Generates:</i>
- #
- # Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
- # UnVieQ==
-
- def b64encode(bin, len = 60)
- encode64(bin).scan(/.{1,#{len}}/) do
- print $&, "\n"
- end
- end
-
-
- module Deprecated # :nodoc:
- include Base64
-
- for m in Base64.private_instance_methods(false)
- module_eval %{
- def #{m}(*args)
- warn("\#{caller(1)[0]}: #{m} is deprecated; use Base64.#{m} instead")
- super
- end
- }
- end
- end
-end
-
-include Base64::Deprecated
View
569 vendor/jruby-1.1-RC2/ruby/1.8/benchmark.rb
@@ -1,569 +0,0 @@
-=begin
-#
-# benchmark.rb - a performance benchmarking library
-#
-# $Id: benchmark.rb 2062 2006-06-10 19:14:15Z headius $
-#
-# Created by Gotoken (gotoken@notwork.org).
-#
-# Documentation by Gotoken (original RD), Lyle Johnson (RDoc conversion), and
-# Gavin Sinclair (editing).
-#
-=end
-
-# == Overview
-#
-# The Benchmark module provides methods for benchmarking Ruby code, giving
-# detailed reports on the time taken for each task.
-#
-
-# The Benchmark module provides methods to measure and report the time
-# used to execute Ruby code.
-#
-# * Measure the time to construct the string given by the expression
-# <tt>"a"*1_000_000</tt>:
-#
-# require 'benchmark'
-#
-# puts Benchmark.measure { "a"*1_000_000 }
-#
-# On my machine (FreeBSD 3.2 on P5, 100MHz) this generates:
-#
-# 1.166667 0.050000 1.216667 ( 0.571355)
-#
-# This report shows the user CPU time, system CPU time, the sum of
-# the user and system CPU times, and the elapsed real time. The unit
-# of time is seconds.
-#
-# * Do some experiments sequentially using the #bm method:
-#
-# require 'benchmark'
-#
-# n = 50000
-# Benchmark.bm do |x|
-# x.report { for i in 1..n; a = "1"; end }
-# x.report { n.times do ; a = "1"; end }
-# x.report { 1.upto(n) do ; a = "1"; end }
-# end
-#
-# The result:
-#
-# user system total real
-# 1.033333 0.016667 1.016667 ( 0.492106)
-# 1.483333 0.000000 1.483333 ( 0.694605)
-# 1.516667 0.000000 1.516667 ( 0.711077)
-#
-# * Continuing the previous example, put a label in each report:
-#
-# require 'benchmark'
-#
-# n = 50000
-# Benchmark.bm(7) do |x|
-# x.report("for:") { for i in 1..n; a = "1"; end }
-# x.report("times:") { n.times do ; a = "1"; end }
-# x.report("upto:") { 1.upto(n) do ; a = "1"; end }
-# end
-#
-# The result:
-#
-# user system total real
-# for: 1.050000 0.000000 1.050000 ( 0.503462)
-# times: 1.533333 0.016667 1.550000 ( 0.735473)
-# upto: 1.500000 0.016667 1.516667 ( 0.711239)
-#
-#
-# * The times for some benchmarks depend on the order in which items
-# are run. These differences are due to the cost of memory
-# allocation and garbage collection. To avoid these discrepancies,
-# the #bmbm method is provided. For example, to compare ways to
-# sort an array of floats:
-#
-# require 'benchmark'
-#
-# array = (1..1000000).map { rand }
-#
-# Benchmark.bmbm do |x|
-# x.report("sort!") { array.dup.sort! }
-# x.report("sort") { array.dup.sort }
-# end
-#
-# The result:
-#
-# Rehearsal -----------------------------------------
-# sort! 11.928000 0.010000 11.938000 ( 12.756000)
-# sort 13.048000 0.020000 13.068000 ( 13.857000)
-# ------------------------------- total: 25.006000sec
-#
-# user system total real
-# sort! 12.959000 0.010000 12.969000 ( 13.793000)
-# sort 12.007000 0.000000 12.007000 ( 12.791000)
-#
-#
-# * Report statistics of sequential experiments with unique labels,
-# using the #benchmark method:
-#
-# require 'benchmark'
-#
-# n = 50000
-# Benchmark.benchmark(" "*7 + CAPTION, 7, FMTSTR, ">total:", ">avg:") do |x|
-# tf = x.report("for:") { for i in 1..n; a = "1"; end }
-# tt = x.report("times:") { n.times do ; a = "1"; end }
-# tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
-# [tf+tt+tu, (tf+tt+tu)/3]
-# end
-#
-# The result:
-#
-# user system total real
-# for: 1.016667 0.016667 1.033333 ( 0.485749)
-# times: 1.450000 0.016667 1.466667 ( 0.681367)
-# upto: 1.533333 0.000000 1.533333 ( 0.722166)
-# >total: 4.000000 0.033333 4.033333 ( 1.889282)
-# >avg: 1.333333 0.011111 1.344444 ( 0.629761)
-
-module Benchmark
-
- BENCHMARK_VERSION = "2002-04-25" #:nodoc"
-
- def Benchmark::times() # :nodoc:
- Process::times()
- end
-
-
- # Invokes the block with a <tt>Benchmark::Report</tt> object, which
- # may be used to collect and report on the results of individual
- # benchmark tests. Reserves <i>label_width</i> leading spaces for
- # labels on each line. Prints _caption_ at the top of the
- # report, and uses _fmt_ to format each line.
- # If the block returns an array of
- # <tt>Benchmark::Tms</tt> objects, these will be used to format
- # additional lines of output. If _label_ parameters are
- # given, these are used to label these extra lines.
- #
- # _Note_: Other methods provide a simpler interface to this one, and are
- # suitable for nearly all benchmarking requirements. See the examples in
- # Benchmark, and the #bm and #bmbm methods.
- #
- # Example:
- #
- # require 'benchmark'
- # include Benchmark # we need the CAPTION and FMTSTR constants
- #
- # n = 50000
- # Benchmark.benchmark(" "*7 + CAPTION, 7, FMTSTR, ">total:", ">avg:") do |x|
- # tf = x.report("for:") { for i in 1..n; a = "1"; end }
- # tt = x.report("times:") { n.times do ; a = "1"; end }
- # tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end }
- # [tf+tt+tu, (tf+tt+tu)/3]
- # end
- #
- # <i>Generates:</i>
- #
- # user system total real
- # for: 1.016667 0.016667 1.033333 ( 0.485749)
- # times: 1.450000 0.016667 1.466667 ( 0.681367)
- # upto: 1.533333 0.000000 1.533333 ( 0.722166)
- # >total: 4.000000 0.033333 4.033333 ( 1.889282)
- # >avg: 1.333333 0.011111 1.344444 ( 0.629761)
- #
-
- def benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) # :yield: report
- sync = STDOUT.sync
- STDOUT.sync = true
- label_width ||= 0
- fmtstr ||= FMTSTR
- raise ArgumentError, "no block" unless iterator?
- print caption
- results = yield(Report.new(label_width, fmtstr))
- Array === results and results.grep(Tms).each {|t|
- print((labels.shift || t.label || "").ljust(label_width),
- t.format(fmtstr))
- }
- STDOUT.sync = sync
- end
-
-
- # A simple interface to the #benchmark method, #bm is generates sequential reports
- # with labels. The parameters have the same meaning as for #benchmark.
- #
- # require 'benchmark'
- #
- # n = 50000
- # Benchmark.bm(7) do |x|
- # x.report("for:") { for i in 1..n; a = "1"; end }
- # x.report("times:") { n.times do ; a = "1"; end }
- # x.report("upto:") { 1.upto(n) do ; a = "1"; end }
- # end
- #
- # <i>Generates:</i>
- #
- # user system total real
- # for: 1.050000 0.000000 1.050000 ( 0.503462)
- # times: 1.533333 0.016667 1.550000 ( 0.735473)
- # upto: 1.500000 0.016667 1.516667 ( 0.711239)
- #
-
- def bm(label_width = 0, *labels, &blk) # :yield: report
- benchmark(" "*label_width + CAPTION, label_width, FMTSTR, *labels, &blk)
- end
-
-
- # Sometimes benchmark results are skewed because code executed
- # earlier encounters different garbage collection overheads than
- # that run later. #bmbm attempts to minimize this effect by running
- # the tests twice, the first time as a rehearsal in order to get the
- # runtime environment stable, the second time for
- # real. <tt>GC.start</tt> is executed before the start of each of
- # the real timings; the cost of this is not included in the
- # timings. In reality, though, there's only so much that #bmbm can
- # do, and the results are not guaranteed to be isolated from garbage
- # collection and other effects.
- #
- # Because #bmbm takes two passes through the tests, it can
- # calculate the required label width.
- #
- # require 'benchmark'
- #
- # array = (1..1000000).map { rand }
- #
- # Benchmark.bmbm do |x|
- # x.report("sort!") { array.dup.sort! }
- # x.report("sort") { array.dup.sort }
- # end
- #
- # <i>Generates:</i>
- #
- # Rehearsal -----------------------------------------
- # sort! 11.928000 0.010000 11.938000 ( 12.756000)
- # sort 13.048000 0.020000 13.068000 ( 13.857000)
- # ------------------------------- total: 25.006000sec
- #
- # user system total real
- # sort! 12.959000 0.010000 12.969000 ( 13.793000)
- # sort 12.007000 0.000000 12.007000 ( 12.791000)
- #
- # #bmbm yields a Benchmark::Job object and returns an array of
- # Benchmark::Tms objects.
- #
- def bmbm(width = 0, &blk) # :yield: job
- job = Job.new(width)
- yield(job)
- width = job.width
- sync = STDOUT.sync
- STDOUT.sync = true
-
- # rehearsal
- print "Rehearsal "
- puts '-'*(width+CAPTION.length - "Rehearsal ".length)
- list = []
- job.list.each{|label,item|
- print(label.ljust(width))
- res = Benchmark::measure(&item)
- print res.format()
- list.push res
- }
- sum = Tms.new; list.each{|i| sum += i}
- ets = sum.format("total: %tsec")
- printf("%s %s\n\n",
- "-"*(width+CAPTION.length-ets.length-1), ets)
-
- # take
- print ' '*width, CAPTION
- list = []
- ary = []
- job.list.each{|label,item|
- GC::start
- print label.ljust(width)
- res = Benchmark::measure(&item)
- print res.format()
- ary.push res
- list.push [label, res]
- }
-
- STDOUT.sync = sync
- ary
- end
-
- #
- # Returns the time used to execute the given block as a
- # Benchmark::Tms object.
- #
- def measure(label = "") # :yield:
- t0, r0 = Benchmark.times, Time.now
- yield
- t1, r1 = Benchmark.times, Time.now
- Benchmark::Tms.new(t1.utime - t0.utime,
- t1.stime - t0.stime,
- t1.cutime - t0.cutime,
- t1.cstime - t0.cstime,
- r1.to_f - r0.to_f,
- label)
- end
-
- #
- # Returns the elapsed real time used to execute the given block.
- #
- def realtime(&blk) # :yield:
- Benchmark::measure(&blk).real
- end
-
-
-
- #
- # A Job is a sequence of labelled blocks to be processed by the
- # Benchmark.bmbm method. It is of little direct interest to the user.
- #
- class Job # :nodoc:
- #
- # Returns an initialized Job instance.
- # Usually, one doesn't call this method directly, as new
- # Job objects are created by the #bmbm method.
- # _width_ is a initial value for the label offset used in formatting;
- # the #bmbm method passes its _width_ argument to this constructor.
- #
- def initialize(width)
- @width = width
- @list = []
- end
-
- #
- # Registers the given label and block pair in the job list.
- #
- def item(label = "", &blk) # :yield:
- raise ArgmentError, "no block" unless block_given?
- label.concat ' '
- w = label.length
- @width = w if @width < w
- @list.push [label, blk]
- self
- end
-
- alias report item
-
- # An array of 2-element arrays, consisting of label and block pairs.
- attr_reader :list
-
- # Length of the widest label in the #list, plus one.
- attr_reader :width
- end
-
- module_function :benchmark, :measure, :realtime, :bm, :bmbm
-
-
-
- #
- # This class is used by the Benchmark.benchmark and Benchmark.bm methods.
- # It is of little direct interest to the user.
- #
- class Report # :nodoc:
- #
- # Returns an initialized Report instance.
- # Usually, one doesn't call this method directly, as new
- # Report objects are created by the #benchmark and #bm methods.
- # _width_ and _fmtstr_ are the label offset and
- # format string used by Tms#format.
- #
- def initialize(width = 0, fmtstr = nil)
- @width, @fmtstr = width, fmtstr
- end
-
- #
- # Prints the _label_ and measured time for the block,
- # formatted by _fmt_. See Tms#format for the
- # formatting rules.
- #
- def item(label = "", *fmt, &blk) # :yield:
- print label.ljust(@width)
- res = Benchmark::measure(&blk)
- print res.format(@fmtstr, *fmt)
- res
- end
-
- alias report item
- end
-
-
-
- #
- # A data object, representing the times associated with a benchmark
- # measurement.
- #
- class Tms
- CAPTION = " user system total real\n"
- FMTSTR = "%10.6u %10.6y %10.6t %10.6r\n"
-
- # User CPU time
- attr_reader :utime
-
- # System CPU time
- attr_reader :stime
-
- # User CPU time of children
- attr_reader :cutime
-
- # System CPU time of children
- attr_reader :cstime
-
- # Elapsed real time
- attr_reader :real
-
- # Total time, that is _utime_ + _stime_ + _cutime_ + _cstime_
- attr_reader :total
-
- # Label
- attr_reader :label
-
- #
- # Returns an initialized Tms object which has
- # _u_ as the user CPU time, _s_ as the system CPU time,
- # _cu_ as the children's user CPU time, _cs_ as the children's
- # system CPU time, _real_ as the elapsed real time and _l_
- # as the label.
- #
- def initialize(u = 0.0, s = 0.0, cu = 0.0, cs = 0.0, real = 0.0, l = nil)
- @utime, @stime, @cutime, @cstime, @real, @label = u, s, cu, cs, real, l
- @total = @utime + @stime + @cutime + @cstime
- end
-
- #
- # Returns a new Tms object whose times are the sum of the times for this
- # Tms object, plus the time required to execute the code block (_blk_).
- #
- def add(&blk) # :yield:
- self + Benchmark::measure(&blk)
- end
-
- #
- # An in-place version of #add.
- #
- def add!
- t = Benchmark::measure(&blk)
- @utime = utime + t.utime
- @stime = stime + t.stime
- @cutime = cutime + t.cutime
- @cstime = cstime + t.cstime
- @real = real + t.real
- self
- end
-
- #
- # Returns a new Tms object obtained by memberwise summation
- # of the individual times for this Tms object with those of the other
- # Tms object.
- # This method and #/() are useful for taking statistics.
- #
- def +(other); memberwise(:+, other) end
-
- #
- # Returns a new Tms object obtained by memberwise subtraction
- # of the individual times for the other Tms object from those of this
- # Tms object.
- #
- def -(other); memberwise(:-, other) end
-
- #
- # Returns a new Tms object obtained by memberwise multiplication
- # of the individual times for this Tms object by _x_.
- #
- def *(x); memberwise(:*, x) end
-
- #
- # Returns a new Tms object obtained by memberwise division
- # of the individual times for this Tms object by _x_.
- # This method and #+() are useful for taking statistics.
- #
- def /(x); memberwise(:/, x) end
-
- #
- # Returns the contents of this Tms object as
- # a formatted string, according to a format string
- # like that passed to Kernel.format. In addition, #format
- # accepts the following extensions:
- #
- # <tt>%u</tt>:: Replaced by the user CPU time, as reported by Tms#utime.
- # <tt>%y</tt>:: Replaced by the system CPU time, as reported by #stime (Mnemonic: y of "s*y*stem")
- # <tt>%U</tt>:: Replaced by the children's user CPU time, as reported by Tms#cutime
- # <tt>%Y</tt>:: Replaced by the children's system CPU time, as reported by Tms#cstime
- # <tt>%t</tt>:: Replaced by the total CPU time, as reported by Tms#total
- # <tt>%r</tt>:: Replaced by the elapsed real time, as reported by Tms#real
- # <tt>%n</tt>:: Replaced by the label string, as reported by Tms#label (Mnemonic: n of "*n*ame")
- #
- # If _fmtstr_ is not given, FMTSTR is used as default value, detailing the
- # user, system and real elapsed time.
- #
- def format(arg0 = nil, *args)
- fmtstr = (arg0 || FMTSTR).dup
- fmtstr.gsub!(/(%[-+\.\d]*)n/){"#{$1}s" % label}
- fmtstr.gsub!(/(%[-+\.\d]*)u/){"#{$1}f" % utime}
- fmtstr.gsub!(/(%[-+\.\d]*)y/){"#{$1}f" % stime}
- fmtstr.gsub!(/(%[-+\.\d]*)U/){"#{$1}f" % cutime}
- fmtstr.gsub!(/(%[-+\.\d]*)Y/){"#{$1}f" % cstime}
- fmtstr.gsub!(/(%[-+\.\d]*)t/){"#{$1}f" % total}
- fmtstr.gsub!(/(%[-+\.\d]*)r/){"(#{$1}f)" % real}
- arg0 ? Kernel::format(fmtstr, *args) : fmtstr
- end
-
- #
- # Same as #format.
- #
- def to_s
- format
- end
-
- #
- # Returns a new 6-element array, consisting of the
- # label, user CPU time, system CPU time, children's
- # user CPU time, children's system CPU time and elapsed
- # real time.
- #
- def to_a
- [@label, @utime, @stime, @cutime, @cstime, @real]
- end
-
- protected
- def memberwise(op, x)
- case x
- when Benchmark::Tms
- Benchmark::Tms.new(utime.__send__(op, x.utime),
- stime.__send__(op, x.stime),
- cutime.__send__(op, x.cutime),
- cstime.__send__(op, x.cstime),
- real.__send__(op, x.real)
- )
- else
- Benchmark::Tms.new(utime.__send__(op, x),
- stime.__send__(op, x),
- cutime.__send__(op, x),
- cstime.__send__(op, x),
- real.__send__(op, x)
- )
- end
- end
- end
-
- # The default caption string (heading above the output times).
- CAPTION = Benchmark::Tms::CAPTION
-
- # The default format string used to display times. See also Benchmark::Tms#format.
- FMTSTR = Benchmark::Tms::FMTSTR
-end
-
-if __FILE__ == $0
- include Benchmark
-
- n = ARGV[0].to_i.nonzero? || 50000
- puts %Q([#{n} times iterations of `a = "1"'])
- benchmark(" " + CAPTION, 7, FMTSTR) do |x|
- x.report("for:") {for i in 1..n; a = "1"; end} # Benchmark::measure
- x.report("times:") {n.times do ; a = "1"; end}
- x.report("upto:") {1.upto(n) do ; a = "1"; end}
- end
-
- benchmark do
- [
- measure{for i in 1..n; a = "1"; end}, # Benchmark::measure
- measure{n.times do ; a = "1"; end},
- measure{1.upto(n) do ; a = "1"; end}
- ]
- end
-end
View
85 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/jacobian.rb
@@ -1,85 +0,0 @@
-#
-# require 'bigdecimal/jacobian'
-#
-# Provides methods to compute the Jacobian matrix of a set of equations at a
-# point x. In the methods below:
-#
-# f is an Object which is used to compute the Jacobian matrix of the equations.
-# It must provide the following methods:
-#
-# f.values(x):: returns the values of all functions at x
-#
-# f.zero:: returns 0.0
-# f.one:: returns 1.0
-# f.two:: returns 1.0
-# f.ten:: returns 10.0
-#
-# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal.
-#
-# x is the point at which to compute the Jacobian.
-#
-# fx is f.values(x).
-#
-module Jacobian
- #--
- def isEqual(a,b,zero=0.0,e=1.0e-8)
- aa = a.abs
- bb = b.abs
- if aa == zero && bb == zero then
- true
- else
- if ((a-b)/(aa+bb)).abs < e then
- true
- else
- false
- end
- end
- end
- #++
-
- # Computes the derivative of f[i] at x[i].
- # fx is the value of f at x.
- def dfdxi(f,fx,x,i)
- nRetry = 0
- n = x.size
- xSave = x[i]
- ok = 0
- ratio = f.ten*f.ten*f.ten
- dx = x[i].abs/ratio
- dx = fx[i].abs/ratio if isEqual(dx,f.zero,f.zero,f.eps)
- dx = f.one/f.ten if isEqual(dx,f.zero,f.zero,f.eps)
- until ok>0 do
- s = f.zero
- deriv = []
- if(nRetry>100) then
- raize "Singular Jacobian matrix. No change at x[" + i.to_s + "]"
- end
- dx = dx*f.two
- x[i] += dx
- fxNew = f.values(x)
- for j in 0...n do
- if !isEqual(fxNew[j],fx[j],f.zero,f.eps) then
- ok += 1
- deriv <<= (fxNew[j]-fx[j])/dx
- else
- deriv <<= f.zero
- end
- end
- x[i] = xSave
- end
- deriv
- end
-
- # Computes the Jacobian of f at x. fx is the value of f at x.
- def jacobian(f,fx,x)
- n = x.size
- dfdx = Array::new(n*n)
- for i in 0...n do
- df = dfdxi(f,fx,x,i)
- for j in 0...n do
- dfdx[j*n+i] = df[j]
- end
- end
- dfdx
- end
-end
View
84 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/ludcmp.rb
@@ -1,84 +0,0 @@
-#
-# Solves a*x = b for x, using LU decomposition.
-#
-module LUSolve
- # Performs LU decomposition of the n by n matrix a.
- def ludecomp(a,n,zero=0,one=1)
- prec = BigDecimal.limit(nil)
- ps = []
- scales = []
- for i in 0...n do # pick up largest(abs. val.) element in each row.
- ps <<= i
- nrmrow = zero
- ixn = i*n
- for j in 0...n do
- biggst = a[ixn+j].abs
- nrmrow = biggst if biggst>nrmrow
- end
- if nrmrow>zero then
- scales <<= one.div(nrmrow,prec)
- else
- raise "Singular matrix"
- end
- end
- n1 = n - 1
- for k in 0...n1 do # Gaussian elimination with partial pivoting.
- biggst = zero;
- for i in k...n do
- size = a[ps[i]*n+k].abs*scales[ps[i]]
- if size>biggst then
- biggst = size
- pividx = i
- end
- end
- raise "Singular matrix" if biggst<=zero
- if pividx!=k then
- j = ps[k]
- ps[k] = ps[pividx]
- ps[pividx] = j
- end
- pivot = a[ps[k]*n+k]
- for i in (k+1)...n do
- psin = ps[i]*n
- a[psin+k] = mult = a[psin+k].div(pivot,prec)
- if mult!=zero then
- pskn = ps[k]*n
- for j in (k+1)...n do
- a[psin+j] -= mult.mult(a[pskn+j],prec)
- end
- end
- end
- end
- raise "Singular matrix" if a[ps[n1]*n+n1] == zero
- ps
- end
-
- # Solves a*x = b for x, using LU decomposition.
- #
- # a is a matrix, b is a constant vector, x is the solution vector.
- #
- # ps is the pivot, a vector which indicates the permutation of rows performed
- # during LU decomposition.
- def lusolve(a,b,ps,zero=0.0)
- prec = BigDecimal.limit(nil)
- n = ps.size
- x = []
- for i in 0...n do
- dot = zero
- psin = ps[i]*n
- for j in 0...i do
- dot = a[psin+j].mult(x[j],prec) + dot
- end
- x <<= b[ps[i]] - dot
- end
- (n-1).downto(0) do |i|
- dot = zero
- psin = ps[i]*n
- for j in (i+1)...n do
- dot = a[psin+j].mult(x[j],prec) + dot
- end
- x[i] = (x[i]-dot).div(a[psin+i],prec)
- end
- x
- end
-end
View
235 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/math.rb
@@ -1,235 +0,0 @@
-#
-#--
-# Contents:
-# sqrt(x, prec)
-# sin (x, prec)
-# cos (x, prec)
-# atan(x, prec) Note: |x|<1, x=0.9999 may not converge.
-# exp (x, prec)
-# log (x, prec)
-# PI (prec)
-# E (prec) == exp(1.0,prec)
-#
-# where:
-# x ... BigDecimal number to be computed.
-# |x| must be small enough to get convergence.
-# prec ... Number of digits to be obtained.
-#++
-#
-# Provides mathematical functions.
-#
-# Example:
-#
-# require "bigdecimal"
-# require "bigdecimal/math"
-#
-# include BigMath
-#
-# a = BigDecimal((PI(100)/2).to_s)
-# puts sin(a,100) # -> 0.10000000000000000000......E1
-#
-module BigMath
-
- # Computes the square root of x to the specified number of digits of
- # precision.
- #
- # BigDecimal.new('2').sqrt(16).to_s
- # -> "0.14142135623730950488016887242096975E1"
- #
- def sqrt(x,prec)
- x.sqrt(prec)
- end
-
- # Computes the sine of x to the specified number of digits of precision.
- #
- # If x is infinite or NaN, returns NaN.
- def sin(x, prec)
- raise ArgumentError, "Zero or negative precision for sin" if prec <= 0
- return BigDecimal("NaN") if x.infinite? || x.nan?
- n = prec + BigDecimal.double_fig
- one = BigDecimal("1")
- two = BigDecimal("2")
- x1 = x
- x2 = x.mult(x,n)
- sign = 1
- y = x
- d = y
- i = one
- z = one
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- sign = -sign
- x1 = x2.mult(x1,n)
- i += two
- z *= (i-one) * i
- d = sign * x1.div(z,m)
- y += d
- end
- y
- end
-
- # Computes the cosine of x to the specified number of digits of precision.
- #
- # If x is infinite or NaN, returns NaN.
- def cos(x, prec)
- raise ArgumentError, "Zero or negative precision for cos" if prec <= 0
- return BigDecimal("NaN") if x.infinite? || x.nan?
- n = prec + BigDecimal.double_fig
- one = BigDecimal("1")
- two = BigDecimal("2")
- x1 = one
- x2 = x.mult(x,n)
- sign = 1
- y = one
- d = y
- i = BigDecimal("0")
- z = one
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- sign = -sign
- x1 = x2.mult(x1,n)
- i += two
- z *= (i-one) * i
- d = sign * x1.div(z,m)
- y += d
- end
- y
- end
-
- # Computes the arctangent of x to the specified number of digits of precision.
- #
- # If x is infinite or NaN, returns NaN.
- # Raises an argument error if x > 1.
- def atan(x, prec)
- raise ArgumentError, "Zero or negative precision for atan" if prec <= 0
- return BigDecimal("NaN") if x.infinite? || x.nan?
- raise ArgumentError, "x.abs must be less than 1.0" if x.abs>=1
- n = prec + BigDecimal.double_fig
- y = x
- d = y
- t = x
- r = BigDecimal("3")
- x2 = x.mult(x,n)
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- t = -t.mult(x2,n)
- d = t.div(r,m)
- y += d
- r += 2
- end
- y
- end
-
- # Computes the value of e (the base of natural logarithms) raised to the
- # power of x, to the specified number of digits of precision.
- #
- # If x is infinite or NaN, returns NaN.
- #
- # BigMath::exp(BigDecimal.new('1'), 10).to_s
- # -> "0.271828182845904523536028752390026306410273E1"
- def exp(x, prec)
- raise ArgumentError, "Zero or negative precision for exp" if prec <= 0
- return BigDecimal("NaN") if x.infinite? || x.nan?
- n = prec + BigDecimal.double_fig
- one = BigDecimal("1")
- x1 = one
- y = one
- d = y
- z = one
- i = 0
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- x1 = x1.mult(x,n)
- i += 1
- z *= i
- d = x1.div(z,m)
- y += d
- end
- y
- end
-
- # Computes the natural logarithm of x to the specified number of digits
- # of precision.
- #
- # Returns x if x is infinite or NaN.
- #
- def log(x, prec)
- raise ArgumentError, "Zero or negative argument for log" if x <= 0 || prec <= 0
- return x if x.infinite? || x.nan?
- one = BigDecimal("1")
- two = BigDecimal("2")
- n = prec + BigDecimal.double_fig
- x = (x - one).div(x + one,n)
- x2 = x.mult(x,n)
- y = x
- d = y
- i = one
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- x = x2.mult(x,n)
- i += two
- d = x.div(i,m)
- y += d
- end
- y*two
- end
-
- # Computes the value of pi to the specified number of digits of precision.
- def PI(prec)
- raise ArgumentError, "Zero or negative argument for PI" if prec <= 0
- n = prec + BigDecimal.double_fig
- zero = BigDecimal("0")
- one = BigDecimal("1")
- two = BigDecimal("2")
-
- m25 = BigDecimal("-0.04")
- m57121 = BigDecimal("-57121")
-
- pi = zero
-
- d = one
- k = one
- w = one
- t = BigDecimal("-80")
- while d.nonzero? && ((m = n - (pi.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- t = t*m25
- d = t.div(k,m)
- k = k+two
- pi = pi + d
- end
-
- d = one
- k = one
- w = one
- t = BigDecimal("956")
- while d.nonzero? && ((m = n - (pi.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- t = t.div(m57121,n)
- d = t.div(k,m)
- pi = pi + d
- k = k+two
- end
- pi
- end
-
- # Computes e (the base of natural logarithms) to the specified number of
- # digits of precision.
- def E(prec)
- raise ArgumentError, "Zero or negative precision for E" if prec <= 0
- n = prec + BigDecimal.double_fig
- one = BigDecimal("1")
- y = one
- d = y
- z = one
- i = 0
- while d.nonzero? && ((m = n - (y.exponent - d.exponent).abs) > 0)
- m = BigDecimal.double_fig if m < BigDecimal.double_fig
- i += 1
- z *= i
- d = one.div(z,m)
- y += d
- end
- y
- end
-end
View
77 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/newton.rb
@@ -1,77 +0,0 @@
-#
-# newton.rb
-#
-# Solves the nonlinear algebraic equation system f = 0 by Newton's method.
-# This program is not dependent on BigDecimal.
-#
-# To call:
-# n = nlsolve(f,x)
-# where n is the number of iterations required,
-# x is the initial value vector
-# f is an Object which is used to compute the values of the equations to be solved.
-# It must provide the following methods:
-#
-# f.values(x):: returns the values of all functions at x
-#
-# f.zero:: returns 0.0
-# f.one:: returns 1.0
-# f.two:: returns 1.0
-# f.ten:: returns 10.0
-#
-# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal.
-#
-# On exit, x is the solution vector.
-#
-require "bigdecimal/ludcmp"
-require "bigdecimal/jacobian"
-
-module Newton
- include LUSolve
- include Jacobian
-
- def norm(fv,zero=0.0)
- s = zero
- n = fv.size
- for i in 0...n do
- s += fv[i]*fv[i]
- end
- s
- end
-
- def nlsolve(f,x)
- nRetry = 0
- n = x.size
-
- f0 = f.values(x)
- zero = f.zero
- one = f.one
- two = f.two
- p5 = one/two
- d = norm(f0,zero)
- minfact = f.ten*f.ten*f.ten
- minfact = one/minfact
- e = f.eps
- while d >= e do
- nRetry += 1
- # Not yet converged. => Compute Jacobian matrix
- dfdx = jacobian(f,f0,x)
- # Solve dfdx*dx = -f0 to estimate dx
- dx = lusolve(dfdx,f0,ludecomp(dfdx,n,zero,one),zero)
- fact = two
- xs = x.dup
- begin
- fact *= p5
- if fact < minfact then
- raise "Failed to reduce function values."
- end
- for i in 0...n do
- x[i] = xs[i] - dx[i]*fact
- end
- f0 = f.values(x)
- dn = norm(f0,zero)
- end while(dn>=d)
- d = dn
- end
- nRetry
- end
-end
View
65 vendor/jruby-1.1-RC2/ruby/1.8/bigdecimal/util.rb
@@ -1,65 +0,0 @@
-#
-# BigDecimal utility library.
-#
-# To use these functions, require 'bigdecimal/util'
-#
-# The following methods are provided to convert other types to BigDecimals:
-#
-# String#to_d -> BigDecimal
-# Float#to_d -> BigDecimal
-# Rational#to_d -> BigDecimal
-#
-# The following method is provided to convert BigDecimals to other types:
-#
-# BigDecimal#to_r -> Rational
-#
-# ----------------------------------------------------------------------
-#
-class Float < Numeric
- def to_d
- BigDecimal(self.to_s)
- end
-end
-
-class String
- def to_d
- BigDecimal(self)
- end
-end
-
-class BigDecimal < Numeric
- # Converts a BigDecimal to a String of the form "nnnnnn.mmm".
- # This method is deprecated; use BigDecimal#to_s("F") instead.
- def to_digits
- if self.nan? || self.infinite? || self.zero?
- self.to_s
- else
- i = self.to_i.to_s
- s,f,y,z = self.frac.split
- i + "." + ("0"*(-z)) + f
- end
- end
-
- # Converts a BigDecimal to a Rational.
- def to_r
- sign,digits,base,power = self.split
- numerator = sign*digits.to_i
- denomi_power = power - digits.size # base is always 10
- if denomi_power < 0
- Rational(numerator,base ** (-denomi_power))
- else
- Rational(numerator * (base ** denomi_power),1)
- end
- end
-end
-
-class Rational < Numeric
- # Converts a Rational to a BigDecimal
- def to_d(nFig=0)
- num = self.numerator.to_s
- if nFig<=0
- nFig = BigDecimal.double_fig*2+1
- end
- BigDecimal.new(num).div(self.denominator,nFig)
- end
-end
View
272 vendor/jruby-1.1-RC2/ruby/1.8/cgi-lib.rb
@@ -1,272 +0,0 @@
-warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: cgi-lib is deprecated after Ruby 1.8.1; use cgi instead"
-
-=begin
-
-= simple CGI support library
-
-= example
-
-== get form values
-
- require "cgi-lib.rb"
- query = CGI.new
- query['field'] # <== value of 'field'
- query.keys # <== array of fields
-
-and query has Hash class methods
-
-
-== get cookie values
-
- require "cgi-lib.rb"
- query = CGI.new
- query.cookie['name'] # <== cookie value of 'name'
- query.cookie.keys # <== all cookie names
-
-and query.cookie has Hash class methods
-
-
-== print HTTP header and HTML string to $>
-
- require "cgi-lib.rb"
- CGI::print{
- CGI::tag("HTML"){
- CGI::tag("HEAD"){ CGI::tag("TITLE"){"TITLE"} } +
- CGI::tag("BODY"){
- CGI::tag("FORM", {"ACTION"=>"test.rb", "METHOD"=>"POST"}){
- CGI::tag("INPUT", {"TYPE"=>"submit", "VALUE"=>"submit"})
- } +
- CGI::tag("HR")
- }
- }
- }
-
-
-== make raw cookie string
-
- require "cgi-lib.rb"
- cookie1 = CGI::cookie({'name' => 'name',
- 'value' => 'value',
- 'path' => 'path', # optional
- 'domain' => 'domain', # optional
- 'expires' => Time.now, # optional
- 'secure' => true # optional
- })
-
- CGI::print("Content-Type: text/html", cookie1, cookie2){ "string" }
-
-
-== print HTTP header and string to $>