Skip to content
This repository
  • 14 commits
  • 206 files changed
  • 0 comments
  • 1 contributor

Showing 206 changed files with 15,960 additions and 1,060 deletions. Show diff stats Hide diff stats

  1. +1 1  src/IronSharePoint.Framework/Administration/HiveSetup.cs
  2. +25 0 src/IronSharePoint.Framework/Console/Hooks/HookBase.cs
  3. +12 0 src/IronSharePoint.Framework/Console/Hooks/IHook.cs
  4. +21 0 src/IronSharePoint.Framework/Console/Hooks/RubyHook.cs
  5. +8 5 src/IronSharePoint.Framework/{IronConsole/IronConsoleResult.cs → Console/ScriptResult.cs}
  6. +7 4 src/IronSharePoint.Framework/Hives/{PhysicalHive.cs → DirectoryHive.cs}
  7. +21 4 src/IronSharePoint.Framework/Hives/{OrderedHiveList.cs → HiveComposite.cs}
  8. +64 37 src/IronSharePoint.Framework/Hives/SPDocumentHive.cs
  9. +66 0 src/IronSharePoint.Framework/Hives/SystemHive.cs
  10. +10 0 src/IronSharePoint.Framework/IHive.cs
  11. +153 0 src/IronSharePoint.Framework/IronConsole.cs
  12. +0 12 src/IronSharePoint.Framework/IronConsole/Hooks/IIronConsoleHook.cs
  13. +0 25 src/IronSharePoint.Framework/IronConsole/Hooks/IronConsoleHookBase.cs
  14. +0 38 src/IronSharePoint.Framework/IronConsole/Hooks/RubyConsoleHook.cs
  15. +0 92 src/IronSharePoint.Framework/IronConsole/IronConsole.cs
  16. +0 88 src/IronSharePoint.Framework/IronConsole/IronConsoleTask.cs
  17. +1 1  src/IronSharePoint.Framework/IronConstant.cs
  18. +0 80 src/IronSharePoint.Framework/IronExpressionBuilder.cs
  19. +5 32 src/IronSharePoint.Framework/IronHttpModule.cs
  20. +22 14 src/IronSharePoint.Framework/IronJob.cs
  21. +31 48 src/IronSharePoint.Framework/IronPlatformAdaptationLayer.cs
  22. +25 75 src/IronSharePoint.Framework/IronRuntime.cs
  23. +17 6 src/IronSharePoint.Framework/IronScriptHost.cs
  24. +14 9 src/IronSharePoint.Framework/IronSharePoint.Framework.csproj
  25. +6 4 src/IronSharePoint.Framework/IronWrapperControl.cs
  26. +11 15 src/IronSharePoint.Framework/IronWrapperUserControl.cs
  27. +28 0 src/IronSharePoint.Framework/RackHttpHandler.cs
  28. +6 0 src/IronSharePoint.Framework/Util/EnumerableExtensions.cs
  29. +45 0 src/IronSharePoint.Framework/Util/ScriptEngineExtensions.cs
  30. +9 0 src/IronSharePoint.Framework/Util/StringExtensions.cs
  31. +133 0 src/IronSharePoint.IronRuby/IronSharePoint.IronRuby.csproj
  32. BIN  src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/cache/hike-1.2.1.gem
  33. BIN  src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/cache/multi_json-1.7.0.gem
  34. BIN  src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/cache/rack-1.5.2.gem
  35. BIN  src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/cache/sprockets-2.9.0.gem
  36. +9 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/hike-1.2.1/lib/hike.rb
  37. +23 0 ...harePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/hike-1.2.1/lib/hike/extensions.rb
  38. +204 0 ...IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/hike-1.2.1/lib/hike/index.rb
  39. +59 0 ...int.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/hike-1.2.1/lib/hike/normalized_array.rb
  40. +27 0 ...IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/hike-1.2.1/lib/hike/paths.rb
  41. +179 0 ...IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/hike-1.2.1/lib/hike/trail.rb
  42. +143 0 ...arePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json.rb
  43. +43 0 ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapter.rb
  44. +19 0 ...uby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/gson.rb
  45. +22 0 ...EMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/jrjackson.rb
  46. +25 0 ...PLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/json_common.rb
  47. +11 0 ...TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/json_gem.rb
  48. +11 0 ...EMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/json_pure.rb
  49. +34 0 ...atures/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/nsjsonserialization.rb
  50. +28 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/oj.rb
  51. +22 0 .../TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/ok_json.rb
  52. +19 0 ...uby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/adapters/yajl.rb
  53. +43 0 ...LATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/convertible_hash_keys.rb
  54. +39 0 ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/options.rb
  55. +602 0 ...uby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/vendor/okjson.rb
  56. +3 0  ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/multi_json-1.7.0/lib/multi_json/version.rb
  57. +87 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack.rb
  58. +37 0 ...ronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/abstract/handler.rb
  59. +43 0 ...ronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/abstract/request.rb
  60. +58 0 ...harePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/basic.rb
  61. +129 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/digest/md5.rb
  62. +51 0 ...nt.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/digest/nonce.rb
  63. +53 0 ...t.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/digest/params.rb
  64. +41 0 ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/auth/digest/request.rb
  65. +56 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/backports/uri/common_18.rb
  66. +52 0 ...Ruby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/backports/uri/common_192.rb
  67. +29 0 ...Ruby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/backports/uri/common_193.rb
  68. +39 0 ...harePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/body_proxy.rb
  69. +149 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb
  70. +52 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/cascade.rb
  71. +58 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/chunked.rb
  72. +64 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/commonlogger.rb
  73. +67 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/conditionalget.rb
  74. +20 0 ...ronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/config.rb
  75. +33 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/content_length.rb
  76. +29 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/content_type.rb
  77. +116 0 ...nSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/deflater.rb
  78. +161 0 ...SharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/directory.rb
  79. +64 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/etag.rb
  80. +138 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/file.rb
  81. +107 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler.rb
  82. +61 0 ...arePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/cgi.rb
  83. +8 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/evented_mongrel.rb
  84. +98 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/fastcgi.rb
  85. +61 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/lsws.rb
  86. +100 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/mongrel.rb
  87. +67 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/scgi.rb
  88. +8 0 ...y/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/swiftiplied_mongrel.rb
  89. +27 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/thin.rb
  90. +81 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb
  91. +22 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/head.rb
  92. +699 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb
  93. +65 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/lobster.rb
  94. +26 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb
  95. +18 0 ...ronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/logger.rb
  96. +31 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb
  97. +677 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/mime.rb
  98. +190 0 src/IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/mock.rb
  99. +34 0 ...SharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/multipart.rb
  100. +93 0 ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/multipart/generator.rb
  101. +176 0 ...int.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/multipart/parser.rb
  102. +34 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/multipart/uploaded_file.rb
  103. +18 0 ...harePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/nulllogger.rb
  104. +61 0 ...SharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/recursive.rb
  105. +109 0 ...nSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/reloader.rb
  106. +380 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/request.rb
  107. +155 0 ...nSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/response.rb
  108. +104 0 ...int.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/rewindable_input.rb
  109. +27 0 ...onSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb
  110. +155 0 ...nSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/sendfile.rb
  111. +362 0 ...ronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb
  112. +398 0 ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb
  113. +178 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/cookie.rb
  114. +93 0 ...int.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/memcache.rb
  115. +79 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/pool.rb
  116. +378 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/showexceptions.rb
  117. +113 0 ...harePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/showstatus.rb
  118. +153 0 ...ronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/static.rb
  119. +76 0 ...ronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb
  120. +628 0 ...IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/utils.rb
  121. +599 0 ...rePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/utils/okjson.rb
  122. +151 0 ...t.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/rake/sprocketstask.rb
  123. +108 0 ...SharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets.rb
  124. +263 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/asset.rb
  125. +131 0 ...by/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/asset_attributes.rb
  126. +447 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/base.rb
  127. +80 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/bundled_asset.rb
  128. +32 0 ...by/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/cache/file_store.rb
  129. +96 0 ...nt.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/caching.rb
  130. +41 0 .../TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/charset_normalizer.rb
  131. +22 0 .../TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/closure_compressor.rb
  132. +73 0 ...ronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/compressing.rb
  133. +289 0 ...nt.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/context.rb
  134. +406 0 ...TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/directive_processor.rb
  135. +38 0 ...onRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/eco_template.rb
  136. +37 0 ...onRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/ejs_template.rb
  137. +74 0 ...nt.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/engines.rb
  138. +88 0 ...ronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/environment.rb
  139. +20 0 ...int.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/errors.rb
  140. +100 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/index.rb
  141. +29 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/jst_processor.rb
  142. +261 0 ...t.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/manifest.rb
  143. +49 0 ...Point.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/mime.rb
  144. +58 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/paths.rb
  145. +152 0 ...uby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/processed_asset.rb
  146. +206 0 ...IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/processing.rb
  147. +32 0 ....IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/processor.rb
  148. +28 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/safety_colons.rb
  149. +29 0 ...by/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/sass_cache_store.rb
  150. +27 0 ...uby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/sass_compressor.rb
  151. +70 0 ...Ruby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/sass_functions.rb
  152. +29 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/sass_importer.rb
  153. +60 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/sass_template.rb
  154. +13 0 ...nRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/scss_template.rb
  155. +247 0 ...int.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/server.rb
  156. +58 0 ...onRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/static_asset.rb
  157. +22 0 ...TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/uglifier_compressor.rb
  158. +69 0 ...oint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/utils.rb
  159. +3 0  ...nt.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/version.rb
  160. +27 0 ...Ruby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/gems/sprockets-2.9.0/lib/sprockets/yui_compressor.rb
  161. +27 0 ...IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/specifications/hike-1.2.1.gemspec
  162. +33 0 ...arePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/specifications/multi_json-1.7.0.gemspec
  163. +46 0 ...IronSharePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/specifications/rack-1.5.2.gemspec
  164. +79 0 ...harePoint.IronRuby/TEMPLATE/Features/IronSP_IronRuby/ruby/gems/1.9.1/specifications/sprockets-2.9.0.gemspec
  165. +5 4 src/IronSharePoint/EventReceivers/IronScriptCompilerReceiver.cs
  166. +15 17 src/IronSharePoint/Features/IronSP_WebApp/IronSP_WebApp.EventReceiver.cs
  167. +1 1  src/IronSharePoint/IronConsole/IronConsole.webpart
  168. +1 1  src/IronSharePoint/IronConsole/IronConsoleUserControl.ascx
  169. +1 6 src/IronSharePoint/IronConsole/IronConsoleUserControl.ascx.cs
  170. +1 1  src/IronSharePoint/IronConsole/IronConsoleUserControl.ascx.designer.cs
  171. +1 1  src/IronSharePoint/IronConsole/IronConsoleWebPart.cs
  172. +3 2 src/IronSharePoint/IronPart/IronPart.cs
  173. +49 1 src/IronSharePoint/IronSharePoint.csproj
  174. +10 5 src/IronSharePoint/Layouts/IronSP/IronConsole.coffee
  175. +269 249 src/IronSharePoint/Layouts/IronSP/IronConsole.js
  176. +20 23 src/IronSharePoint/Layouts/IronSP/IronConsoleService.ashx.cs
  177. +11 24 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint.rb
  178. +5 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/application.rb
  179. +1 25 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/console/utils.rb
  180. +16 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/ext/log4r.rb
  181. +8 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/ext/rack.rb
  182. +86 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/ext/rack/handlers/iis.rb
  183. +13 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/file_stat.rb
  184. +9 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/hives/directory_hive.rb
  185. +10 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/hives/hive_composite.rb
  186. +21 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/hives/sp_document_hive.rb
  187. +9 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/hives/system_hive.rb
  188. +1 1  src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/main_http_handler.rb
  189. +12 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/patches/digest/md5.rb
  190. +15 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/patches/hike/index.rb
  191. +4 0 src/IronSharePoint/TEMPLATE/Features/IronSP_Root/iron_sharepoint/patches/log4r/logger.rb
  192. +3 3 test/IronSharePoint.Framework.Test/Administration/HiveSetup_Fixture.cs
  193. +47 0 test/IronSharePoint.Framework.Test/Console/Hooks/RubyHook_Fixture.cs
  194. +26 0 test/IronSharePoint.Framework.Test/Console/ScriptResult_Fixture.cs
  195. +26 26 test/IronSharePoint.Framework.Test/Hive/{PhysicalHive_Fixture.cs → DirectoryHive_Fixture.cs}
  196. +25 25 test/IronSharePoint.Framework.Test/Hive/{OrderedHiveList_Fixture.cs → HiveComposite_Fixture.cs}
  197. +19 26 test/IronSharePoint.Framework.Test/Hive/SPDocumentHive_Fixture.cs
  198. +83 0 test/IronSharePoint.Framework.Test/IOCapture_Fixture.cs
  199. +58 0 test/IronSharePoint.Framework.Test/IronConsole_Fixture.cs
  200. +51 0 test/IronSharePoint.Framework.Test/IronPlatformAdaptionLayer_Fixture.cs
  201. +65 26 test/IronSharePoint.Framework.Test/IronScriptHost_Fixture.cs
  202. +45 2 test/IronSharePoint.Framework.Test/IronSharePoint.Framework.Test.csproj
  203. +22 0 test/IronSharePoint.Framework.Test/TestHelper.cs
  204. +9 1 test/IronSharePoint.Framework.Test/Util/EnumerableExtensions_Fixture.cs
  205. +41 0 test/IronSharePoint.Framework.Test/Util/ScriptEngineExtensions_Fixture.cs
  206. +12 0 test/IronSharePoint.Framework.Test/Util/StringExtensions_Fixture.cs
