zena 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. data/History.txt +28 -0
  2. data/README.rdoc +6 -6
  3. data/Rakefile +3 -0
  4. data/app/controllers/users_controller.rb +4 -2
  5. data/app/models/acl.rb +6 -0
  6. data/app/models/cached_page.rb +2 -1
  7. data/app/models/document.rb +3 -4
  8. data/app/models/node.rb +8 -5
  9. data/app/models/site.rb +1 -1
  10. data/app/models/template.rb +2 -2
  11. data/app/models/user.rb +5 -3
  12. data/app/views/acls/_add.rhtml +2 -1
  13. data/app/views/acls/_form.rhtml +15 -7
  14. data/app/views/acls/_li.rhtml +2 -0
  15. data/app/views/acls/index.rhtml +3 -1
  16. data/app/views/acls/show.html.erb +1 -1
  17. data/app/views/links/destroy.rjs +16 -2
  18. data/app/views/versions/destroy.rjs +1 -1
  19. data/app/views/zafu/default/Node-admin.zafu +1 -1
  20. data/bin/zena +5 -3
  21. data/bricks/acls/lib/bricks/acls.rb +11 -4
  22. data/bricks/acls/zena/migrate/20110627193757_add_allowed_mode_and_format_to_acl.rb +11 -0
  23. data/bricks/acls/zena/test/integration/acl_integration_test.rb +42 -0
  24. data/bricks/acls/zena/test/sites/erebus/acls.yml +8 -0
  25. data/bricks/mongrel/zena/deploy.rb +19 -0
  26. data/bricks/single/lib/bricks/single.rb +15 -0
  27. data/bricks/single/zena/init.rb +1 -0
  28. data/bricks/sphinx/zena/tasks.rb +1 -1
  29. data/bricks/static/lib/bricks/static.rb +151 -0
  30. data/bricks/static/zena/init.rb +1 -0
  31. data/bricks/static/zena/migrate/20110702010330_add_static_to_idx_templates.rb +12 -0
  32. data/bricks/static/zena/skins/blog/Image-edit.zafu +6 -0
  33. data/bricks/static/zena/skins/blog/Image.zafu +19 -0
  34. data/bricks/static/zena/skins/blog/Node-+index.zafu +1 -0
  35. data/bricks/static/zena/skins/blog/Node-+notFound.zafu +7 -0
  36. data/bricks/static/zena/skins/blog/Node-+search.zafu +19 -0
  37. data/bricks/static/zena/skins/blog/Node.zafu +66 -0
  38. data/bricks/static/zena/skins/blog/Post.zafu +12 -0
  39. data/bricks/static/zena/skins/blog/Project--kml.zafu +30 -0
  40. data/bricks/static/zena/skins/blog/Project.zafu +45 -0
  41. data/bricks/static/zena/skins/blog/comments.zafu +30 -0
  42. data/bricks/static/zena/skins/blog/dict.yml +11 -0
  43. data/bricks/static/zena/skins/blog/img/dateBg.jpg +0 -0
  44. data/bricks/static/zena/skins/blog/img/header.png +0 -0
  45. data/bricks/static/zena/skins/blog/img/mapPin.png +0 -0
  46. data/bricks/static/zena/skins/blog/img/menu.gif +0 -0
  47. data/bricks/static/zena/skins/blog/img/menuover.gif +0 -0
  48. data/bricks/static/zena/skins/blog/img/style.css +110 -0
  49. data/bricks/static/zena/test/integration/static_integration_test.rb +30 -0
  50. data/bricks/static/zena/test/unit/static_test.rb +33 -0
  51. data/bricks/zena/zena/migrate/01_base.rb +1 -2
  52. data/bricks/zena/zena/migrate/20110623072048_fix_cached_path_index.rb +10 -0
  53. data/bricks/zena/zena/migrate/20110710113731_remove_icon_field.rb +18 -0
  54. data/config/bricks.yml +4 -0
  55. data/config/deploy.rb +17 -2
  56. data/config/gems.yml +9 -7
  57. data/config/selenium.yml +38 -0
  58. data/lib/bricks/requirements_validation.rb +8 -2
  59. data/lib/gettext_strings.rb +2 -1
  60. data/lib/tasks/zena.rake +5 -0
  61. data/lib/zena/app.rb +12 -0
  62. data/lib/zena/console.rb +9 -1
  63. data/lib/zena/core_ext/string.rb +7 -2
  64. data/lib/zena/deploy.rb +60 -6
  65. data/lib/zena/deploy/app_init.rhtml +56 -0
  66. data/lib/zena/deploy/haproxy.cnf.rhtml +34 -0
  67. data/lib/zena/deploy/httpd.rhtml +6 -0
  68. data/lib/zena/deploy/start_stop.rhtml +35 -0
  69. data/lib/zena/info.rb +1 -1
  70. data/lib/zena/remote/connection.rb +1 -1
  71. data/lib/zena/site_worker.rb +9 -5
  72. data/lib/zena/use.rb +1 -1
  73. data/lib/zena/use/action.rb +2 -2
  74. data/lib/zena/use/ajax.rb +22 -9
  75. data/lib/zena/use/conditional.rb +5 -0
  76. data/lib/zena/use/context.rb +6 -1
  77. data/lib/zena/use/dates.rb +17 -2
  78. data/lib/zena/use/display.rb +14 -3
  79. data/lib/zena/use/forms.rb +37 -47
  80. data/lib/zena/use/html_tags.rb +3 -0
  81. data/lib/zena/use/node_context.rb +17 -17
  82. data/lib/zena/use/rendering.rb +1 -1
  83. data/lib/zena/use/urls.rb +11 -2
  84. data/lib/zena/use/zafu_attributes.rb +1 -0
  85. data/lib/zena/use/zafu_safe_definitions.rb +16 -1
  86. data/lib/zena/use/zafu_templates.rb +39 -24
  87. data/lib/zena/use/zazen.rb +1 -0
  88. data/locale/de/LC_MESSAGES/zena.mo +0 -0
  89. data/locale/de/zena.po +105 -89
  90. data/locale/en/LC_MESSAGES/zena.mo +0 -0
  91. data/locale/en/zena.mo +0 -0
  92. data/locale/en/zena.po +188 -253
  93. data/locale/fr/LC_MESSAGES/zena.mo +0 -0
  94. data/locale/fr/zena.mo +0 -0
  95. data/locale/fr/zena.po +200 -257
  96. data/locale/zena.pot +95 -85
  97. data/public/javascripts/zena.js +2 -2
  98. data/test/fixtures/files/{Node-test.zafu → TestNode.zafu} +206 -4
  99. data/test/functional/nodes_controller_test.rb +2 -2
  100. data/test/integration/navigation_test.rb +9 -3
  101. data/test/integration/query_node/basic.yml +4 -4
  102. data/test/integration/query_node/filters.yml +2 -2
  103. data/test/integration/zafu_compiler/ajax.yml +6 -6
  104. data/test/integration/zafu_compiler/basic.yml +1 -1
  105. data/test/integration/zafu_compiler/calendar.yml +4 -3
  106. data/test/integration/zafu_compiler/conditional.yml +3 -10
  107. data/test/integration/zafu_compiler/context.yml +1 -1
  108. data/test/integration/zafu_compiler/dates.yml +9 -1
  109. data/test/integration/zafu_compiler/display.yml +7 -1
  110. data/test/integration/zafu_compiler/eval.yml +12 -46
  111. data/test/integration/zafu_compiler/forms.yml +1 -1
  112. data/test/integration/zafu_compiler/query.yml +2 -2
  113. data/test/integration/zafu_compiler/relations.yml +19 -9
  114. data/test/integration/zafu_compiler/roles.yml +12 -0
  115. data/test/integration/zafu_compiler/safe_definitions.yml +1 -1
  116. data/test/integration/zafu_compiler/urls.yml +13 -5
  117. data/test/integration/zafu_compiler/version.yml +6 -0
  118. data/test/integration/zafu_compiler/zafu_attributes.yml +4 -4
  119. data/test/integration/zafu_compiler_test.rb +1 -1
  120. data/test/selenium.readme +8 -0
  121. data/test/selenium/Add/0setup.rsel +12 -0
  122. data/test/selenium/Add/add1.rsel +22 -0
  123. data/test/selenium/Add/add2.rsel +22 -0
  124. data/test/selenium/Add/add3.rsel +22 -0
  125. data/test/selenium/Drop/0setup.rsel +12 -0
  126. data/test/selenium/Drop/drop1.rsel +25 -0
  127. data/test/selenium/Drop/drop2.rsel +25 -0
  128. data/test/selenium/Drop/drop3.rsel +51 -0
  129. data/test/selenium/Drop/drop4.rsel +44 -0
  130. data/test/selenium/Drop/drop5.rsel +16 -0
  131. data/test/selenium/Edit/0setup.rsel +12 -0
  132. data/test/selenium/Edit/edit1.rsel +31 -0
  133. data/test/selenium/Edit/edit2.rsel +39 -0
  134. data/test/selenium/Edit/edit3.rsel +40 -0
  135. data/test/selenium/Form/0setup.rsel +12 -0
  136. data/test/selenium/Form/form1.rsel +9 -0
  137. data/test/selenium/Form/form2.rsel +9 -0
  138. data/test/selenium/Paginate/0setup.rsel +12 -0
  139. data/test/selenium/Paginate/paginate1.rsel +24 -0
  140. data/test/selenium/Toggle/0setup.rsel +12 -0
  141. data/test/selenium/Toggle/toggle1.rsel +21 -0
  142. data/test/sites/zena/nodes.yml +4 -4
  143. data/test/sites/zena/roles.yml +3 -2
  144. data/test/sites/zena/versions.yml +12 -11
  145. data/test/unit/core_ext_test.rb +23 -5
  146. data/test/unit/document_test.rb +6 -2
  147. data/test/unit/node_test.rb +2 -2
  148. data/test/unit/remote_test.rb +1 -2
  149. data/test/unit/role_test.rb +2 -2
  150. data/test/unit/user_test.rb +48 -1
  151. data/test/unit/virtual_class_test.rb +7 -7
  152. data/test/unit/zena/acts/secure_test.rb +1 -1
  153. data/test/unit/zena/use/rendering_test.rb +1 -1
  154. data/test/unit/zena/use/urls_test.rb +3 -3
  155. data/zena.gemspec +65 -101
  156. metadata +67 -103
  157. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run 2.tmCommand +0 -24
  158. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Context.tmCommand +0 -58
  159. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Focused Should.tmCommand +0 -88
  160. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run.tmCommand +0 -27
  161. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/YAML to Shoulda.tmCommand +0 -23
  162. data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Context.tmPreferences +0 -19
  163. data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Should.tmPreferences +0 -19
  164. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory attributes for.tmSnippet +0 -16
  165. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory build.tmSnippet +0 -16
  166. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory.tmSnippet +0 -16
  167. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define with class.tmSnippet +0 -18
  168. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define.tmSnippet +0 -18
  169. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_next.tmSnippet +0 -16
  170. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_sequence.tmSnippet +0 -18
  171. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_bad_value.tmSnippet +0 -16
  172. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_contains.tmSnippet +0 -16
  173. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_does_not_contain.tmSnippet +0 -16
  174. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_good_value.tmSnippet +0 -16
  175. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_same_elements.tmSnippet +0 -16
  176. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_save.tmSnippet +0 -16
  177. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_sent_email.tmSnippet +0 -18
  178. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_valid.tmSnippet +0 -16
  179. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/association.tmSnippet +0 -17
  180. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/attribute.tmSnippet +0 -17
  181. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/before_should block.tmSnippet +0 -18
  182. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block get.tmSnippet +0 -22
  183. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block post.tmSnippet +0 -23
  184. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block with setup.tmSnippet +0 -25
  185. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/setup.tmSnippet +0 -18
  186. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block with before proc.tmSnippet +0 -18
  187. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block.tmSnippet +0 -18
  188. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_allow_values_for.tmSnippet +0 -16
  189. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_assign_to.tmSnippet +0 -16
  190. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful denied.tmSnippet +0 -20
  191. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful.tmSnippet +0 -20
  192. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_belong_to.tmSnippet +0 -16
  193. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change by.tmSnippet +0 -16
  194. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change from to.tmSnippet +0 -16
  195. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_at_least.tmSnippet +0 -16
  196. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_in_range.tmSnippet +0 -16
  197. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_is.tmSnippet +0 -16
  198. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_value_in_range.tmSnippet +0 -16
  199. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_eventually.tmSnippet +0 -18
  200. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_filter_params.tmSnippet +0 -16
  201. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_and_belong_to_many.tmSnippet +0 -16
  202. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_class_methods.tmSnippet +0 -16
  203. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_column.tmSnippet +0 -16
  204. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_columns.tmSnippet +0 -16
  205. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_index.tmSnippet +0 -16
  206. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_indices.tmSnippet +0 -16
  207. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_instance_methods.tmSnippet +0 -16
  208. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_many.tmSnippet +0 -16
  209. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_named_scope.tmSnippet +0 -16
  210. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_one.tmSnippet +0 -16
  211. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_readonly_attributes.tmSnippet +0 -16
  212. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_mass_assignment_of.tmSnippet +0 -16
  213. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_values_for.tmSnippet +0 -16
  214. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_assign_to.tmSnippet +0 -16
  215. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_change.tmSnippet +0 -16
  216. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_set_the_flash.tmSnippet +0 -16
  217. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_redirect_to.tmSnippet +0 -16
  218. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_a_form.tmSnippet +0 -16
  219. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_template.tmSnippet +0 -16
  220. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_with_layout.tmSnippet +0 -16
  221. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_without_layout.tmSnippet +0 -16
  222. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with.tmSnippet +0 -16
  223. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with_content_type.tmSnippet +0 -16
  224. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_return_from_session.tmSnippet +0 -16
  225. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_route.tmSnippet +0 -16
  226. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_set_the_flash_to.tmSnippet +0 -16
  227. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_acceptance_of.tmSnippet +0 -16
  228. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_numericality_of.tmSnippet +0 -16
  229. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_presence_of.tmSnippet +0 -16
  230. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of with scope.tmSnippet +0 -16
  231. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of.tmSnippet +0 -16
  232. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
  233. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/run_script.rb +0 -104
  234. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
  235. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/test.rb +0 -17
  236. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/todo.txt +0 -13
  237. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/bin/yaml_to_shoulda.rb +0 -25
  238. data/vendor/TextMate/Ruby Shoulda.tmbundle/Syntaxes/Ruby on Rails (Shoulda).tmLanguage +0 -166
  239. data/vendor/TextMate/Ruby Shoulda.tmbundle/info.plist +0 -304
  240. data/vendor/TextMate/Zena.tmbundle/Commands/Run all yaml tests.tmCommand +0 -37
  241. data/vendor/TextMate/Zena.tmbundle/Commands/Run focused yaml test.tmCommand +0 -52
  242. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
  243. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/run_script.rb +0 -118
  244. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
  245. data/vendor/TextMate/Zena.tmbundle/info.plist +0 -17
