redcar 0.3.2dev → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (485) hide show
  1. data/CHANGES +49 -2
  2. data/README.md +2 -7
  3. data/ROADMAP.md +8 -9
  4. data/Rakefile +29 -44
  5. data/bin/redcar +11 -2
  6. data/lib/openssl/History.txt +75 -0
  7. data/lib/openssl/License.txt +30 -0
  8. data/lib/openssl/Manifest.txt +99 -0
  9. data/lib/openssl/README.txt +24 -0
  10. data/lib/openssl/Rakefile +71 -0
  11. data/lib/openssl/build.properties.SAMPLE +7 -0
  12. data/lib/openssl/build.xml +57 -0
  13. data/lib/openssl/lib/jopenssl/version.rb +5 -0
  14. data/lib/openssl/lib/openssl.rb +24 -0
  15. data/lib/openssl/lib/openssl/bn.rb +33 -0
  16. data/lib/openssl/lib/openssl/buffering.rb +239 -0
  17. data/lib/openssl/lib/openssl/cipher.rb +56 -0
  18. data/lib/openssl/lib/openssl/digest.rb +46 -0
  19. data/lib/openssl/lib/openssl/dummy.rb +34 -0
  20. data/lib/openssl/lib/openssl/dummyssl.rb +13 -0
  21. data/lib/openssl/lib/openssl/ssl.rb +135 -0
  22. data/lib/openssl/lib/openssl/x509.rb +154 -0
  23. data/lib/openssl/mocha/COPYING +3 -0
  24. data/lib/openssl/mocha/MIT-LICENSE +7 -0
  25. data/lib/openssl/mocha/README +35 -0
  26. data/lib/openssl/mocha/RELEASE +171 -0
  27. data/lib/openssl/mocha/Rakefile +147 -0
  28. data/lib/openssl/mocha/TODO +48 -0
  29. data/lib/openssl/mocha/examples/misc.rb +36 -0
  30. data/lib/openssl/mocha/examples/mocha.rb +26 -0
  31. data/lib/openssl/mocha/examples/stubba.rb +65 -0
  32. data/lib/openssl/mocha/init.rb +3 -0
  33. data/lib/openssl/mocha/lib/mocha.rb +19 -0
  34. data/lib/openssl/mocha/lib/mocha/any_instance_method.rb +35 -0
  35. data/lib/openssl/mocha/lib/mocha/auto_verify.rb +111 -0
  36. data/lib/openssl/mocha/lib/mocha/central.rb +35 -0
  37. data/lib/openssl/mocha/lib/mocha/class_method.rb +62 -0
  38. data/lib/openssl/mocha/lib/mocha/deprecation.rb +22 -0
  39. data/lib/openssl/mocha/lib/mocha/exception_raiser.rb +17 -0
  40. data/lib/openssl/mocha/lib/mocha/expectation.rb +382 -0
  41. data/lib/openssl/mocha/lib/mocha/expectation_error.rb +6 -0
  42. data/lib/openssl/mocha/lib/mocha/expectation_list.rb +45 -0
  43. data/lib/openssl/mocha/lib/mocha/infinite_range.rb +25 -0
  44. data/lib/openssl/mocha/lib/mocha/inspect.rb +39 -0
  45. data/lib/openssl/mocha/lib/mocha/instance_method.rb +8 -0
  46. data/lib/openssl/mocha/lib/mocha/is_a.rb +9 -0
  47. data/lib/openssl/mocha/lib/mocha/metaclass.rb +7 -0
  48. data/lib/openssl/mocha/lib/mocha/missing_expectation.rb +27 -0
  49. data/lib/openssl/mocha/lib/mocha/mock.rb +200 -0
  50. data/lib/openssl/mocha/lib/mocha/multiple_yields.rb +20 -0
  51. data/lib/openssl/mocha/lib/mocha/no_yields.rb +11 -0
  52. data/lib/openssl/mocha/lib/mocha/object.rb +110 -0
  53. data/lib/openssl/mocha/lib/mocha/parameter_matchers.rb +9 -0
  54. data/lib/openssl/mocha/lib/mocha/parameter_matchers/all_of.rb +39 -0
  55. data/lib/openssl/mocha/lib/mocha/parameter_matchers/any_of.rb +44 -0
  56. data/lib/openssl/mocha/lib/mocha/parameter_matchers/anything.rb +30 -0
  57. data/lib/openssl/mocha/lib/mocha/parameter_matchers/has_entry.rb +39 -0
  58. data/lib/openssl/mocha/lib/mocha/parameter_matchers/has_key.rb +39 -0
  59. data/lib/openssl/mocha/lib/mocha/parameter_matchers/has_value.rb +39 -0
  60. data/lib/openssl/mocha/lib/mocha/parameter_matchers/includes.rb +37 -0
  61. data/lib/openssl/mocha/lib/mocha/parameter_matchers/instance_of.rb +39 -0
  62. data/lib/openssl/mocha/lib/mocha/parameter_matchers/kind_of.rb +39 -0
  63. data/lib/openssl/mocha/lib/mocha/pretty_parameters.rb +28 -0
  64. data/lib/openssl/mocha/lib/mocha/return_values.rb +31 -0
  65. data/lib/openssl/mocha/lib/mocha/setup_and_teardown.rb +23 -0
  66. data/lib/openssl/mocha/lib/mocha/single_return_value.rb +24 -0
  67. data/lib/openssl/mocha/lib/mocha/single_yield.rb +18 -0
  68. data/lib/openssl/mocha/lib/mocha/standalone.rb +32 -0
  69. data/lib/openssl/mocha/lib/mocha/stub.rb +18 -0
  70. data/lib/openssl/mocha/lib/mocha/test_case_adapter.rb +49 -0
  71. data/lib/openssl/mocha/lib/mocha/yield_parameters.rb +31 -0
  72. data/lib/openssl/mocha/lib/mocha_standalone.rb +2 -0
  73. data/lib/openssl/mocha/lib/stubba.rb +2 -0
  74. data/lib/openssl/mocha/templates/html_with_google_analytics.rb +742 -0
  75. data/lib/openssl/mocha/test/acceptance/expected_invocation_count_acceptance_test.rb +187 -0
  76. data/lib/openssl/mocha/test/acceptance/mocha_acceptance_test.rb +98 -0
  77. data/lib/openssl/mocha/test/acceptance/mocked_methods_dispatch_acceptance_test.rb +71 -0
  78. data/lib/openssl/mocha/test/acceptance/parameter_matcher_acceptance_test.rb +63 -0
  79. data/lib/openssl/mocha/test/acceptance/standalone_acceptance_test.rb +131 -0
  80. data/lib/openssl/mocha/test/acceptance/stubba_acceptance_test.rb +102 -0
  81. data/lib/openssl/mocha/test/active_record_test_case.rb +36 -0
  82. data/lib/openssl/mocha/test/deprecation_disabler.rb +15 -0
  83. data/lib/openssl/mocha/test/execution_point.rb +34 -0
  84. data/lib/openssl/mocha/test/integration/mocha_test_result_integration_test.rb +105 -0
  85. data/lib/openssl/mocha/test/integration/stubba_integration_test.rb +89 -0
  86. data/lib/openssl/mocha/test/integration/stubba_test_result_integration_test.rb +85 -0
  87. data/lib/openssl/mocha/test/method_definer.rb +18 -0
  88. data/lib/openssl/mocha/test/test_helper.rb +12 -0
  89. data/lib/openssl/mocha/test/test_runner.rb +31 -0
  90. data/lib/openssl/mocha/test/unit/any_instance_method_test.rb +124 -0
  91. data/lib/openssl/mocha/test/unit/array_inspect_test.rb +16 -0
  92. data/lib/openssl/mocha/test/unit/auto_verify_test.rb +122 -0
  93. data/lib/openssl/mocha/test/unit/central_test.rb +124 -0
  94. data/lib/openssl/mocha/test/unit/class_method_test.rb +196 -0
  95. data/lib/openssl/mocha/test/unit/date_time_inspect_test.rb +21 -0
  96. data/lib/openssl/mocha/test/unit/expectation_list_test.rb +69 -0
  97. data/lib/openssl/mocha/test/unit/expectation_raiser_test.rb +28 -0
  98. data/lib/openssl/mocha/test/unit/expectation_test.rb +399 -0
  99. data/lib/openssl/mocha/test/unit/hash_inspect_test.rb +16 -0
  100. data/lib/openssl/mocha/test/unit/infinite_range_test.rb +53 -0
  101. data/lib/openssl/mocha/test/unit/metaclass_test.rb +22 -0
  102. data/lib/openssl/mocha/test/unit/missing_expectation_test.rb +45 -0
  103. data/lib/openssl/mocha/test/unit/mock_test.rb +316 -0
  104. data/lib/openssl/mocha/test/unit/multiple_yields_test.rb +18 -0
  105. data/lib/openssl/mocha/test/unit/no_yield_test.rb +18 -0
  106. data/lib/openssl/mocha/test/unit/object_inspect_test.rb +35 -0
  107. data/lib/openssl/mocha/test/unit/object_test.rb +165 -0
  108. data/lib/openssl/mocha/test/unit/parameter_matchers/all_of_test.rb +26 -0
  109. data/lib/openssl/mocha/test/unit/parameter_matchers/any_of_test.rb +26 -0
  110. data/lib/openssl/mocha/test/unit/parameter_matchers/anything_test.rb +21 -0
  111. data/lib/openssl/mocha/test/unit/parameter_matchers/has_entry_test.rb +25 -0
  112. data/lib/openssl/mocha/test/unit/parameter_matchers/has_key_test.rb +25 -0
  113. data/lib/openssl/mocha/test/unit/parameter_matchers/has_value_test.rb +25 -0
  114. data/lib/openssl/mocha/test/unit/parameter_matchers/includes_test.rb +25 -0
  115. data/lib/openssl/mocha/test/unit/parameter_matchers/instance_of_test.rb +25 -0
  116. data/lib/openssl/mocha/test/unit/parameter_matchers/kind_of_test.rb +25 -0
  117. data/lib/openssl/mocha/test/unit/parameter_matchers/stub_matcher.rb +22 -0
  118. data/lib/openssl/mocha/test/unit/pretty_parameters_test.rb +32 -0
  119. data/lib/openssl/mocha/test/unit/return_values_test.rb +63 -0
  120. data/lib/openssl/mocha/test/unit/setup_and_teardown_test.rb +76 -0
  121. data/lib/openssl/mocha/test/unit/single_return_value_test.rb +33 -0
  122. data/lib/openssl/mocha/test/unit/single_yield_test.rb +18 -0
  123. data/lib/openssl/mocha/test/unit/string_inspect_test.rb +11 -0
  124. data/lib/openssl/mocha/test/unit/stub_test.rb +24 -0
  125. data/lib/openssl/mocha/test/unit/yield_parameters_test.rb +93 -0
  126. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/FOLDERS +53 -0
  127. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/LICENSE +340 -0
  128. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/README +117 -0
  129. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/bin/coderay +77 -0
  130. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/bin/coderay_stylesheet +4 -0
  131. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay.rb +319 -0
  132. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/duo.rb +29 -0
  133. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoder.rb +173 -0
  134. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/_map.rb +8 -0
  135. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/count.rb +21 -0
  136. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/debug.rb +46 -0
  137. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/div.rb +20 -0
  138. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html.rb +260 -0
  139. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/classes.rb +77 -0
  140. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/css.rb +65 -0
  141. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/numerization.rb +122 -0
  142. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/html/output.rb +195 -0
  143. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/null.rb +26 -0
  144. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/page.rb +21 -0
  145. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/span.rb +20 -0
  146. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/statistic.rb +81 -0
  147. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/text.rb +33 -0
  148. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/tokens.rb +44 -0
  149. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/xml.rb +71 -0
  150. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/encoders/yaml.rb +22 -0
  151. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/file_type.rb +182 -0
  152. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/gzip_simple.rb +122 -0
  153. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/plugin.rb +326 -0
  154. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/helpers/word_list.rb +119 -0
  155. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanner.rb +238 -0
  156. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/_map.rb +15 -0
  157. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/c.rb +163 -0
  158. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/debug.rb +60 -0
  159. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/delphi.rb +149 -0
  160. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/html.rb +177 -0
  161. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/nitro_xhtml.rb +133 -0
  162. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/plaintext.rb +16 -0
  163. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/rhtml.rb +73 -0
  164. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/ruby.rb +367 -0
  165. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/ruby/patterns.rb +230 -0
  166. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/scanners/xml.rb +18 -0
  167. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/style.rb +20 -0
  168. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/styles/_map.rb +7 -0
  169. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/styles/cycnus.rb +125 -0
  170. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/styles/murphy.rb +119 -0
  171. data/lib/openssl/mocha/vendor/coderay-0.7.4.215/lib/coderay/tokens.rb +368 -0
  172. data/lib/openssl/mocha/vendor/meta_project-0.4.15/CHANGES +295 -0
  173. data/lib/openssl/mocha/vendor/meta_project-0.4.15/MIT-LICENSE +21 -0
  174. data/lib/openssl/mocha/vendor/meta_project-0.4.15/README +129 -0
  175. data/lib/openssl/mocha/vendor/meta_project-0.4.15/Rakefile +152 -0
  176. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project.rb +19 -0
  177. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/core_ext/open_uri.rb +22 -0
  178. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/core_ext/pathname.rb +36 -0
  179. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/core_ext/string.rb +5 -0
  180. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/http/multipart.rb +32 -0
  181. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/patois.rb +1 -0
  182. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/patois/parser.rb +99 -0
  183. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project.rb +4 -0
  184. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/base.rb +9 -0
  185. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/codehaus.rb +1 -0
  186. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/codehaus/codehaus_project_svn.rb +31 -0
  187. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/trac.rb +1 -0
  188. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/trac/trac_project.rb +54 -0
  189. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge.rb +5 -0
  190. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/ruby_forge.rb +47 -0
  191. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/session.rb +177 -0
  192. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/source_forge.rb +50 -0
  193. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/xfile.rb +45 -0
  194. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project/xforge/xforge_base.rb +85 -0
  195. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/project_analyzer.rb +36 -0
  196. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/release/freshmeat.rb +267 -0
  197. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/release/raa.rb +572 -0
  198. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/scm_web.rb +2 -0
  199. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/scm_web/browser.rb +112 -0
  200. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/scm_web/pathname.rb +89 -0
  201. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker.rb +6 -0
  202. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/base.rb +24 -0
  203. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/digit_issues.rb +34 -0
  204. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/issue.rb +57 -0
  205. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/jira.rb +2 -0
  206. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/jira/jira_issues.rb +35 -0
  207. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/jira/jira_tracker.rb +149 -0
  208. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/trac.rb +1 -0
  209. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/trac/trac_tracker.rb +33 -0
  210. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge.rb +3 -0
  211. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge/ruby_forge_tracker.rb +17 -0
  212. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge/source_forge_tracker.rb +17 -0
  213. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/tracker/xforge/xforge_tracker.rb +191 -0
  214. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/meta_project/version_parser.rb +52 -0
  215. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge.rb +3 -0
  216. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge/base.rb +64 -0
  217. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge/news_publisher.rb +97 -0
  218. data/lib/openssl/mocha/vendor/meta_project-0.4.15/lib/rake/contrib/xforge/release.rb +134 -0
  219. data/lib/openssl/nbproject/genfiles.properties +5 -0
  220. data/lib/openssl/nbproject/jdk.xml +157 -0
  221. data/lib/openssl/nbproject/nbjdk.properties +1 -0
  222. data/lib/openssl/nbproject/nbjdk.xml +16 -0
  223. data/lib/openssl/nbproject/project.xml +117 -0
  224. data/lib/openssl/src/java/JopensslService.java +41 -0
  225. data/lib/openssl/src/java/org/jruby/ext/openssl/ASN1.java +930 -0
  226. data/lib/openssl/src/java/org/jruby/ext/openssl/Attribute.java +132 -0
  227. data/lib/openssl/src/java/org/jruby/ext/openssl/BN.java +769 -0
  228. data/lib/openssl/src/java/org/jruby/ext/openssl/BouncyCastlePEMHandler.java +69 -0
  229. data/lib/openssl/src/java/org/jruby/ext/openssl/Callable.java +10 -0
  230. data/lib/openssl/src/java/org/jruby/ext/openssl/Cipher.java +661 -0
  231. data/lib/openssl/src/java/org/jruby/ext/openssl/CipherStrings.java +1827 -0
  232. data/lib/openssl/src/java/org/jruby/ext/openssl/Config.java +49 -0
  233. data/lib/openssl/src/java/org/jruby/ext/openssl/DefaultPEMHandler.java +44 -0
  234. data/lib/openssl/src/java/org/jruby/ext/openssl/Digest.java +207 -0
  235. data/lib/openssl/src/java/org/jruby/ext/openssl/HMAC.java +183 -0
  236. data/lib/openssl/src/java/org/jruby/ext/openssl/NetscapeSPKI.java +212 -0
  237. data/lib/openssl/src/java/org/jruby/ext/openssl/OpenSSLImpl.java +341 -0
  238. data/lib/openssl/src/java/org/jruby/ext/openssl/OpenSSLReal.java +113 -0
  239. data/lib/openssl/src/java/org/jruby/ext/openssl/PEMHandler.java +40 -0
  240. data/lib/openssl/src/java/org/jruby/ext/openssl/PKCS10CertificationRequestExt.java +159 -0
  241. data/lib/openssl/src/java/org/jruby/ext/openssl/PKCS7.java +642 -0
  242. data/lib/openssl/src/java/org/jruby/ext/openssl/PKey.java +154 -0
  243. data/lib/openssl/src/java/org/jruby/ext/openssl/PKeyDH.java +401 -0
  244. data/lib/openssl/src/java/org/jruby/ext/openssl/PKeyDSA.java +419 -0
  245. data/lib/openssl/src/java/org/jruby/ext/openssl/PKeyRSA.java +762 -0
  246. data/lib/openssl/src/java/org/jruby/ext/openssl/Random.java +103 -0
  247. data/lib/openssl/src/java/org/jruby/ext/openssl/Request.java +336 -0
  248. data/lib/openssl/src/java/org/jruby/ext/openssl/SSL.java +71 -0
  249. data/lib/openssl/src/java/org/jruby/ext/openssl/SSLContext.java +358 -0
  250. data/lib/openssl/src/java/org/jruby/ext/openssl/SSLSocket.java +561 -0
  251. data/lib/openssl/src/java/org/jruby/ext/openssl/SimpleSecretKey.java +53 -0
  252. data/lib/openssl/src/java/org/jruby/ext/openssl/Utils.java +60 -0
  253. data/lib/openssl/src/java/org/jruby/ext/openssl/X509.java +108 -0
  254. data/lib/openssl/src/java/org/jruby/ext/openssl/X509CRL.java +446 -0
  255. data/lib/openssl/src/java/org/jruby/ext/openssl/X509Cert.java +520 -0
  256. data/lib/openssl/src/java/org/jruby/ext/openssl/X509Extensions.java +751 -0
  257. data/lib/openssl/src/java/org/jruby/ext/openssl/X509Name.java +405 -0
  258. data/lib/openssl/src/java/org/jruby/ext/openssl/X509Revoked.java +111 -0
  259. data/lib/openssl/src/java/org/jruby/ext/openssl/X509Store.java +282 -0
  260. data/lib/openssl/src/java/org/jruby/ext/openssl/X509StoreCtx.java +206 -0
  261. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/ASN1Registry.java +5135 -0
  262. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Attribute.java +79 -0
  263. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/BIO.java +345 -0
  264. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/BIOFilter.java +38 -0
  265. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Base64BIOFilter.java +84 -0
  266. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/CipherBIOFilter.java +157 -0
  267. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Digest.java +126 -0
  268. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/EVP.java +136 -0
  269. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/EncContent.java +178 -0
  270. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Encrypt.java +77 -0
  271. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Envelope.java +169 -0
  272. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/IssuerAndSerial.java +35 -0
  273. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MemBIO.java +117 -0
  274. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MessageDigestBIOFilter.java +76 -0
  275. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Mime.java +245 -0
  276. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MimeHeader.java +103 -0
  277. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/MimeParam.java +69 -0
  278. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/NotVerifiedPKCS7Exception.java +38 -0
  279. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/NullSinkBIO.java +52 -0
  280. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7.java +1276 -0
  281. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7Data.java +168 -0
  282. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataData.java +88 -0
  283. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataDigest.java +64 -0
  284. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataEncrypted.java +61 -0
  285. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataEnveloped.java +85 -0
  286. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataSigned.java +127 -0
  287. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7DataSignedAndEnveloped.java +91 -0
  288. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/PKCS7Exception.java +68 -0
  289. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/RecipInfo.java +244 -0
  290. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/SMIME.java +281 -0
  291. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/SignEnvelope.java +202 -0
  292. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/Signed.java +345 -0
  293. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/SignerInfoWithPkey.java +365 -0
  294. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/TypeDiscriminating.java +34 -0
  295. data/lib/openssl/src/java/org/jruby/ext/openssl/impl/utils/Base64.java +1809 -0
  296. data/lib/openssl/src/java/org/jruby/ext/openssl/util/Base64Coder.java +103 -0
  297. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/CRL.java +59 -0
  298. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Certificate.java +57 -0
  299. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/CertificateFile.java +46 -0
  300. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/CertificateHashDir.java +46 -0
  301. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function0.java +43 -0
  302. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function1.java +43 -0
  303. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function2.java +43 -0
  304. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function3.java +43 -0
  305. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function4.java +43 -0
  306. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Function5.java +43 -0
  307. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Lookup.java +560 -0
  308. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/LookupMethod.java +84 -0
  309. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Name.java +85 -0
  310. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/PEMInputOutput.java +1210 -0
  311. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/PKey.java +41 -0
  312. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/PolicyTree.java +36 -0
  313. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Purpose.java +475 -0
  314. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Store.java +377 -0
  315. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/StoreContext.java +1356 -0
  316. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/Trust.java +279 -0
  317. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/VerifyParameter.java +324 -0
  318. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Aux.java +43 -0
  319. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509AuxCertificate.java +170 -0
  320. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Error.java +70 -0
  321. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Object.java +88 -0
  322. data/lib/openssl/src/java/org/jruby/ext/openssl/x509store/X509Utils.java +541 -0
  323. data/lib/openssl/test/cert_with_ec_pk.cer +27 -0
  324. data/lib/openssl/test/fixture/ca_path/72fa7371.0 +19 -0
  325. data/lib/openssl/test/fixture/ca_path/verisign.pem +19 -0
  326. data/lib/openssl/test/fixture/cacert.pem +23 -0
  327. data/lib/openssl/test/fixture/cert_localhost.pem +19 -0
  328. data/lib/openssl/test/fixture/common.pem +48 -0
  329. data/lib/openssl/test/fixture/localhost_keypair.pem +18 -0
  330. data/lib/openssl/test/fixture/max.pem +29 -0
  331. data/lib/openssl/test/fixture/purpose/b70a5bc1.0 +24 -0
  332. data/lib/openssl/test/fixture/purpose/ca/PASSWD_OF_CA_KEY_IS_1234 +0 -0
  333. data/lib/openssl/test/fixture/purpose/ca/ca_config.rb +37 -0
  334. data/lib/openssl/test/fixture/purpose/ca/cacert.pem +24 -0
  335. data/lib/openssl/test/fixture/purpose/ca/newcerts/2_cert.pem +19 -0
  336. data/lib/openssl/test/fixture/purpose/ca/newcerts/3_cert.pem +19 -0
  337. data/lib/openssl/test/fixture/purpose/ca/private/cakeypair.pem +30 -0
  338. data/lib/openssl/test/fixture/purpose/ca/serial +1 -0
  339. data/lib/openssl/test/fixture/purpose/cacert.pem +24 -0
  340. data/lib/openssl/test/fixture/purpose/scripts/gen_cert.rb +127 -0
  341. data/lib/openssl/test/fixture/purpose/scripts/gen_csr.rb +50 -0
  342. data/lib/openssl/test/fixture/purpose/scripts/init_ca.rb +66 -0
  343. data/lib/openssl/test/fixture/purpose/sslclient.pem +19 -0
  344. data/lib/openssl/test/fixture/purpose/sslclient/csr.pem +10 -0
  345. data/lib/openssl/test/fixture/purpose/sslclient/keypair.pem +15 -0
  346. data/lib/openssl/test/fixture/purpose/sslclient/sslclient.pem +19 -0
  347. data/lib/openssl/test/fixture/purpose/sslserver.pem +19 -0
  348. data/lib/openssl/test/fixture/purpose/sslserver/csr.pem +10 -0
  349. data/lib/openssl/test/fixture/purpose/sslserver/keypair.pem +15 -0
  350. data/lib/openssl/test/fixture/purpose/sslserver/sslserver.pem +19 -0
  351. data/lib/openssl/test/fixture/verisign.pem +19 -0
  352. data/lib/openssl/test/fixture/verisign_c3.pem +14 -0
  353. data/lib/openssl/test/openssl/ssl_server.rb +99 -0
  354. data/lib/openssl/test/openssl/test_asn1.rb +199 -0
  355. data/lib/openssl/test/openssl/test_cipher.rb +196 -0
  356. data/lib/openssl/test/openssl/test_digest.rb +88 -0
  357. data/lib/openssl/test/openssl/test_hmac.rb +44 -0
  358. data/lib/openssl/test/openssl/test_ns_spki.rb +69 -0
  359. data/lib/openssl/test/openssl/test_pair.rb +149 -0
  360. data/lib/openssl/test/openssl/test_pkcs7.rb +160 -0
  361. data/lib/openssl/test/openssl/test_pkey_rsa.rb +49 -0
  362. data/lib/openssl/test/openssl/test_ssl.rb +413 -0
  363. data/lib/openssl/test/openssl/test_x509cert.rb +236 -0
  364. data/lib/openssl/test/openssl/test_x509crl.rb +234 -0
  365. data/lib/openssl/test/openssl/test_x509ext.rb +95 -0
  366. data/lib/openssl/test/openssl/test_x509name.rb +281 -0
  367. data/lib/openssl/test/openssl/test_x509req.rb +178 -0
  368. data/lib/openssl/test/openssl/test_x509store.rb +245 -0
  369. data/lib/openssl/test/openssl/utils.rb +135 -0
  370. data/lib/openssl/test/pkcs7_mime_enveloped.message +19 -0
  371. data/lib/openssl/test/pkcs7_mime_signed.message +30 -0
  372. data/lib/openssl/test/pkcs7_multipart_signed.message +45 -0
  373. data/lib/openssl/test/ref/compile.rb +8 -0
  374. data/lib/openssl/test/ref/pkcs1 +0 -0
  375. data/lib/openssl/test/ref/pkcs1.c +21 -0
  376. data/lib/openssl/test/test_cipher.rb +95 -0
  377. data/lib/openssl/test/test_integration.rb +139 -0
  378. data/lib/openssl/test/test_java.rb +98 -0
  379. data/lib/openssl/test/test_java_attribute.rb +25 -0
  380. data/lib/openssl/test/test_java_bio.rb +42 -0
  381. data/lib/openssl/test/test_java_mime.rb +173 -0
  382. data/lib/openssl/test/test_java_pkcs7.rb +769 -0
  383. data/lib/openssl/test/test_java_smime.rb +177 -0
  384. data/lib/openssl/test/test_openssl.rb +34 -0
  385. data/lib/openssl/test/test_openssl_x509.rb +34 -0
  386. data/lib/openssl/test/test_parse_certificate.rb +20 -0
  387. data/lib/openssl/test/test_pkey.rb +46 -0
  388. data/lib/openssl/test/test_x509store.rb +155 -0
  389. data/lib/openssl/test/ut_eof.rb +128 -0
  390. data/lib/redcar.rb +134 -8
  391. data/lib/redcar/installer.rb +46 -11
  392. data/lib/redcar/runner.rb +2 -1
  393. data/lib/redcar/usage.rb +12 -5
  394. data/lib/redcar_quick_start.rb +37 -0
  395. data/plugins/application/features/support/env.rb +9 -1
  396. data/plugins/application/icons/redcar_icon_beta.png +0 -0
  397. data/plugins/application/lib/application.rb +113 -43
  398. data/plugins/application/lib/application/clipboard.rb +28 -4
  399. data/plugins/application/lib/application/command.rb +4 -12
  400. data/plugins/application/lib/application/command/executor.rb +2 -2
  401. data/plugins/application/lib/application/keymap.rb +39 -0
  402. data/plugins/application/lib/application/keymap/builder.rb +19 -0
  403. data/plugins/application/lib/application/speedbar.rb +33 -24
  404. data/plugins/application/lib/application/tab.rb +15 -0
  405. data/plugins/application/lib/application/window.rb +28 -5
  406. data/plugins/application/spec/application/clipboard_spec.rb +20 -1
  407. data/plugins/application/spec/application/command/executor_spec.rb +7 -2
  408. data/plugins/application/spec/application/command_spec.rb +0 -5
  409. data/plugins/application/spec/application/keymap/builder_spec.rb +17 -0
  410. data/plugins/application/spec/application/menu_spec.rb +30 -0
  411. data/plugins/application/spec/application/speedbar_spec.rb +30 -6
  412. data/plugins/application/spec/application/window_spec.rb +2 -2
  413. data/plugins/application/spec/spec_helper.rb +1 -1
  414. data/plugins/application_swt/lib/application_swt.rb +3 -0
  415. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +10 -1
  416. data/plugins/application_swt/lib/application_swt/html_tab.rb +1 -0
  417. data/plugins/application_swt/lib/application_swt/menu.rb +4 -3
  418. data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +12 -4
  419. data/plugins/application_swt/lib/application_swt/speedbar.rb +105 -19
  420. data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +2 -0
  421. data/plugins/application_swt/lib/application_swt/window.rb +55 -23
  422. data/plugins/application_swt/spec/spec_helper.rb +0 -1
  423. data/plugins/auto_completer/lib/auto_completer.rb +57 -3
  424. data/plugins/auto_indenter/lib/auto_indenter.rb +1 -1
  425. data/plugins/core/lib/core.rb +5 -3
  426. data/plugins/core/lib/core/interface.rb +73 -0
  427. data/plugins/core/lib/core/model.rb +2 -0
  428. data/plugins/core/lib/core/observable.rb +12 -1
  429. data/plugins/core/lib/core/observable_struct.rb +34 -0
  430. data/plugins/core/lib/core/plugin/storage.rb +16 -3
  431. data/plugins/core/lib/core/reentry_helpers.rb +13 -0
  432. data/plugins/core/spec/core/observable_spec.rb +13 -0
  433. data/plugins/core/spec/core/storage_spec.rb +18 -0
  434. data/plugins/core/spec/spec_helper.rb +1 -0
  435. data/plugins/edit_view/features/cut_and_paste.feature +4 -2
  436. data/plugins/edit_view/features/soft_tabs.feature +243 -0
  437. data/plugins/edit_view/features/step_definitions/editing_steps.rb +91 -2
  438. data/plugins/edit_view/features/step_definitions/tab_steps.rb +1 -1
  439. data/plugins/edit_view/features/tabs.feature +146 -0
  440. data/plugins/edit_view/lib/edit_view.rb +197 -8
  441. data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +121 -0
  442. data/plugins/edit_view/lib/edit_view/actions/deletion.rb +30 -0
  443. data/plugins/edit_view/lib/edit_view/actions/tab.rb +66 -0
  444. data/plugins/edit_view/lib/edit_view/command.rb +0 -2
  445. data/plugins/edit_view/lib/edit_view/document.rb +62 -27
  446. data/plugins/edit_view/lib/edit_view/document/command.rb +11 -0
  447. data/plugins/edit_view/lib/edit_view/edit_tab.rb +2 -1
  448. data/plugins/edit_view/lib/edit_view/info_speedbar.rb +69 -0
  449. data/plugins/edit_view/lib/edit_view/tab_settings.rb +40 -0
  450. data/plugins/edit_view/spec/edit_view/document_spec.rb +26 -0
  451. data/plugins/edit_view/spec/spec_helper.rb +0 -1
  452. data/plugins/edit_view_swt/lib/edit_view_swt.rb +57 -69
  453. data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +24 -3
  454. data/plugins/edit_view_swt/lib/edit_view_swt/edit_tab.rb +23 -6
  455. data/plugins/edit_view_swt/spec/spec_helper.rb +0 -1
  456. data/plugins/edit_view_swt/vendor/java-mateview.rb +19 -2
  457. data/plugins/encryption/encryption.rb +38 -0
  458. data/plugins/encryption/ezcrypto.rb +652 -0
  459. data/plugins/encryption/jarmor-1.1.jar +0 -0
  460. data/plugins/encryption/plugin.rb +9 -0
  461. data/plugins/execute_current_tab/lib/execute_current_tab.rb +56 -0
  462. data/plugins/execute_current_tab/plugin.rb +8 -0
  463. data/plugins/html_view/lib/html_view.rb +16 -11
  464. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +2 -1
  465. data/plugins/plugin_manager_ui/views/index.html.erb +22 -4
  466. data/plugins/project/lib/project.rb +140 -26
  467. data/plugins/project/lib/project/drb_service.rb +75 -0
  468. data/plugins/project/lib/project/file_mirror.rb +5 -5
  469. data/plugins/project/lib/project/find_file_dialog.rb +123 -32
  470. data/plugins/project/spec/project/file_mirror_spec.rb +10 -1
  471. data/plugins/project/spec/spec_helper.rb +0 -1
  472. data/plugins/redcar/plugin.rb +1 -1
  473. data/plugins/redcar/redcar.rb +204 -109
  474. data/plugins/redcar/spec/redcar/redcar_spec.rb +70 -0
  475. data/plugins/redcar/spec/spec_helper.rb +4 -0
  476. data/plugins/repl/lib/repl.rb +14 -7
  477. data/plugins/repl/lib/repl/internal_mirror.rb +43 -22
  478. data/plugins/repl/spec/repl/internal_mirror_spec.rb +34 -7
  479. data/plugins/repl/spec/spec_helper.rb +0 -1
  480. data/plugins/tree/spec/spec_helper.rb +0 -1
  481. data/plugins/tree_view_swt/lib/tree_view_swt.rb +1 -1
  482. data/textmate/Bundles/RedcarRepl.tmbundle/Syntaxes/InternalRuby.plist +2 -18
  483. data/textmate/Bundles/asciidoc.tmbundle/Syntaxes/AsciiDoc.tmLanguage +428 -0
  484. metadata +790 -371
  485. data/lib/redcar/boot.rb +0 -108