2  src/IronSharePoint.Framework/Administration/HiveSetup.cs
@@ -99,7 +99,7 @@ public static HiveSetup IronSPRoot
99 99 DisplayName = "IronSP Root",
100 100 Description = "Contains the Ruby part of the IronSP Framework",
101 101 HiveArguments = new object[] {IronConstant.IronSPRootDirectory},
102   - HiveType = typeof (PhysicalHive)
  102 + HiveType = typeof (DirectoryHive)
103 103 };
104 104 }
105 105 }
25 src/IronSharePoint.Framework/Console/Hooks/HookBase.cs
... ... @@ -0,0 +1,25 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Linq;
  4 +using Microsoft.Scripting.Hosting;
  5 +
  6 +namespace IronSharePoint.Console.Hooks
  7 +{
  8 + abstract class HookBase : IHook
  9 + {
  10 + #region IHook Members
  11 +
  12 + public bool SupportsLanguage(string languageName)
  13 + {
  14 + return SupportedLanguages().Contains(languageName, StringComparer.InvariantCultureIgnoreCase);
  15 + }
  16 +
  17 + public virtual void BeforeExecute(ScriptEngine scriptEngine, ScriptScope scope, ScriptResult result) {}
  18 +
  19 + public virtual void AfterExecute(ScriptEngine scriptEngine, ScriptScope scope, ScriptResult result) {}
  20 +
  21 + #endregion
  22 +
  23 + protected abstract IEnumerable<string> SupportedLanguages();
  24 + }
  25 +}