@@ -1,37 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>beforeRunningCommand</key>
6
- <string>saveActiveFile</string>
7
- <key>command</key>
8
- <string># Assumes the current file is a yaml test file
9
- # Runs with the currently-focused method as the test name
10
-
11
- args=$(${TM_RUBY:=ruby} &lt;&lt;"EOF"
12
- group = ENV['TM_FILEPATH'].split('/').last.split('.').first
13
- test_file = "#{File.dirname(ENV['TM_FILEPATH'])}_test.rb"
14
- puts test_file
15
- EOF)
16
-
17
- if [[ -z "$args" ]]; then
18
- echo -e "This doesn't appear to be a yaml test file."
19
- exit_show_tool_tip
20
- fi
21
-
22
- export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}"
23
- "${TM_RUBY:-ruby}" -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb" $args</string>
24
- <key>input</key>
25
- <string>document</string>
26
- <key>keyEquivalent</key>
27
- <string>~r</string>
28
- <key>name</key>
29
- <string>Run all yaml tests</string>
30
- <key>output</key>
31
- <string>showAsHTML</string>
32
- <key>scope</key>
33
- <string>source.yaml</string>
34
- <key>uuid</key>
35
- <string>1AF06162-B9B6-46E8-8058-AF8CA4EDC178</string>
36
- </dict>
37
- </plist>
@@ -1,52 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>beforeRunningCommand</key>
6
- <string>saveActiveFile</string>
7
- <key>command</key>
8
- <string># Assumes the current file is a yaml test file
9
- # Runs with the currently-focused method as the test name
10
- args=$(${TM_RUBY:=ruby} &lt;&lt;"EOF"
11
-
12
- n = ENV['TM_LINE_NUMBER'].to_i
13
-
14
- name, test_file_path = nil, nil
15
-
16
- File.open(ENV['TM_FILEPATH']) do |f|
17
- # yaml test
18
- lines = f.read.split("\n")[0...n].reverse
19
- name = lines.find { |line| line =~ /^([^\s]+):\s*$/i }
20
- name = $1 if name
21
- test_file_path = lines.find { |line| line =~ /^#\s*test_file\s*:\s*(.*)$/i }
22
- test_file_path = File.join(File.dirname(ENV['TM_FILEPATH']), $1) if test_file_path
23
- end
24
-
25
-
26
- group = ENV['TM_FILEPATH'].split('/').last.split('.').first
27
- test_file_path ||= "#{File.dirname(ENV['TM_FILEPATH'])}_test.rb"
28
- test_file = "#{test_file_path} --name test_#{group}_#{name}"
29
- puts test_file
30
- EOF)
31
-
32
- if [[ -z "$args" ]]; then
33
- echo -e "This doesn't appear to be a yaml test file."
34
- exit_show_tool_tip
35
- fi
36
-
37
- export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}"
38
- "${TM_RUBY:-ruby}" -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb" $args </string>
39
- <key>input</key>
40
- <string>document</string>
41
- <key>keyEquivalent</key>
42
- <string>@R</string>
43
- <key>name</key>
44
- <string>Run focused yaml test</string>
45
- <key>output</key>
46
- <string>showAsHTML</string>
47
- <key>scope</key>
48
- <string>source.yaml</string>
49
- <key>uuid</key>
50
- <string>0A94D7BE-E897-4B1B-8C2B-AEFB2B4BDD9F</string>
51
- </dict>
52
- </plist>
@@ -1,39 +0,0 @@
1
- STDOUT.sync = true
2
- STDERR.sync = true
3
-
4
- require 'pathname'
5
-
6
- at_exit do
7
- if (e = $!) && !e.instance_of?(SystemExit)
8
- require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
9
- require "cgi"
10
- io = IO.for_fd(ENV['TM_ERROR_FD'].to_i)
11
-
12
- io.write "<div id='exception_report' class='framed'>\n"
13
- io.write "<p id='exception'><strong>#{e.class.name}:</strong> #{CGI.escapeHTML e.message.sub(/`(\w+)'/, '‘\1’').sub(/ -- /, ' — ')}</p>\n"
14
-
15
- io.write "<blockquote><table border='0' cellspacing='0' cellpadding='0'>\n"
16
-
17
- e.backtrace.each do |b|
18
- if b =~ /(.*?):(\d+)(?::in\s*`(.*?)')?/ then
19
- file, line, method = $1, $2, $3
20
-
21
- url, display_name = '', 'untitled document';
22
- if file != '-' && File.exists?(file) then
23
- file = Pathname.new(file).realpath.to_s
24
- url = '&url=file://' + e_url(file)
25
- display_name = File.basename(file)
26
- end
27
-
28
- io << "<tr><td><a class='near' href='txmt://open?line=#{line + url}'>"
29
- io << (method ? "method #{CGI::escapeHTML method}" : '<em>at top level</em>')
30
- io << "</a></td>\n<td>in <strong>#{CGI::escapeHTML display_name}</strong> at line #{line}</td></tr>\n"
31
- end
32
- end
33
-
34
- io.write "</table></blockquote></div>"
35
- io.flush
36
-
37
- exit!
38
- end
39
- end
@@ -1,118 +0,0 @@
1
- require "#{ENV['TM_SUPPORT_PATH']}/lib/scriptmate"
2
- require 'cgi'
3
-
4
- $SCRIPTMATE_VERSION = "$Revision: 6354 $"
5
-
6
- class RubyScript < UserScript
7
- attr_reader :test_name, :base_path, :path, :content
8
- def lang; 'Ruby' end
9
- def executable; @hashbang || ENV['TM_RUBY'] || 'ruby' end
10
- def args; ['-rcatch_exception', '-rstdin_dialog'] end
11
- def version_string
12
- ruby_path = %x{ #{executable} -e 'require "rbconfig"; print Config::CONFIG["bindir"] + "/" + Config::CONFIG["ruby_install_name"]'}
13
- res = "Ruby r" + %x{ #{executable} -e 'print RUBY_VERSION' }
14
- res + " (#{ruby_path})"
15
- end
16
- def test_script?
17
- @path =~ /(?:\b|_)(?:tc|ts|test)(?:\b|_)/ or
18
- @content =~ /\brequire\b.+(?:test\/unit|test_helper)/
19
- end
20
- def filter_cmd(cmd)
21
- cmd -= [ENV['TM_FILEPATH']]
22
- if test_script?
23
- path_ary = @path.split('/')
24
- if index = path_ary.rindex('test')
25
- test_path = File.join(*path_ary[0..index])
26
- lib_path = File.join( *( path_ary[0..-2] +
27
- ['..'] * (path_ary.length - index - 1) ) +
28
- ['lib'] )
29
- if File.exist? lib_path
30
- cmd.insert(1, "-I#{e_sh lib_path}:#{e_sh test_path}")
31
- end
32
- end
33
- end
34
- if index = cmd.rindex('--name')
35
- @test_name = cmd[index+1]
36
- @base_path = cmd[index-1].gsub(/\_test.rb$/,'')
37
- else
38
- @base_path = cmd.last.gsub(/\_test.rb$/,'')
39
- end
40
- @cmd = cmd
41
- end
42
- end
43
-
44
- class RubyMate < ScriptMate
45
- def base_path
46
- @base_path ||= begin
47
- path_ary = @command.path.split('/')
48
- if index = path_ary.rindex('test')
49
- File.join(*path_ary[0..(index -1)])
50
- else
51
- @command.path
52
- end
53
- end
54
- end
55
-
56
- def run
57
- super
58
- rescue => err
59
- File.open('/Users/gaspard/yaml.log', 'ab') do |f|
60
- f.puts err.message
61
- f.puts err.backtrace.join("\n")
62
- end
63
- raise err
64
- end
65
-
66
- def absolute_path(path)
67
- if path =~ %r{\A/}
68
- path
69
- else
70
- "#{base_path}/#{path}"
71
- end
72
- end
73
-
74
- def full_method_name(file, method)
75
- if absolute_path(file) == @command.path
76
- method
77
- else
78
- "#{File.basename(file)} #{method}"
79
- end
80
- end
81
-
82
- def filter_stdout(str)
83
- if @command.test_script? and str =~ /\A[.EF]+\Z/
84
- # ...F....E....
85
- htmlize(str).gsub(/[EF]+/, "<span style=\"color: red\">\\&</span>") + "<br style=\"display: none\"/>"
86
- else
87
- if @command.test_script?
88
- str.map do |line|
89
- if line =~ %r{\(eval\).*in `(test_(\w+?)_(.*))'}
90
- test_name = $1
91
- group, method = $2, $3
92
- begin
93
- file = File.join(@command.base_path, "#{group}.yml")
94
- lines = File.read(file).split("\n")
95
- position = lines.rindex { |l| l =~ %r{^#{method}:} } + 1
96
- "<span><a class='near' href=\"txmt://open?url=file://#{e_url(file)}&amp;line=#{position}\">#{test_name}</a></span>:#{position}<br/>"
97
- rescue => err
98
- line
99
- end
100
- elsif line =~ /^\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/
101
- "<span style=\"color: #{$1 + $2 == "00" ? "green" : "red"}\">#{$&}</span><br/>"
102
- elsif line =~ /Loaded suite/ && @command.test_name
103
- htmlize(line.chomp + " --name #{@command.test_name}\n")
104
- elsif line =~ /`yt_|\(eval\)/
105
- nil
106
- else
107
- htmlize(line)
108
- end
109
- end.compact.join
110
- else
111
- htmlize(str)
112
- end
113
- end
114
- end
115
- end
116
-
117
- script = RubyScript.new(STDIN.read)
118
- RubyMate.new(script).emit_html
@@ -1,14 +0,0 @@
1
- require "ui"
2
-
3
- class TextMateSTDIN < IO
4
- def gets(sep = nil)
5
- TextMate::UI.request_string( :prompt => "Script is Requesting Input:",
6
- :button1 => "Send" ) + "\n"
7
- end
8
- end
9
-
10
- $TM_STDIN = TextMateSTDIN.new(STDIN.fileno)
11
- STDIN.reopen($TM_STDIN)
12
- def gets(sep = nil)
13
- $TM_STDIN.gets(sep)
14
- end
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>deleted</key>
6
- <array/>
7
- <key>name</key>
8
- <string>Zena</string>
9
- <key>ordering</key>
10
- <array>
11
- <string>1AF06162-B9B6-46E8-8058-AF8CA4EDC178</string>
12
- <string>0A94D7BE-E897-4B1B-8C2B-AEFB2B4BDD9F</string>
13
- </array>
14
- <key>uuid</key>
15
- <string>89153BC7-73D5-4EA9-B226-86D267D49922</string>
16
- </dict>
17
- </plist>