@@ -2,7 +2,6 @@ $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
2
 
3
3
  require 'redcar'
4
4
 
5
- Redcar.boot
6
5
  Redcar.load
7
6
 
8
7
  Spec::Runner.configure do |config|
@@ -1,4 +1,12 @@
1
-
1
+ module Redcar
2
+ class ApplicationSWT
3
+ class Menu
4
+ def move(x, y)
5
+ @menu_bar.setLocation(x, y)
6
+ end
7
+ end
8
+ end
9
+ end
2
10
 
3
11
  require 'auto_completer/document_controller'
4
12
  require 'auto_completer/word_iterator'
@@ -13,8 +21,6 @@ module Redcar
13
21
  end
14
22
 
15
23
  class AutoCompleteCommand < Redcar::EditTabCommand
16
- key :osx => "Ctrl+Escape", :linux => "Ctrl+Space",
17
- :windows => "Ctrl+Space"
18
24
 
19
25
  def execute
20
26
  controller = doc.controllers(AutoCompleter::DocumentController).first
@@ -95,5 +101,53 @@ module Redcar
95
101
  return [offset+left_range, offset+right_range]
96
102
  end
97
103
  end
104
+
105
+ class MenuAutoCompleterCommand < AutoCompleteCommand
106
+
107
+ def execute
108
+ controller = doc.controllers(AutoCompleter::DocumentController).first
109
+ input_word = ""
110
+ word_list = controller.word_list
111
+ word, left, right = touched_word
112
+ if word
113
+ iterator = WordIterator.new(doc, WORD_CHARACTERS)
114
+ word_list = WordList.new
115
+ iterator.each_word_with_offset(word) do |matching_word, offset|
116
+ distance = (offset - doc.cursor_offset).abs
117
+ unless (distance - matching_word.length) == 0
118
+ word_list.add_word(matching_word, distance)
119
+ else
120
+ input_word = matching_word
121
+ end
122
+ end
123
+ controller.word_list = word_list
124
+ controller.word = word
125
+ controller.left = left
126
+ controller.right = right
127
+ end
128
+
129
+ cur_doc = doc
130
+ builder = Menu::Builder.new do
131
+ word_list.words.each do |current_word, word_distance|
132
+ item(current_word) do
133
+ cur_doc.insert(cur_doc.cursor_offset, current_word[input_word.length..current_word.length])
134
+ cur_doc.cursor_offset = cur_doc.cursor_offset + current_word[input_word.length..current_word.length].length
135
+ end
136
+ end
137
+ end
138
+
139
+ window = Redcar.app.focussed_window
140
+ location = window.focussed_notebook.focussed_tab.controller.edit_view.mate_text.viewer.getTextWidget.getLocationAtOffset(window.focussed_notebook.focussed_tab.controller.edit_view.cursor_offset)
141
+ absolute_x = location.x
142
+ absolute_y = location.y
143
+ location = window.focussed_notebook.focussed_tab.controller.edit_view.mate_text.viewer.getTextWidget.toDisplay(0,0)
144
+ absolute_x += location.x
145
+ absolute_y += location.y
146
+ menu = ApplicationSWT::Menu.new(window.controller, builder.menu, nil, Swt::SWT::POP_UP)
147
+ menu.move(absolute_x, absolute_y)
148
+ menu.show
149
+ end
150
+
151
+ end
98
152
  end