12 src/IronSharePoint.Framework/Console/Hooks/IHook.cs
... ... @@ -0,0 +1,12 @@
  1 +using Microsoft.Scripting.Hosting;
  2 +
  3 +namespace IronSharePoint.Console.Hooks
  4 +{
  5 + interface IHook
  6 + {
  7 + bool SupportsLanguage(string languageName);
  8 +
  9 + void BeforeExecute(ScriptEngine scriptEngine, ScriptScope scope, ScriptResult result);
  10 + void AfterExecute(ScriptEngine scriptEngine, ScriptScope scope, ScriptResult result);
  11 + }
  12 +}
21 src/IronSharePoint.Framework/Console/Hooks/RubyHook.cs
... ... @@ -0,0 +1,21 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using Microsoft.Scripting.Hosting;
  4 +
  5 +namespace IronSharePoint.Console.Hooks
  6 +{
  7 + class RubyHook : HookBase
  8 + {
  9 + public override void AfterExecute(ScriptEngine scriptEngine, ScriptScope scope, ScriptResult result)
  10 + {
  11 + base.AfterExecute(scriptEngine, scope, result);
  12 + var inspected = scriptEngine.Execute("_.inspect", scope);
  13 + result.ReturnString = Convert.ToString(inspected ?? "nil");
  14 + }
  15 +
  16 + protected override IEnumerable<string> SupportedLanguages()
  17 + {
  18 + return new[] {IronConstant.RubyLanguageName};
  19 + }
  20 + }
  21 +}
13 ...ePoint.Framework/IronConsole/IronConsoleResult.cs → src/IronSharePoint.Framework/Console/ScriptResult.cs
... ... @@ -1,14 +1,17 @@
1 1 using System;
2 2 using Newtonsoft.Json;
3 3
4   -namespace IronSharePoint.IronConsole
  4 +namespace IronSharePoint.Console
5 5 {
6   - public class IronConsoleResult
  6 + public class ScriptResult
7 7 {
8 8 public string Output { get; set; }
9   - public string Result { get; set; }
  9 + [JsonIgnore]
  10 + public dynamic ReturnValue { get; set; }
  11 + public string ReturnString { get; set; }
10 12 public string Error { get; set; }
11 13 public string StackTrace { get; set; }
  14 + public long ExecutionTime { get; set; }
12 15
13 16 public bool HasError
14 17 {
@@ -25,9 +28,9 @@ public void LoadJson(string json)
25 28 JsonConvert.PopulateObject(json, this);
26 29 }
27 30
28   - public static IronConsoleResult FromJson(string json)
  31 + public static ScriptResult FromJson(string json)
29 32 {
30   - return JsonConvert.DeserializeObject<IronConsoleResult>(json);
  33 + return JsonConvert.DeserializeObject<ScriptResult>(json);
31 34 }
32 35 }
33 36 }
11 src/IronSharePoint.Framework/Hives/PhysicalHive.cs → src/IronSharePoint.Framework/Hives/DirectoryHive.cs
@@ -7,9 +7,9 @@
7 7 namespace IronSharePoint.Hives
8 8 {
9 9 /// <summary>
10   - /// Hive implementation for folders on a physical hard disk
  10 + /// Hive implementation which acts on a directory on a hard disk
11 11 /// </summary>
12   - public class PhysicalHive : IHive
  12 + public class DirectoryHive : IHive
13 13 {
14 14 private string _root;
15 15
@@ -19,7 +19,7 @@ public class PhysicalHive : IHive
19 19 /// Creates a new Hive for the folder <paramref name="root"/>.
20 20 /// </summary>
21 21 /// <param name="root"></param>
22   - public PhysicalHive(string root)
  22 + public DirectoryHive(string root)
23 23 {
24 24 Contract.Requires<ArgumentNullException>(!String.IsNullOrWhiteSpace(root), "Root directory cannot be null or blank");
25 25 Contract.Requires<ArgumentException>(Directory.Exists(root), "Root directory can not be found");
@@ -38,7 +38,6 @@ public bool DirectoryExists(string path)
38 38 {
39 39 var fullPath = GetFullPath(path);
40 40
41   - Console.WriteLine(fullPath);
42 41 return Directory.Exists(fullPath);
43 42 }
44 43
@@ -92,6 +91,10 @@ public IEnumerable<string> GetDirectories(string path, string searchPattern, boo
92 91 return absolutePaths ? directories : directories.Select(GetPartialPath);
93 92 }
94 93
  94 + public string Name { get; set; }
  95 +
  96 + public string Description { get { return string.Format("{0}: {1}", GetType().Name, Root); } }
  97 +
95 98 private string GetPartialPath(string path)
96 99 {
97 100 Contract.Requires<ArgumentNullException>(path != null);
25 ...IronSharePoint.Framework/Hives/OrderedHiveList.cs → src/IronSharePoint.Framework/Hives/HiveComposite.cs
@@ -4,17 +4,22 @@
4 4 using System.Diagnostics.Contracts;
5 5 using System.IO;
6 6 using System.Linq;
  7 +using IronSharePoint.Util;
7 8
8 9 namespace IronSharePoint.Hives
9 10 {
10 11 /// <summary>
11   - /// Hive implementation which operates an ordered list of hives. First come, first serve.
  12 + /// Hive implementation which delegates its operations to an ordered list of leaf-hives.
  13 + /// Operations that return a single object, e.g. OpenInputFileStream(), the composite delegates the call
  14 + /// to the first leaf-hive that is able to handle the operation (in that case, the file exists in the hive).
  15 + /// For operations that return a collection of objects, the result of all leaf-hives are combined.
  16 + /// For operations that return a bool, the result of all leaf-hives are combined with an OR.
12 17 /// </summary>
13   - public class OrderedHiveList : IHive, IEnumerable<IHive>
  18 + public class HiveComposite : IHive, IEnumerable<IHive>
14 19 {
15 20 private readonly List<IHive> _hives;
16 21
17   - public OrderedHiveList(params IHive[] hives)
  22 + public HiveComposite(params IHive[] hives)
18 23 {
19 24 _hives = new List<IHive>(hives.Where(x => x != null));
20 25 }
@@ -95,7 +100,19 @@ public IEnumerable<string> GetDirectories(string path, string searchPattern, boo
95 100 return _hives.SelectMany(x => x.GetDirectories(path, searchPattern, absolutePaths)).Distinct();
96 101 }
97 102
98   - IHive FindHandler(string path)
  103 + public string Name { get; set; }
  104 +
  105 + public string Description
  106 + {
  107 + get
  108 + {
  109 + return string.Format("{0}({1}): [{2}]", GetType().Name,
  110 + this.Count(),
  111 + this.Any() ? this.Select(x => x.Description).StringJoin() : "none");
  112 + }
  113 + }
  114 +
  115 + public IHive FindHandler(string path)
99 116 {
100 117 Contract.Requires<ArgumentException>(!String.IsNullOrWhiteSpace(path), "path cannot be null or blank");
101 118
101 src/IronSharePoint.Framework/Hives/SPDocumentHive.cs
@@ -18,27 +18,32 @@ public class SPDocumentHive : IHive
18 18 {
19 19 private readonly Guid _siteId;
20 20 private readonly string _hiveLibraryPath;
21   - private string _webUrl;
22   - private string _hiveLibraryUrl;
  21 + private readonly string _hiveLibraryUrl;
23 22
24   - private ThreadLocal<SPSite> _site;
  23 + private readonly ThreadLocal<SPSite> _site;
  24 + private readonly ThreadLocal<SPDocumentLibrary> _documentLibrary;
25 25
26 26 public SPSite Site
27 27 {
28 28 get { return _site.Value; }
29 29 }
30 30
31   - private string[] _cachedFiles;
32   - private string[] _cachedDirs;
  31 + public SPDocumentLibrary DocumentLibrary
  32 + {
  33 + get { return _documentLibrary.Value; }
  34 + }
  35 +
  36 + private Dictionary<string, int> _allFiles;
  37 + private string[] _allDirs;
33 38
34   - public IEnumerable<string> CachedFiles
  39 + public IEnumerable<string> Files
35 40 {
36   - get { return _cachedFiles.AsEnumerable(); }
  41 + get { return _allFiles.Keys.AsEnumerable(); }
37 42 }
38 43
39   - public IEnumerable<string> CachedDirs
  44 + public IEnumerable<string> Directories
40 45 {
41   - get { return _cachedDirs.AsEnumerable(); }
  46 + get { return _allDirs.AsEnumerable(); }
42 47 }
43 48
44 49 public SPDocumentHive(Guid siteId)
@@ -52,6 +57,9 @@ public SPDocumentHive(Guid siteId, string hiveLibraryPath)
52 57 _hiveLibraryPath = hiveLibraryPath;
53 58
54 59 _site = new ThreadLocal<SPSite>(() => new SPSite(_siteId, SPUserToken.SystemAccount), true);
  60 + _documentLibrary = new ThreadLocal<SPDocumentLibrary>(() => Site.RootWeb.GetFolder(_hiveLibraryPath).DocumentLibrary);
  61 + _hiveLibraryUrl = CombinePath(Site.RootWeb.Url, _hiveLibraryPath);
  62 +
55 63 Reset();
56 64 }
57 65
@@ -59,23 +67,40 @@ public bool FileExists(string path)
59 67 {
60 68 path = IsAbsolutePath(path) ? GetPartialPath(path) : path;
61 69
62   - return _cachedFiles.Contains(path);
  70 + return Files.Contains(path);
63 71 }
64 72
65 73 public bool DirectoryExists(string path)
66 74 {
67 75 path = IsAbsolutePath(path) ? GetPartialPath(path) : path;
68 76
69   - return _cachedDirs.Any(x => x.StartsWith(path));
  77 + return Directories.Any(x => x.StartsWith(path));
70 78 }
71 79
72 80 public Stream OpenInputFileStream(string path)
73 81 {
74   - string filePath = GetFullPath(path);
75   - var spFile = Site.RootWeb.GetFile(filePath);
76   - if (!spFile.Exists) throw new FileNotFoundException("", filePath);
  82 + var item = GetSPListItem(path);
  83 + if (item == null) throw new FileNotFoundException("", path);
77 84
78   - return spFile.OpenBinaryStream();
  85 + return item.File.OpenBinaryStream();
  86 + }
  87 +
  88 + public SPListItem GetSPListItem(string path)
  89 + {
  90 + path = GetPartialPath(path);
  91 + int id;
  92 + if (_allFiles.TryGetValue(path, out id))
  93 + {
  94 + try
  95 + {
  96 + return DocumentLibrary.GetItemById(id);
  97 + }
  98 + catch
  99 + {
  100 + return null;
  101 + }
  102 + }
  103 + return null;
79 104 }
80 105
81 106 public Stream OpenOutputFileStream(string path)
@@ -115,7 +140,7 @@ public IEnumerable<string> GetFiles(string path, string searchPattern, bool abso
115 140 path = "^" + (path.Replace(".", "") + "/").TrimStart('/');
116 141 var regexPattern = string.Format("{0}{1}", path, searchPattern);
117 142 var regex = new Regex(regexPattern);
118   - var files = CachedFiles.Select(file =>
  143 + var files = Files.Select(file =>
119 144 {
120 145 var match = regex.Match(file);
121 146 return match.Success ? file : null;
@@ -128,7 +153,7 @@ public IEnumerable<string> GetDirectories(string path, string searchPattern, boo
128 153 path = (path.Replace(".", "") + "/").TrimStart('/');
129 154 var regexPattern = searchPattern.Replace("*", string.Format("^({0}[^/]+)(/.*)?", path)) + "$";
130 155 var regex = new Regex(regexPattern);
131   - var dirs = CachedDirs.Select(dir =>
  156 + var dirs = Directories.Select(dir =>
132 157 {
133 158 var match = regex.Match(dir);
134 159 return match.Success ? match.Groups[1].Value : null;
@@ -136,43 +161,43 @@ public IEnumerable<string> GetDirectories(string path, string searchPattern, boo
136 161 return absolutePaths ? dirs.Select(GetFullPath) : dirs;
137 162 }
138 163
  164 + public string Name { get; set; }
  165 + public string Description { get { return string.Format("{0}: {1}", GetType().Name, _hiveLibraryUrl); } }
  166 +
139 167 public void Reset()
140 168 {
141   - Dispose();
142   -
143   - var allFilesQuery = new SPQuery();
144   - allFilesQuery.Query = "<Where></Where>";
145   - allFilesQuery.ViewFields = "<FieldRef Name='FileRef'/><FieldRef Name='FileLeafRef'/>";
146   - allFilesQuery.ViewAttributes = "Scope='Recursive'";
147   - allFilesQuery.IncludeMandatoryColumns = false;
148   -
149   - var allFiles = new List<string>();
150   -
151   - var folder = Site.RootWeb.GetFolder(_hiveLibraryPath);
152   - var lib = folder.DocumentLibrary;
153   - _webUrl = Site.RootWeb.Url;
154   - _hiveLibraryUrl = CombinePath(_webUrl, _hiveLibraryPath);
155   -
156   - var allItems = lib.GetItems(allFilesQuery);
  169 + var allFilesQuery = new SPQuery
  170 + {
  171 + Query = "<Where></Where>",
  172 + ViewFields = "<FieldRef Name='FileRef'/>" +
  173 + "<FieldRef Name='ID'/>" +
  174 + "<FieldRef Name='File_x0020_Size'/>" +
  175 + "<FieldRef Name='FileLeafRef'/>",
  176 + ViewAttributes = "Scope='Recursive'",
  177 + IncludeMandatoryColumns = false
  178 + };
  179 +
  180 + _allFiles = new Dictionary<string, int>();
  181 + var allItems = DocumentLibrary.GetItems(allFilesQuery);
157 182 foreach (SPListItem item in allItems)
158 183 {
159 184 var fileRef = item["FileRef"].ToString();
160 185 var siteRelative = fileRef.ReplaceFirst(Site.RootWeb.ServerRelativeUrl, string.Empty).TrimStart('/');
161 186 var hiveRelative = siteRelative.ReplaceFirst(_hiveLibraryPath, string.Empty).TrimStart('/');
  187 + var id = Convert.ToInt32(item["ID"]);
162 188
163   - allFiles.Add(hiveRelative);
  189 + _allFiles.Add(hiveRelative, id);
164 190 }
165 191
166   - _cachedFiles = allFiles.ToArray();
167 192 // ReSharper disable PossibleNullReferenceException
168   - _cachedDirs = _cachedFiles.Select(x => Path.GetDirectoryName(x).Replace('\\', '/'))
  193 + _allDirs = _allFiles.Keys.Select(x => Path.GetDirectoryName(x).Replace('\\', '/'))
169 194 .Distinct()
170 195 .Where(x => !String.IsNullOrWhiteSpace(x))
171 196 .ToArray();
172 197 // ReSharper restore PossibleNullReferenceException
173 198 }
174 199
175   - private string GetPartialPath(string path)
  200 + public string GetPartialPath(string path)
176 201 {
177 202 Contract.Requires<ArgumentNullException>(path != null);
178 203
@@ -184,7 +209,9 @@ public void Dispose()
184 209 foreach (var spSite in _site.Values)
185 210 {
186 211 spSite.Dispose();
  212 + _site.Dispose();
187 213 }
  214 + _documentLibrary.Dispose();
188 215 }
189 216 }
190 217 }
66 src/IronSharePoint.Framework/Hives/SystemHive.cs
... ... @@ -0,0 +1,66 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.IO;
  4 +using System.Linq;
  5 +using System.Text;
  6 +using System.Threading.Tasks;
  7 +
  8 +namespace IronSharePoint.Hives
  9 +{
  10 + public class SystemHive : IHive
  11 + {
  12 + public void Dispose()
  13 + {
  14 + // nothing to do
  15 + }
  16 +
  17 + public bool FileExists(string path)
  18 + {
  19 + return File.Exists(path);
  20 + }
  21 +
  22 + public bool DirectoryExists(string path)
  23 + {
  24 + return Directory.Exists(path);
  25 + }
  26 +
  27 + public Stream OpenInputFileStream(string path)
  28 + {
  29 + return File.OpenRead(path);
  30 + }
  31 +
  32 + public Stream OpenOutputFileStream(string path)
  33 + {
  34 + return File.OpenWrite(path);
  35 + }
  36 +
  37 + public string GetFullPath(string path)
  38 + {
  39 + return Path.GetFullPath(path);
  40 + }
  41 +
  42 + public bool IsAbsolutePath(string path)
  43 + {
  44 + return Path.IsPathRooted(path);
  45 + }
  46 +
  47 + public string CombinePath(string path1, string path2)
  48 + {
  49 + return Path.Combine(path1, path2);
  50 + }
  51 +
  52 + public IEnumerable<string> GetFiles(string path, string searchPattern, bool absolutePaths = false)
  53 + {
  54 + return new string[0];
  55 + }
  56 +
  57 + public IEnumerable<string> GetDirectories(string path, string searchPattern, bool absolutePaths = false)
  58 + {
  59 + return new string[0];
  60 + }
  61 +
  62 + public string Name { get; set; }
  63 +
  64 + public string Description { get { return string.Format("{0}: {1}", GetType().Name, Environment.MachineName); } }
  65 + }
  66 +}
10 src/IronSharePoint.Framework/IHive.cs
@@ -78,5 +78,15 @@ public interface IHive : IDisposable
78 78 /// <param name="absolutePaths"></param>
79 79 /// <returns></returns>
80 80 IEnumerable<string> GetDirectories(string path, string searchPattern, bool absolutePaths = false);
  81 +
  82 + /// <summary>
  83 + /// Name of the hive
  84 + /// </summary>
  85 + string Name { get; set; }
  86 +
  87 + /// <summary>
  88 + /// Description for the hive
  89 + /// </summary>
  90 + string Description { get; }
81 91 }
82 92 }
153 src/IronSharePoint.Framework/IronConsole.cs
... ... @@ -0,0 +1,153 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Diagnostics;
  4 +using System.IO;
  5 +using System.Linq;
  6 +using System.Text;
  7 +using System.Threading;
  8 +using System.Threading.Tasks;
  9 +using IronSharePoint.Console;
  10 +using IronSharePoint.Console.Hooks;
  11 +using IronSharePoint.Util;
  12 +using Microsoft.Scripting.Hosting;
  13 +
  14 +namespace IronSharePoint
  15 +{
  16 + public class IronConsole
  17 + {
  18 + private readonly ScriptRuntime _runtime;
  19 + private readonly IHook[] _hooks;
  20 +
  21 + internal IronConsole(ScriptRuntime scriptRuntime)
  22 + {
  23 + _runtime = scriptRuntime;
  24 + _hooks = new IHook[]
  25 + {
  26 + new RubyHook()
  27 + };
  28 + }
  29 +
  30 + public ScriptRuntime Runtime
  31 + {
  32 + get { return _runtime; }
  33 + }
  34 +
  35 + public bool IsDisposed { get; private set; }
  36 +
  37 + public async Task<ScriptResult> Execute(string script, string languageName)
  38 + {
  39 + return await Task.Run(() => RunScript(script, languageName));
  40 + }
  41 +
  42 + private ScriptResult RunScript(string script, string languageName)
  43 + {
  44 + var result = new ScriptResult();
  45 + var sw = new Stopwatch();
  46 + sw.Start();
  47 + try
  48 + {
  49 + var engine = Runtime.GetEngine(languageName);
  50 + var scope = engine.CreateScope();
  51 +
  52 + ExecuteBeforeHooks(engine, result, scope);
  53 +
  54 + using (var io = new IOCapture(Runtime))
  55 + {
  56 + script = string.Format("_ = ({0})", script);
  57 + result.ReturnValue = engine.Execute(script, scope);
  58 + io.Read();
  59 + result.Output = io.Out;
  60 + result.Error = io.Error;
  61 + }
  62 +
  63 + ExecuteAfterHooks(engine, result, scope);
  64 +
  65 +
  66 + }
  67 + catch (Exception ex)
  68 + {
  69 + result.Error = ex.Message;
  70 + result.StackTrace = ex.StackTrace;
  71 + }
  72 + sw.Stop();
  73 + result.ExecutionTime = sw.ElapsedMilliseconds;
  74 +
  75 + return result;
  76 + }
  77 +
  78 + private void ExecuteBeforeHooks(ScriptEngine engine, ScriptResult result, ScriptScope scope)
  79 + {
  80 + var languageName = engine.Setup.DisplayName;
  81 +
  82 + foreach (var hook in _hooks.Where(x => x.SupportsLanguage(languageName)))
  83 + {
  84 + hook.BeforeExecute(engine, scope, result);
  85 + }
  86 + }
  87 +
  88 + private void ExecuteAfterHooks(ScriptEngine engine, ScriptResult result, ScriptScope scope)
  89 + {
  90 + var languageName = engine.Setup.DisplayName;
  91 +
  92 + foreach (var hook in _hooks.Where(x => x.SupportsLanguage(languageName)))
  93 + {
  94 + hook.AfterExecute(engine, scope, result);
  95 + }
  96 + }
  97 + }
  98 +
  99 + internal class IOCapture : IDisposable
  100 + {
  101 + public IOCapture(ScriptRuntime runtime)
  102 + {
  103 + _runtime = runtime;
  104 + _outBackup = runtime.IO.OutputStream;
  105 + _outEncoding = runtime.IO.OutputEncoding;
  106 + _errBackup = runtime.IO.ErrorStream;
  107 + _errEncoding = runtime.IO.ErrorEncoding;
  108 +
  109 + _out = new MemoryStream();
  110 + _err = new MemoryStream();
  111 +
  112 + _runtime.IO.SetOutput(_out, _outEncoding);
  113 + _runtime.IO.SetErrorOutput(_err, _errEncoding);
  114 + }
  115 +
  116 + private readonly Encoding _errEncoding;
  117 + private readonly Stream _errBackup;
  118 + private readonly Encoding _outEncoding;
  119 + private readonly Stream _outBackup;
  120 +
  121 + private readonly MemoryStream _out;
  122 + private readonly MemoryStream _err;
  123 + private readonly ScriptRuntime _runtime;
  124 +
  125 + public void Read()
  126 + {
  127 + _runtime.IO.OutputWriter.Flush();
  128 + _runtime.IO.ErrorWriter.Flush();
  129 + _out.Position = 0;
  130 + _err.Position = 0;
  131 + using (var sr = new StreamReader(_out))
  132 + {
  133 + Out = sr.ReadToEnd();
  134 + }
  135 + using (var sr = new StreamReader(_err))
  136 + {
  137 + Error = sr.ReadToEnd();
  138 + }
  139 + }
  140 +
  141 + public string Out { get; private set; }
  142 + public string Error { get; private set; }
  143 +
  144 + public void Dispose()
  145 + {
  146 + _runtime.IO.SetOutput(_outBackup, _outEncoding);
  147 + _runtime.IO.SetErrorOutput(_errBackup, _errEncoding);
  148 +
  149 + _out.Dispose();
  150 + _err.Dispose();
  151 + }
  152 + }
  153 +}
12 src/IronSharePoint.Framework/IronConsole/Hooks/IIronConsoleHook.cs
... ... @@ -1,12 +0,0 @@
1   -using Microsoft.Scripting.Hosting;
2   -
3   -namespace IronSharePoint.IronConsole.Hooks
4   -{
5   - interface IIronConsoleHook
6   - {
7   - bool SupportsExtension(string extension);
8   -
9   - void BeforeExecute(ScriptEngine scriptEngine, IronConsoleResult result);
10   - void AfterExecute(ScriptEngine scriptEngine, IronConsoleResult result);
11   - }
12   -}
25 src/IronSharePoint.Framework/IronConsole/Hooks/IronConsoleHookBase.cs
... ... @@ -1,25 +0,0 @@
1   -using System;
2   -using System.Collections.Generic;
3   -using System.Linq;
4   -using Microsoft.Scripting.Hosting;
5   -
6   -namespace IronSharePoint.IronConsole.Hooks
7   -{
8   - abstract class IronConsoleHookBase : IIronConsoleHook
9   - {
10   - #region IIronConsoleHook Members
11   -
12   - public bool SupportsExtension(string extension)
13   - {
14   - return SupportedExtensions().Contains(extension, StringComparer.InvariantCultureIgnoreCase);
15   - }
16   -
17   - public virtual void BeforeExecute(ScriptEngine scriptEngine, IronConsoleResult result) {}
18   -
19   - public virtual void AfterExecute(ScriptEngine scriptEngine, IronConsoleResult result) {}
20   -
21   - #endregion
22   -
23   - protected abstract IEnumerable<string> SupportedExtensions();
24   - }
25   -}
38 src/IronSharePoint.Framework/IronConsole/Hooks/RubyConsoleHook.cs
... ... @@ -1,38 +0,0 @@
1   -using System;
2   -using System.Collections.Generic;
3   -using Microsoft.Scripting.Hosting;
4   -
5   -namespace IronSharePoint.IronConsole.Hooks
6   -{
7   - class RubyConsoleHook : IronConsoleHookBase
8   - {
9   - public override void BeforeExecute(ScriptEngine scriptEngine, IronConsoleResult result)
10   - {
11   - base.BeforeExecute(scriptEngine, result);
12   - /*
13   - scriptEngine.Execute(
14   - @"
15   - unless respond_to? :out
16   - begin
17   - include IronSharePoint::Console::Utils
18   - rescue
19   -#raise 'Could not load console utils'
20   - end
21   - end");
22   - */
23   - }
24   -
25   - public override void AfterExecute(ScriptEngine scriptEngine, IronConsoleResult result)
26   - {
27   - base.AfterExecute(scriptEngine, result);
28   - var consoleOut = scriptEngine.Execute(String.Format("out '{0}' if respond_to? :out", Environment.NewLine));
29   - result.Output = Convert.ToString(consoleOut);
30   - result.Result = result.Result ?? "nil";
31   - }
32   -
33   - protected override IEnumerable<string> SupportedExtensions()
34   - {
35   - return new[] {".rb", ".ruby"};
36   - }
37   - }
38   -}
92 src/IronSharePoint.Framework/IronConsole/IronConsole.cs
... ... @@ -1,92 +0,0 @@
1   -using System;
2   -using System.Collections.Generic;
3   -using System.Threading;
4   -using IronSharePoint.Util;
5   -
6   -namespace IronSharePoint.IronConsole
7   -{
8   - public class IronConsole : IDisposable
9   - {
10   - // HiveId -> IIronConsole
11   - static readonly IDictionary<Guid, IronConsole> _hiveConsoles = new Dictionary<Guid, IronConsole>();
12   -
13   - readonly IBlockingQueue<IronConsoleTask> _queue;
14   - readonly Thread _queueWorker;
15   - readonly IronRuntime _runtime;
16   -
17   - static IronConsole()
18   - {
19   - _hiveConsoles = new Dictionary<Guid, IronConsole>();
20   - }
21   -
22   - protected IronConsole(IronRuntime runtime, params string[] supportedExtensions)
23   - {
24   - _runtime = runtime;
25   - _queue = new BlockingQueue<IronConsoleTask>();
26   - _queueWorker = new Thread(ProcessTaskQueue)
27   - {
28   - Name = string.Format("IronConsole Worker for {0}",
29   - string.Join(", ", supportedExtensions)),
30   - IsBackground = true
31   - };
32   - _queueWorker.Start();
33   - }
34   -
35   - public IronRuntime Runtime
36   - {
37   - get { return _runtime; }
38   - }
39   -
40   - public bool IsDisposed { get; private set; }
41   -
42   - #region IDisposable Members
43   -
44   - public void Dispose()
45   - {
46   - if (!IsDisposed)
47   - {
48   - IsDisposed = true;
49   - _queue.Stop();
50   - _queueWorker.Join(5000);
51   - }
52   - }
53   -
54   - #endregion
55   -
56   - public static IronConsole GetConsoleForRuntime(IronRuntime runtime)
57   - {
58   - var hiveId = runtime.Id;
59   - IronConsole console;
60   - if (!_hiveConsoles.TryGetValue(hiveId, out console) || console.IsDisposed)
61   - {
62   - console = new IronConsole(runtime);
63   - _hiveConsoles[hiveId] = console;
64   - }
65   -
66   - return console;
67   - }
68   -
69   - void ProcessTaskQueue()
70   - {
71   - IronConsoleTask task;
72   - while ((task = _queue.Dequeue()) != null)
73   - {
74   - task.Execute();
75   - }
76   - }
77   -
78   - public IronConsoleResult Execute(string expression, string extension)
79   - {
80   - return Execute(expression, extension, true);
81   - }
82   -
83   - public IronConsoleResult Execute(string expression, string extension, bool wait)
84   - {
85   - var task = new IronConsoleTask(Runtime, expression, extension);
86   - _queue.Enqueue(task);
87   - if (wait) task.WaitFor(5000);
88   -
89   - return task.IronConsoleResult;
90   - }
91   - }
92   -}
88 src/IronSharePoint.Framework/IronConsole/IronConsoleTask.cs
... ... @@ -1,88 +0,0 @@
1   -using System;
2   -using System.Threading;
3   -using IronSharePoint.IronConsole.Hooks;
4   -using Microsoft.Scripting.Hosting;
5   -
6   -namespace IronSharePoint.IronConsole
7   -{
8   - class IronConsoleTask
9   - {
10   - static readonly IIronConsoleHook[] _hooks = new IIronConsoleHook[]
11   - {
12   - new RubyConsoleHook()
13   - };
14   -
15   - readonly string _expression;
16   - readonly string _extension;
17   - readonly IronRuntime _runtime;
18   - readonly AutoResetEvent _waitHandle;
19   - private IronEngine _engine;
20   -
21   - public IronConsoleTask(IronRuntime runtime, string expression, string extension)
22   - {
23   - _runtime = runtime;
24   - _expression = expression;
25   - _extension = extension;
26   - _waitHandle = new AutoResetEvent(false);
27   - }
28   -
29   - public IronConsoleResult IronConsoleResult { get; private set; }
30   -
31   - public void Execute()
32   - {
33   - IronConsoleResult = new IronConsoleResult();
34   - try
35   - {
36   - _engine = _runtime.GetEngineByExtension(_extension);
37   - var scriptEngine = _engine.ScriptEngine;
38   -
39   - ExecuteBeforeHooks(scriptEngine, IronConsoleResult);
40   -
41   - var expressionResult = scriptEngine.Execute(_expression, _runtime.ScriptRuntime.Globals);
42   - IronConsoleResult.Result = expressionResult != null ? expressionResult.ToString() : null;
43   -
44   - ExecuteAfterHooks(scriptEngine, IronConsoleResult);
45   - }
46   - catch (Exception ex)
47   - {
48   - IronConsoleResult.Error = ex.Message;
49   - IronConsoleResult.StackTrace = ex.StackTrace;
50   -
51   - if (_engine != null)
52   - {
53   - try
54   - {
55   - var eo = _engine.ScriptEngine.GetService<ExceptionOperations>();
56   - IronConsoleResult.StackTrace = eo.FormatException(ex);
57   - }
58   - catch { }
59   - }
60   - }
61   - finally
62   - {
63   - _waitHandle.Set();
64   - }
65   - }
66   -
67   - void ExecuteBeforeHooks(ScriptEngine scriptEngine, IronConsoleResult ironConsoleResult)
68   - {
69   - foreach (var hook in _hooks)
70   - {
71   - hook.BeforeExecute(scriptEngine, ironConsoleResult);
72   - }
73   - }
74   -
75   - void ExecuteAfterHooks(ScriptEngine scriptEngine, IronConsoleResult ironConsoleResult)
76   - {
77   - foreach (var hook in _hooks)
78   - {
79   - hook.AfterExecute(scriptEngine, ironConsoleResult);
80   - }
81   - }
82   -
83   - public void WaitFor(int timeout)
84   - {
85   - _waitHandle.WaitOne(5000);
86   - }
87   - }
88   -}
2  src/IronSharePoint.Framework/IronConstant.cs
@@ -18,7 +18,7 @@ public static class IronConstant
18 18
19 19 public const string IronPrefix = "IronSP_";
20 20
21   - public const string IronRubyLanguageName = "IronRuby";
  21 + public const string RubyLanguageName = "ruby";
22 22 public const string IronRuntimeKey = IronPrefix + "Runtime";
23 23
24 24 public static string IronSPRootDirectory =
80 src/IronSharePoint.Framework/IronExpressionBuilder.cs
... ... @@ -1,80 +0,0 @@
1   -using System;
2   -using System.Collections.Generic;
3   -using System.Linq;
4   -using System.Text;
5   -using System.Web.Compilation;
6   -using System.CodeDom;
7   -using System.Web;
8   -using System.ComponentModel;
9   -using Microsoft.SharePoint;
10   -using System.IO;
11   -using System.Text.RegularExpressions;
12   -using Microsoft.Scripting.Hosting;
13   -
14   -namespace IronSharePoint
15   -{
16   - public class IronExpressionBuilder: ExpressionBuilder
17   - {
18   - private IronEngine engine;
19   -
20   - public override System.CodeDom.CodeExpression GetCodeExpression(System.Web.UI.BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
21   - {
22   -
23   - throw new NotSupportedException();
24   - }
25   -
26   - public override bool SupportsEvaluate
27   - {
28   - get
29   - {
30   - return true;
31   - }
32   - }
33   -
34   - public override object EvaluateExpression(object target, System.Web.UI.BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
35   - {
36   - string value = String.Empty;
37   - string scriptName = entry.Expression;
38   -
39   - try
40   - {
41   - string functionName = null;
42   -
43   - if (scriptName.Contains("@"))
44   - {
45   - var tmp = scriptName.Split('@');
46   - functionName = tmp[0].Trim();
47   - scriptName = tmp[1].Trim();
48   - }
49   - else
50   - {
51   - throw new ArgumentException("Invalid expression! Use <%$Iron:My.sayHello@my/functions.rb");
52   - }
53   -
54   - engine = IronRuntime.GetDefaultIronRuntime(SPContext.Current.Site).GetEngineByExtension(Path.GetExtension(scriptName));
55   - value = engine.InvokeDynamicFunction(functionName, scriptName, target, entry).ToString();
56   - }
57   - catch (Exception ex)
58   - {
59   - IronRuntime.LogError("Error", ex);
60   -
61   - if (SPContext.Current.Web.UserIsSiteAdmin)
62   - {
63   - var eo = engine.ScriptEngine.GetService<ExceptionOperations>();
64   - string error = eo.FormatException(ex);
65   -
66   - IronRuntime.LogError(String.Format("Error executing script {0}: {1}", scriptName, error), ex);
67   -
68   - value = error;
69   - }
70   - else
71   - {
72   - value = "Error occured";
73   - }
74   - }
75   -
76   - return value;
77   - }
78   -
79   - }
80   -}
37 src/IronSharePoint.Framework/IronHttpModule.cs
@@ -12,23 +12,10 @@ public class IronHttpModule:IHttpModule
12 12 {
13 13 public void Init(HttpApplication application)
14 14 {
15   - //application.PreRequestHandlerExecute += new EventHandler(OnPreRequest);
16 15 application.EndRequest += new EventHandler(EndRequest);
17 16 application.Error += new EventHandler(Error);
18 17 }
19 18
20   - //private void OnPreRequest(object sender, EventArgs e)
21   - //{
22   - // var application = sender as HttpApplication;
23   - // var context = application.Context;
24   -
25   - // if (SPContext.Current != null)
26   - // {
27   - // var runtime = IronRuntime.GetDefaultIronRuntime(SPContext.Current.Site);
28   - // context.Items[IronHelper.GetPrefixedKey("Runtime")] = runtime;
29   - // }
30   - //}
31   -
32 19 void Error(object sender, EventArgs e)
33 20 {
34 21 var application = sender as HttpApplication;
@@ -36,20 +23,13 @@ void Error(object sender, EventArgs e)
36 23 if (SPContext.Current != null)
37 24 {
38 25 var runtime = IronRuntime.GetDefaultIronRuntime(SPContext.Current.Site);
39   - var engine = runtime.GetEngineByExtension(".rb");
40   - var exception = application.Server.GetLastError();
  26 + var engine = runtime.RubyEngine;
  27 + var exception = application.Server.GetLastError();
41 28
42   - if (engine != null)
43   - {
44   - var eo = engine.ScriptEngine.GetService<ExceptionOperations>();
45   - string error = eo.FormatException(exception);
  29 + var eo = engine.GetService<ExceptionOperations>();
  30 + string error = eo.FormatException(exception);
46 31
47   - IronRuntime.LogError(error, exception);
48   - }
49   - else
50   - {
51   - IronRuntime.LogError("Error in IronHttpModule", exception);
52   - }
  32 + IronRuntime.LogError(error, exception);
53 33 }
54 34 }
55 35
@@ -62,13 +42,6 @@ void EndRequest(object sender, EventArgs e)
62 42
63 43 private static void CleanUp(HttpApplication application)
64 44 {
65   - //var runtime = HttpContext.Current.Items[IronHelper.GetPrefixedKey("Runtime")] as IronRuntime;
66   -
67   - //if (runtime != null)
68   - //{
69   - // runtime.IronHive.Close();
70   - //}
71   -
72 45 var ironObjectsToDispose = new List<IDisposable>();
73 46
74 47 foreach (var key in application.Context.Items.Keys.OfType<String>())
36 src/IronSharePoint.Framework/IronJob.cs
@@ -10,51 +10,59 @@ namespace IronSharePoint
10 10 public class IronJob : SPJobDefinition
11 11 {
12 12 [Persisted]
13   - private string script;
  13 + private string _script;
14 14
15 15 public string Script
16 16 {
17   - get { return script; }
18   - set { script = value; }
  17 + get { return _script; }
  18 + set { _script = value; }
19 19 }
20 20
21 21 [Persisted]
22   - private Guid hiveId;
  22 + private Guid _siteId;
23 23
24   - public Guid HiveId
  24 + public Guid SiteId
25 25 {
26   - get { return hiveId; }
27   - set { hiveId = value; }
  26 + get { return _siteId; }
  27 + set { _siteId = value; }
28 28 }
29 29
30 30 [Persisted]
31   - private string data;
  31 + private string _data;
32 32
33 33 public string Data
34 34 {
35   - get { return data; }
36   - set { data = value; }
  35 + get { return _data; }
  36 + set { _data = value; }
37 37 }
38 38
  39 + [Persisted]
  40 + private string _languageName;
  41 +
  42 + public string LanguageName
  43 + {
  44 + get { return _languageName; }
  45 + set { _languageName = value; }
  46 + }
39 47
40 48 public IronJob() : base(){}
41 49
42   - public IronJob(string jobName, SPWebApplication webApplication, SPServer server, SPJobLockType lockType, Guid hiveId) : base(jobName, webApplication, SPServer.Local, lockType)
  50 + public IronJob(string jobName, SPWebApplication webApplication, SPServer server, SPJobLockType lockType, Guid siteId) : base(jobName, webApplication, SPServer.Local, lockType)
43 51 {
44 52 this.Title = jobName;
45   - this.HiveId = hiveId;
  53 + this.SiteId = siteId;
46 54 this.Script = String.Empty;
47 55 }
48 56
49 57 public override void Execute(Guid targetInstanceId)
50 58 {
51   - using(SPSite site = new SPSite(HiveId))
  59 + using(SPSite site = new SPSite(SiteId))
52 60 {
53 61 var runtime = IronRuntime.GetDefaultIronRuntime(site);
54 62
55 63 if (String.IsNullOrEmpty(Script))
56 64 {
57   - runtime.IronConsole.Execute(Script, ".rb", true);
  65 + runtime.Console.Execute(Script, LanguageName).Wait();
58 66 }
59 67 }
60 68 }
79 src/IronSharePoint.Framework/IronPlatformAdaptationLayer.cs
@@ -20,15 +20,15 @@ public IronPlatformAdaptationLayer(IHive hive)
20 20 public override string[] GetFileSystemEntries(string path, string searchPattern, bool includeFiles,
21 21 bool includeDirectories)
22 22 {
  23 + path = TrimPath(path);
  24 +
23 25 var entries = new List<string>();
24 26 if (includeFiles)
25 27 {
26   - //entries.AddRange(Directory.GetFiles(path, searchPattern));
27 28 entries.AddRange(_hive.GetFiles(path, searchPattern));
28 29 }
29 30 if (includeDirectories)
30 31 {
31   - //entries.AddRange(Directory.GetDirectories(path, searchPattern));
32 32 entries.AddRange(_hive.GetDirectories(path, searchPattern));
33 33 }
34 34 string[] result = entries.Distinct().Select(x => Regex.IsMatch(x, @"(^\w:|^\./)") ? x : "./" + x).ToArray();
@@ -37,82 +37,65 @@ public IronPlatformAdaptationLayer(IHive hive)
37 37
38 38 public override bool DirectoryExists(string path)
39 39 {
40   - return DelegateToHiveOrBase(path,
41   - _hive.DirectoryExists,
42   - x => base.DirectoryExists(x) || _hive.DirectoryExists(x));
  40 + path = TrimPath(path);
  41 +
  42 + return _hive.DirectoryExists(path);
43 43 }
44 44
45 45 public override bool FileExists(string file)
46 46 {
47   - return DelegateToHiveOrBase(file,
48   - _hive.FileExists,
49   - x => base.FileExists(x) || _hive.FileExists(x));
  47 + file = TrimPath(file);
  48 +
  49 + return _hive.FileExists(file);
50 50 }
51 51
52 52 public override string GetFullPath(string file)
53 53 {
54   - return DelegateToHiveOrBase(file,
55   - _hive.GetFullPath,
56   - x => base.FileExists(file) ? base.GetFullPath(file) : _hive.GetFullPath(file));
  54 + file = TrimPath(file);
  55 +
  56 + return _hive.GetFullPath(file);
57 57 }
58 58
59 59 public override Stream OpenOutputFileStream(string path)
60 60 {
61   - return DelegateToHiveOrBase(path,
62   - _hive.OpenOutputFileStream,
63   - x =>
64   - base.FileExists(x) ? base.OpenOutputFileStream(x) : _hive.OpenOutputFileStream(x));
  61 + path = TrimPath(path);
  62 +
  63 + return _hive.OpenOutputFileStream(path);
65 64 }
66 65
67 66 public override Stream OpenInputFileStream(string path)
68 67 {
69   - return DelegateToHiveOrBase(path,
70   - _hive.OpenInputFileStream,
71   - x =>
72   - base.FileExists(x) ? base.OpenInputFileStream(x) : _hive.OpenInputFileStream(x));
  68 + path = TrimPath(path);
  69 +
  70 + return _hive.OpenInputFileStream(path);
73 71 }
74 72
75 73 public override Stream OpenInputFileStream(string path, FileMode mode, FileAccess access, FileShare share)
76 74 {
77   - return DelegateToHiveOrBase(path,
78   - _hive.OpenInputFileStream,
79   - x =>
80   - base.FileExists(x)
81   - ? base.OpenInputFileStream(x, mode, access, share)
82   - : _hive.OpenInputFileStream(x));
  75 + return OpenInputFileStream(path);
83 76 }
84 77
85 78 public override Stream OpenInputFileStream(string path, FileMode mode, FileAccess access, FileShare share,
86 79 int bufferSize)
87 80 {
88   - return DelegateToHiveOrBase(path,
89   - _hive.OpenInputFileStream,
90   - x =>
91   - base.FileExists(x)
92   - ? base.OpenInputFileStream(x, mode, access, share, bufferSize)
93   -