99
153
  end
@@ -7,6 +7,6 @@ module Redcar
7
7
  def self.start
8
8
  Document.register_controller_type(AutoIndenter::DocumentController)
9
9
  end
10
+
10
11
  end
11
12
  end
12
-
@@ -1,11 +1,15 @@
1
1
 
2
+ require 'java'
2
3
  require 'fileutils'
3
4
 
4
5
  require "core/logger"
6
+ require "core/reentry_helpers"
5
7
  require "core/controller"
6
8
  require "core/gui"
9
+ require "core/interface"
7
10
  require "core/model"
8
11
  require "core/observable"
12
+ require "core/observable_struct"
9
13
  require "core/plugin"
10
14
  require "core/plugin/storage"
11
15
 
@@ -18,9 +22,7 @@ module Redcar
18
22
  unless File.exist?(Redcar.user_dir)
19
23
  FileUtils.mkdir(Redcar.user_dir)
20
24
  end
21
-
22
25
  end
23
-
26
+
24
27
  end
25
28
  end
26
-
@@ -0,0 +1,73 @@
1
+ # This module helps API authors to document the interfaces their API requires objects
2
+ # to implement.
3
+ #
4
+ # Example.
5
+ #
6
+ # The EditView class allows plugins to register tab handlers. A tab handler must implement
7
+ # the "handle" method:
8
+ #
9
+ # class MyTabHandler
10
+ # def handle(edit_view)
11
+ # end
12
+ # end
13
+ #
14
+ # The EditView class wants to check that the object (at least minimally) conforms to the
15
+ # tab handler interface, so it defines an 'example' module and mixes in Interface::Abstract.
16
+ #
17
+ # class EditView
18
+ # module Handler
19
+ # include Interface::Abstract
20
+ #
21
+ # def handle(edit_view)
22
+ #  end
23
+ # end
24
+ #
25
+ # The Abstract module will not allow this example interface to be mixed in anywhere.
26
+ # To verify that any given object conforms to the interface, EditView calls verify_interface!:
27
+ #
28
+ # def self.register_tab_handler(tab_handler)
29
+ # EditView::Handler.verify_interface!(tab_handler)
30
+ # @tab_handlers << tab_handler
31
+ # end
32
+ # end
33
+ #
34
+ # This will raise an error if the instance does not implement all the methods in the example
35
+ # interface with the correct aritys.
36
+ class Interface
37
+ module Abstract
38
+ def self.included(klass)
39
+ klass.class_eval do
40
+ def self.included(klass)
41
+ raise "#{klass} is trying to mixin #{self}, which is an abstract interface"
42
+ end
43
+
44
+ def self.verify_interface!(instance)
45
+ Interface.verify!(self, instance)
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ class BadInterfaceError < StandardError; end
52
+
53
+ def self.verify(interface, instance)
54
+ interface.instance_methods.all? do |method_name|
55
+ method = interface.instance_method(method_name)
56
+ instance.respond_to?(method_name) and
57
+ instance.method(method_name).arity == method.arity
58
+ end
59
+ end
60
+
61
+ def self.verify!(interface, instance)
62
+ interface.instance_methods.each do |method_name|
63
+ method = interface.instance_method(method_name)
64
+ unless instance.respond_to?(method_name)
65
+ raise BadInterfaceError, "expected #{instance.inspect} to implement #{interface}, but was missing :#{method_name}"
66
+ end
67
+ unless instance.method(method_name).arity == method.arity
68
+ raise BadInterfaceError, "expected #{instance.inspect} to implement #{interface}, but :#{method_name} arity was not #{method.arity}"
69
+ end
70
+ end
71
+ true
72
+ end
73
+ end
@@ -1,5 +1,7 @@
1
1
  module Redcar
2
2
  module Model
3
+ include Redcar::ReentryHelpers
4
+
3
5
  attr_reader :controller
4
6
 
5
7
  def controller=(controller)
@@ -58,7 +58,7 @@ module Redcar
58
58
  :after => 1
59
59
  }
60
60
 
61
- # Attach a block to be called when any of the hooks in hooks are
61
+ # Attach a block to be called when any of the hooks in event_names are
62
62
  # called.
63
63
  #
64
64
  # @param [Array<Symbol>] names of the events to attach to
@@ -76,6 +76,17 @@ module Redcar
76
76
  block
77
77
  end
78
78
 
79
+ # Same as add_listener
80
+ # but only adds the listener once, based on
81
+ # @param [key]
82
+ def add_listener_at_most_once(key, *event_names)
83
+ @already_here ||= {}
84
+ unless @already_here[key]
85
+ add_listener(*event_names) { |*args| yield(*args) }
86
+ @already_here[key] = true
87
+ end
88
+ end
89
+
79
90
  # Remove a listener from this object.
80
91
  #
81
92
  # @param [Handler] an event handler as returned by add_listener
@@ -0,0 +1,34 @@
1
+
2
+ # Adds Redcar::Observable to Struct. e.g:
3
+ #
4
+ # irb> Customer = ObservableStruct.new(:name, :address)
5
+ # => Customer
6
+ # irb> customer = Customer.new("Dave", "123 Main")
7
+ # => #<Customer name="Dave", address="123 Main">
8
+ # irb> customer.add_listener(:changed_name) { |new_name| puts "the new name is: #{new_name}" }
9
+ # => #<Proc:0x65f4cdd2@(irb):203>
10
+ # irb> customer.name = "Dan"
11
+ # the new name is Dan
12
+ # => #<Customer name="Dan", address="123 Main">
13
+ class ObservableStruct
14
+ def self.new(*args)
15
+ klass = Struct.new(*args)
16
+ klass.send(:include, Redcar::Observable)
17
+ if args.first.is_a?(String)
18
+ accessors = args[1..-1]
19
+ else
20
+ accessors = args
21
+ end
22
+ accessors.each do |accessor|
23
+ klass.class_eval %Q{
24
+ alias_method :real_#{accessor}=, :#{accessor}=
25
+ def #{accessor}=(val)
26
+ notify_listeners(:changed_#{accessor}, val) do
27
+ self.real_#{accessor} = val
28
+ end
29
+ end
30
+ }
31
+ end
32
+ klass
33
+ end
34
+ end
@@ -2,9 +2,12 @@
2
2
  module Redcar
3
3
  class Plugin
4
4
  class Storage
5
-
5
+ class << self
6
+ attr_writer :storage_dir
7
+ end
8
+
6
9
  def self.storage_dir
7
- Redcar.user_dir
10
+ @user_dir ||= Redcar.user_dir
8
11
  end
9
12
 
10
13
  # Open a storage file or create it if it doesn't exist.
@@ -12,7 +15,6 @@ module Redcar
12
15
  # @param [String] a (short) name, should be suitable for use as a filename
13
16
  def initialize(name)
14
17
  @name = name
15
- @storage = {}
16
18
  rollback
17
19
  end
18
20
 
@@ -33,16 +35,27 @@ module Redcar
33
35
  self
34
36
  end
35
37
 
38
+ # retrieve key value
39
+ # note: it does not re-read from disk before returning you this value
36
40
  def [](key)
37
41
  @storage[key]
38
42
  end
39
43
 
44
+ # set key to value
45
+ # note: it automatically saves this to disk
40
46
  def []=(key, value)
41
47
  @storage[key] = value
42
48
  save
43
49
  value
44
50
  end
45
51
 
52
+ def set_default(key, value)
53
+ unless @storage[key]
54
+ self[key] = value
55
+ end
56
+ value
57
+ end
58
+
46
59
  def keys
47
60
  @storage.keys
48
61
  end
@@ -0,0 +1,13 @@
1
+ module Redcar
2
+ module ReentryHelpers
3
+ def ignore_changes
4
+ @ignore_changes ||= Hash.new(0)
5
+ end
6
+
7
+ def ignore(name)
8
+ ignore_changes[name] += 1
9
+ yield if ignore_changes[name] == 1
10
+ ignore_changes[name] -= 1
11
+ end
12
+ end
13
+ end
@@ -97,6 +97,19 @@ describe Redcar::Observable do
97
97
  @value.should be_nil
98
98
  end
99
99
  end
100
+
101
+
102
+ it "hooks only once if desired" do
103
+ sum = 0
104
+ 2.times {
105
+ @obj.add_listener_at_most_once(self, :christmas) do
106
+ sum += 1
107
+ end
108
+ }
109
+ @obj.trigger_event(:christmas)
110
+ sum.should == 1
111
+ end
112
+
100
113
  end
101
114
 
102
115
 
@@ -2,12 +2,15 @@
2
2
  require File.join(File.dirname(__FILE__), "..", "spec_helper")
3
3
 
4
4
  describe Redcar::Plugin::Storage do
5
+
5
6
  it "acts like a hash" do
6
7
  storage = Redcar::Plugin::Storage.new('test')
7
8
  storage[:some_key] = "some value"
8
9
  storage[:some_key].should == "some value"
9
10
  storage[:some_key] = "some other value"
10
11
  storage[:some_key].should == "some other value"
12
+
13
+ FileUtils.rm_rf(storage.send(:path))
11
14
  end
12
15
 
13
16
  it "saves to disk" do
@@ -17,5 +20,20 @@ describe Redcar::Plugin::Storage do
17
20
  storage[:some_key].should == "some value"
18
21
 
19
22
  FileUtils.rm_rf(storage.send(:path))
23
+ storage = Redcar::Plugin::Storage.new('test_storage_saved')
24
+ storage[:some_key].should be_nil
20
25
  end
26
+
27
+ it "has a set default method" do
28
+ storage = Redcar::Plugin::Storage.new('test_storage_saved')
29
+ storage.set_default('a', 'b')
30
+ storage['a'].should == 'b'
31
+ storage = Redcar::Plugin::Storage.new('test_storage_saved')
32
+ storage['a'].should == 'b'
33
+ storage['a'] = 'c'
34
+ storage['a'].should == 'c'
35
+ storage = Redcar::Plugin::Storage.new('test_storage_saved')
36
+ storage['a'].should == 'c'
37
+ end
38
+
21
39
  end
@@ -1,4 +1,5 @@
1
1
  $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
2
 
3
3
  require 'redcar'
4
+ Redcar.environment = :test
4
5
  Redcar.load
@@ -22,7 +22,7 @@ Feature: Cut and Paste
22
22
  And I cut text
23
23
  And I move the cursor to 2
24
24
  And I paste text
25
- Then I should see "nkFra" in the edit tab
25
+ Then the contents should be "nkFra<c>"
26
26
 
27
27
  Scenario: Paste inserts the copied text
28
28
  When I open a new edit tab
@@ -32,6 +32,7 @@ Feature: Cut and Paste
32
32
  And I move the cursor to 2
33
33
  And I paste text
34
34
  Then I should see "FrFraank" in the edit tab
35
+ Then the contents should be "FrFra<c>ank"
35
36
 
36
37
  Scenario: Paste pastes the most recent copy
37
38
  When I open a new edit tab
@@ -42,4 +43,5 @@ Feature: Cut and Paste
42
43
  And I copy text
43
44
  And I move the cursor to 0
44
45
  And I paste text
45
- Then I should see "nkFrank" in the edit tab
46
+ Then the contents should be "nk<c>Frank"
47
+
@@ -0,0 +1,243 @@
1
+ Feature: Soft and hard tabs
2
+
3
+ Scenario: Move left through soft tabs
4
+ When I open a new edit tab
5
+ And tabs are soft, 2 spaces
6
+ And I replace the contents with " "
7
+ And I move the cursor to 4
8
+ And I press the Left key in the edit tab
9
+ Then the cursor should be at 2
10
+
11
+ Scenario: Move right through soft tabs
12
+ When I open a new edit tab
13
+ And tabs are soft, 2 spaces
14
+ And I replace the contents with " "
15
+ And I move the cursor to 0
16
+ And I press the Right key in the edit tab
17
+ Then the cursor should be at 2
18
+
19
+ Scenario: Moves left through part of a soft tab
20
+ When I open a new edit tab
21
+ And tabs are soft, 4 spaces
22
+ And I replace the contents with "Hacker "
23
+ And I move the cursor to 8
24
+ And I press the Left key in the edit tab
25
+ Then the cursor should be at 6
26
+
27
+ Scenario: Moves right through part of a soft tab
28
+ When I open a new edit tab
29
+ And tabs are soft, 4 spaces
30
+ And I replace the contents with "Hacker "
31
+ And I move the cursor to 6
32
+ And I press the Right key in the edit tab
33
+ Then the cursor should be at 8
34
+
35
+ Scenario: Moves left through spaces that don't make a full tab
36
+ When I open a new edit tab
37
+ And tabs are soft, 4 spaces
38
+ And I replace the contents with "Hacker "
39
+ And I move the cursor to 10
40
+ And I press the Left key in the edit tab
41
+ Then the cursor should be at 9
42
+
43
+ Scenario: Moves right through spaces that don't make a full tab
44
+ When I open a new edit tab
45
+ And tabs are soft, 4 spaces
46
+ And I replace the contents with "Hacker "
47
+ And I move the cursor to 8
48
+ And I press the Right key in the edit tab
49
+ Then the cursor should be at 9
50
+
51
+ Scenario: Shouldn't die if the cursor is at the start of the document
52
+ When I open a new edit tab
53
+ And tabs are soft, 4 spaces
54
+ And I replace the contents with ""
55
+ And I move the cursor to 0
56
+ And I press the Left key in the edit tab
57
+ Then the cursor should be at 0
58
+
59
+ Scenario: Shouldn't die if the cursor is at the end of the document
60
+ When I open a new edit tab
61
+ And tabs are soft, 4 spaces
62
+ And I replace the contents with ""
63
+ And I move the cursor to 0
64
+ And I press the Right key in the edit tab
65
+ Then the cursor should be at 0
66
+
67
+ Scenario: Move left through soft tabs, with a tab character
68
+ When I open a new edit tab
69
+ And tabs are soft, 4 spaces
70
+ And I replace the contents with "\tHa "
71
+ And I move the cursor to 1
72
+ And I press the Left key in the edit tab
73
+ Then the cursor should be at 0
74
+
75
+ Scenario: Move left through soft tabs 2, with a tab character
76
+ When I open a new edit tab
77
+ And tabs are soft, 4 spaces
78
+ And I replace the contents with "\tHa "
79
+ And I move the cursor to 2
80
+ And I press the Left key in the edit tab
81
+ Then the cursor should be at 1
82
+
83
+ Scenario: Move left through soft tabs 2, with a tab character
84
+ When I open a new edit tab
85
+ And tabs are soft, 4 spaces
86
+ And I replace the contents with "\tHa "
87
+ And I move the cursor to 4
88
+ And I press the Left key in the edit tab
89
+ Then the cursor should be at 3
90
+
91
+ Scenario: Move left through soft tabs 3, with a tab character
92
+ When I open a new edit tab
93
+ And tabs are soft, 4 spaces
94
+ And I replace the contents with "\tHa "
95
+ And I move the cursor to 5
96
+ And I press the Left key in the edit tab
97
+ Then the cursor should be at 3
98
+
99
+ Scenario: Move left through soft tabs 4, with a tab character
100
+ When I open a new edit tab
101
+ And tabs are soft, 4 spaces
102
+ And I replace the contents with "\tHa "
103
+ And I move the cursor to 6
104
+ And I press the Left key in the edit tab
105
+ Then the cursor should be at 5
106
+
107
+ Scenario: Move right through soft tabs, with a tab character
108
+ When I open a new edit tab
109
+ And tabs are soft, 4 spaces
110
+ And I replace the contents with "\tHa "
111
+ And I move the cursor to 0
112
+ And I press the Right key in the edit tab
113
+ Then the cursor should be at 1
114
+
115
+ Scenario: Move right through soft tabs 2, with a tab character
116
+ When I open a new edit tab
117
+ And tabs are soft, 4 spaces
118
+ And I replace the contents with "\tHa "
119
+ And I move the cursor to 1
120
+ And I press the Right key in the edit tab
121
+ Then the cursor should be at 2
122
+
123
+ Scenario: Move right through soft tabs 2, with a tab character
124
+ When I open a new edit tab
125
+ And tabs are soft, 4 spaces
126
+ And I replace the contents with "\tHa "
127
+ And I move the cursor to 3
128
+ And I press the Right key in the edit tab
129
+ Then the cursor should be at 5
130
+
131
+ Scenario: Move right through soft tabs 3, with a tab character
132
+ When I open a new edit tab
133
+ And tabs are soft, 4 spaces
134
+ And I replace the contents with "\tHa "
135
+ And I move the cursor to 5
136
+ And I press the Right key in the edit tab
137
+ Then the cursor should be at 6
138
+
139
+ Scenario: Move left through soft tabs, with a tab character ahead
140
+ When I open a new edit tab
141
+ And tabs are soft, 4 spaces
142
+ And I replace the contents with " Wo\t"
143
+ And I move the cursor to 4
144
+ And I press the Left key in the edit tab
145
+ Then the cursor should be at 0
146
+
147
+ Scenario: Select left through soft tabs
148
+ When I open a new edit tab
149
+ And tabs are soft, 2 spaces
150
+ And I replace the contents with " "
151
+ And I move the cursor to 4
152
+ And I press Shift+Left key in the edit tab
153
+ Then the contents should be " <c> <s>"
154
+
155
+ Scenario: Select right through soft tabs
156
+ When I open a new edit tab
157
+ And tabs are soft, 2 spaces
158
+ And I replace the contents with " "
159
+ And I move the cursor to 2
160
+ And I press Shift+Right key in the edit tab
161
+ Then the contents should be " <s> <c>"
162
+
163
+ Scenario: Select left twice through soft tabs
164
+ When I open a new edit tab
165
+ And tabs are soft, 2 spaces
166
+ And I replace the contents with " "
167
+ And I move the cursor to 4
168
+ And I press Shift+Left key in the edit tab
169
+ And I press Shift+Left key in the edit tab
170
+ Then the contents should be "<c> <s>"
171
+
172
+ Scenario: Select right through soft tabs
173
+ When I open a new edit tab
174
+ And tabs are soft, 2 spaces
175
+ And I replace the contents with " "
176
+ And I move the cursor to 0
177
+ And I press Shift+Right key in the edit tab
178
+ And I press Shift+Right key in the edit tab
179
+ Then the contents should be "<s> <c>"
180
+
181
+ Scenario: Shouldn't die if the cursor is at the start of the document
182
+ When I open a new edit tab
183
+ And tabs are soft, 4 spaces
184
+ And I replace the contents with ""
185
+ And I move the cursor to 0
186
+ And I press Shift+Left key in the edit tab
187
+ Then the cursor should be at 0
188
+
189
+ Scenario: Shouldn't die if the cursor is at the end of the document
190
+ When I open a new edit tab
191
+ And tabs are soft, 4 spaces
192
+ And I replace the contents with ""
193
+ And I move the cursor to 0
194
+ And I press Shift+Right key in the edit tab
195
+ Then the cursor should be at 0
196
+
197
+ Scenario: Can backspace a soft tab
198
+ When I open a new edit tab
199
+ And tabs are soft, 4 spaces
200
+ And I replace the contents with " "
201
+ And I move the cursor to 4
202
+ And I press the Backspace key in the edit tab
203
+ Then the contents should be "<c>"
204
+
205
+ Scenario: Can backspace part of a soft tab
206
+ When I open a new edit tab
207
+ And tabs are soft, 4 spaces
208
+ And I replace the contents with "Ha "
209
+ And I move the cursor to 4
210
+ And I press the Backspace key in the edit tab
211
+ Then the contents should be "Ha<c>"
212
+
213
+ Scenario: Can delete a soft tab
214
+ When I open a new edit tab
215
+ And tabs are soft, 4 spaces
216
+ And I replace the contents with " "
217
+ And I move the cursor to 0
218
+ And I press the Delete key in the edit tab
219
+ Then the contents should be "<c>"
220
+
221
+ Scenario: Can delete part of a soft tab
222
+ When I open a new edit tab
223
+ And tabs are soft, 4 spaces
224
+ And I replace the contents with "Ha "
225
+ And I move the cursor to 2
226
+ And I press the Delete key in the edit tab
227
+ Then the contents should be "Ha<c>"
228
+
229
+ Scenario: Move left at the start of a line
230
+ When I open a new edit tab
231
+ And I replace the contents with "Hi\nHo"
232
+ And I move the cursor to 3
233
+ And I press the Left key in the edit tab
234
+ Then the contents should be "Hi<c>\nHo"
235
+
236
+ Scenario: Shouldn't die if the cursor is at the end of the document
237
+ When I open a new edit tab
238
+ And tabs are soft, 4 spaces
239
+ And I replace the contents with ""
240
+ And I move the cursor to 0
241
+ And I press the Delete key in the edit tab
242
+ Then the cursor should be at 0
243
+