redcar 0.3.4.3 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. data/CHANGES +45 -0
  2. data/README.md +2 -1
  3. data/ROADMAP.md +0 -1
  4. data/Rakefile +10 -4
  5. data/bin/redcar +2 -2
  6. data/lib/openssl/build.properties +7 -0
  7. data/lib/plugin_manager/lib/plugin_manager.rb +10 -0
  8. data/lib/plugin_manager/lib/plugin_manager/plugin_definition.rb +1 -13
  9. data/lib/redcar.rb +12 -8
  10. data/lib/redcar/installer.rb +16 -15
  11. data/lib/redcar/ruby_extensions.rb +146 -1
  12. data/lib/redcar/runner.rb +16 -7
  13. data/lib/redcar/usage.rb +4 -7
  14. data/lib/redcar_quick_start.rb +5 -5
  15. data/lib/regex_replace.rb +0 -7
  16. data/plugins/application/features/step_definitions/command_steps.rb +5 -0
  17. data/plugins/application/features/step_definitions/dialog_steps.rb +5 -0
  18. data/plugins/application/features/step_definitions/filter_list_dialog_steps.rb +38 -0
  19. data/plugins/application/features/step_definitions/window_steps.rb +1 -1
  20. data/plugins/application/features/support/env.rb +44 -8
  21. data/plugins/application/lib/application.rb +32 -33
  22. data/plugins/application/lib/application/command.rb +32 -2
  23. data/plugins/application/lib/application/command/executor.rb +2 -12
  24. data/plugins/application/lib/application/dialog.rb +14 -14
  25. data/plugins/application/lib/application/event_spewer.rb +32 -0
  26. data/plugins/application/lib/application/menu.rb +5 -5
  27. data/plugins/application/lib/application/menu/builder.rb +5 -0
  28. data/plugins/application/lib/application/menu/lazy_menu.rb +24 -0
  29. data/plugins/application/lib/application/notebook.rb +4 -3
  30. data/plugins/application/lib/application/tab.rb +6 -2
  31. data/plugins/application/lib/application/window.rb +8 -4
  32. data/plugins/application/spec/application/menu/builder_spec.rb +17 -1
  33. data/plugins/application/spec/application/notebook_spec.rb +1 -1
  34. data/plugins/application_swt/build.xml +74 -0
  35. data/plugins/application_swt/lib/application_swt.rb +79 -0
  36. data/plugins/application_swt/lib/application_swt/cucumber_patches.rb +6 -1
  37. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +25 -17
  38. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +50 -12
  39. data/plugins/application_swt/lib/application_swt/html_tab.rb +20 -0
  40. data/plugins/application_swt/lib/application_swt/menu.rb +26 -2
  41. data/plugins/application_swt/lib/application_swt/notebook.rb +10 -12
  42. data/plugins/application_swt/lib/application_swt/window.rb +11 -11
  43. data/plugins/application_swt/src/com/redcareditor/application_swt/CocoaUIEnhancer.java +313 -0
  44. data/plugins/auto_completer/lib/auto_completer.rb +74 -67
  45. data/plugins/auto_completer/lib/auto_completer/current_document_completion_source.rb +19 -0
  46. data/plugins/auto_completer/lib/auto_completer/document_controller.rb +2 -2
  47. data/plugins/auto_completer/lib/auto_completer/word_list.rb +8 -1
  48. data/plugins/auto_indenter/features/ruby_style_indentation.feature +24 -0
  49. data/plugins/auto_indenter/features/step_definitions/indentation_steps.rb +6 -0
  50. data/plugins/auto_indenter/features/support/env.rb +2 -0
  51. data/plugins/auto_indenter/lib/auto_indenter.rb +86 -0
  52. data/plugins/auto_indenter/lib/auto_indenter/analyzer.rb +91 -0
  53. data/plugins/auto_indenter/lib/auto_indenter/commands.rb +34 -0
  54. data/plugins/auto_indenter/lib/auto_indenter/document_controller.rb +67 -12
  55. data/plugins/auto_indenter/lib/auto_indenter/rules.rb +41 -0
  56. data/plugins/auto_indenter/spec/auto_indenter/analyzer_spec.rb +151 -0
  57. data/plugins/auto_indenter/spec/spec_helper.rb +5 -0
  58. data/plugins/auto_pairer/lib/auto_pairer.rb +1 -0
  59. data/plugins/auto_pairer/lib/auto_pairer/document_controller.rb +43 -42
  60. data/plugins/auto_pairer/lib/auto_pairer/pairs_for_scope.rb +1 -5
  61. data/plugins/core/lib/core.rb +12 -1
  62. data/plugins/core/lib/core/observable.rb +7 -7
  63. data/plugins/core/lib/core/persistent_cache.rb +14 -2
  64. data/plugins/core/lib/core/plugin.rb +7 -0
  65. data/plugins/core/lib/core/resource.rb +78 -0
  66. data/plugins/core/lib/core/task.rb +62 -0
  67. data/plugins/core/lib/core/task_queue.rb +72 -0
  68. data/plugins/core/spec/core/resource_spec.rb +124 -0
  69. data/plugins/core/spec/core/task_queue_spec.rb +202 -0
  70. data/plugins/core/spec/spec_helper.rb +23 -1
  71. data/plugins/declarations/TODO +3 -0
  72. data/plugins/declarations/lib/declarations.rb +144 -0
  73. data/plugins/declarations/lib/declarations/completion_source.rb +22 -0
  74. data/plugins/declarations/lib/declarations/file.rb +68 -0
  75. data/plugins/declarations/lib/declarations/parser.rb +94 -0
  76. data/plugins/declarations/lib/declarations/select_tag_dialog.rb +44 -0
  77. data/plugins/declarations/plugin.rb +7 -0
  78. data/plugins/declarations/spec/declarations/file_spec.rb +62 -0
  79. data/plugins/declarations/spec/fixtures/federalist.rb +15 -0
  80. data/plugins/declarations/spec/spec_helper.rb +4 -0
  81. data/plugins/edit_view/features/indentation_commands.feature +40 -0
  82. data/plugins/edit_view/features/line_delimiter.feature +40 -0
  83. data/plugins/edit_view/features/step_definitions/editing_steps.rb +16 -4
  84. data/plugins/edit_view/features/step_definitions/notebook_steps.rb +1 -1
  85. data/plugins/edit_view/features/step_definitions/tab_steps.rb +1 -1
  86. data/plugins/edit_view/features/step_definitions/window_steps.rb +5 -1
  87. data/plugins/edit_view/features/support/env.rb +3 -5
  88. data/plugins/edit_view/features/undo_and_redo.feature +21 -0
  89. data/plugins/edit_view/lib/edit_view.rb +57 -4
  90. data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +19 -3
  91. data/plugins/edit_view/lib/edit_view/document.rb +46 -11
  92. data/plugins/edit_view/lib/edit_view/document/indentation.rb +35 -0
  93. data/plugins/edit_view/lib/edit_view/modified_tabs_checker.rb +35 -0
  94. data/plugins/edit_view/lib/edit_view/tab_settings.rb +13 -3
  95. data/plugins/edit_view/spec/edit_view/document/indentation_spec.rb +112 -0
  96. data/plugins/edit_view/spec/edit_view/document_spec.rb +22 -0
  97. data/plugins/edit_view/spec/spec_helper.rb +1 -0
  98. data/plugins/edit_view_swt/lib/edit_view_swt.rb +59 -7
  99. data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +3 -3
  100. data/plugins/edit_view_swt/lib/edit_view_swt/word_movement.rb +2 -2
  101. data/plugins/edit_view_swt/vendor/java-mateview.rb +3 -2
  102. data/plugins/encryption/encryption.rb +13 -6
  103. data/plugins/execute_current_tab/lib/execute_current_tab.rb +25 -15
  104. data/plugins/html_view/assets/redcar.css +32 -1
  105. data/plugins/html_view/lib/html_view.rb +23 -3
  106. data/plugins/html_view/lib/html_view/html_tab.rb +4 -0
  107. data/plugins/my_plugin/lib/my_plugin.rb +4 -12
  108. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +1 -0
  109. data/plugins/plugin_manager_ui/views/index.html.erb +30 -37
  110. data/plugins/project/features/find_file.feature +75 -0
  111. data/plugins/project/features/open_and_save_files.feature +7 -7
  112. data/plugins/project/features/open_directory_tree.feature +11 -3
  113. data/plugins/project/features/refresh_directory_tree.feature +7 -1
  114. data/plugins/project/features/step_definitions/directory_steps.rb +11 -1
  115. data/plugins/project/features/step_definitions/file_steps.rb +10 -0
  116. data/plugins/project/features/support/env.rb +6 -1
  117. data/plugins/project/features/watch_for_modified_files.feature +79 -0
  118. data/plugins/project/lib/project.rb +72 -306
  119. data/plugins/project/lib/project/commands.rb +128 -0
  120. data/plugins/project/lib/project/dir_mirror.rb +5 -1
  121. data/plugins/project/lib/project/drb_service.rb +21 -31
  122. data/plugins/project/lib/project/file_list.rb +76 -0
  123. data/plugins/project/lib/project/file_mirror.rb +13 -1
  124. data/plugins/project/lib/project/find_file_dialog.rb +22 -52
  125. data/plugins/project/lib/project/manager.rb +210 -0
  126. data/plugins/project/lib/project/recent_directories.rb +16 -3
  127. data/plugins/project/plugin.rb +1 -1
  128. data/plugins/project/spec/fixtures/myproject/README +2 -0
  129. data/plugins/project/spec/fixtures/myproject/lib/foo_lib.rb +1 -0
  130. data/plugins/project/spec/fixtures/myproject/spec/foo_spec.rb +1 -0
  131. data/plugins/project/{features → spec}/fixtures/winter.txt +0 -0
  132. data/plugins/project/spec/project/dir_mirror_spec.rb +1 -12
  133. data/plugins/project/spec/project/file_list_spec.rb +140 -0
  134. data/plugins/project/spec/spec_helper.rb +20 -0
  135. data/plugins/redcar/plugin.rb +1 -0
  136. data/plugins/redcar/redcar.rb +254 -84
  137. data/plugins/redcar_debug/lib/redcar_debug.rb +58 -11
  138. data/plugins/redcar_debug/vendor/jruby-prof/README +46 -0
  139. data/plugins/redcar_debug/vendor/jruby-prof/Rakefile +36 -0
  140. data/plugins/redcar_debug/vendor/jruby-prof/build.xml +31 -0
  141. data/plugins/redcar_debug/vendor/jruby-prof/example/call_tree.html +22677 -0
  142. data/plugins/redcar_debug/vendor/jruby-prof/example/call_tree.txt +589 -0
  143. data/plugins/redcar_debug/vendor/jruby-prof/example/flat.txt +28 -0
  144. data/plugins/redcar_debug/vendor/jruby-prof/example/graph.html +1670 -0
  145. data/plugins/redcar_debug/vendor/jruby-prof/example/graph.txt +125 -0
  146. data/plugins/redcar_debug/vendor/jruby-prof/example/pidigits.rb +92 -0
  147. data/plugins/redcar_debug/vendor/jruby-prof/example/test.rb +28 -0
  148. data/plugins/redcar_debug/vendor/jruby-prof/example/test2.rb +29 -0
  149. data/plugins/redcar_debug/vendor/jruby-prof/example/test_exception.rb +28 -0
  150. data/plugins/redcar_debug/vendor/jruby-prof/example/test_overhead.rb +43 -0
  151. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof.rb +66 -0
  152. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/abstract_printer.rb +21 -0
  153. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/flat_text_printer.rb +35 -0
  154. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/graph_html_printer.rb +123 -0
  155. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/graph_text_printer.rb +45 -0
  156. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/invocation_set.rb +34 -0
  157. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/method.rb +107 -0
  158. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/profile_invocation.rb +43 -0
  159. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/simple_tree_printer.rb +27 -0
  160. data/plugins/redcar_debug/vendor/jruby-prof/lib/jruby-prof/tree_html_printer.rb +144 -0
  161. data/plugins/redcar_debug/vendor/jruby-prof/src/org/jruby/prof/Invocation.java +14 -0
  162. data/plugins/redcar_debug/vendor/jruby-prof/src/org/jruby/prof/JRubyProf.java +94 -0
  163. data/plugins/redcar_debug/vendor/jruby-prof/src/org/jruby/prof/ProfEventHook.java +49 -0
  164. data/plugins/redcar_debug/vendor/jruby-prof/templates/graph_row.html.erb +18 -0
  165. data/plugins/redcar_debug/vendor/jruby-prof/test/basic_test.rb +291 -0
  166. data/plugins/redcar_debug/views/history.html.erb +33 -0
  167. data/plugins/redcar_debug/views/index.html.erb +33 -0
  168. data/plugins/repl/lib/repl/internal_mirror.rb +3 -15
  169. data/plugins/repl/spec/repl/internal_mirror_spec.rb +2 -2
  170. data/plugins/snippets/lib/snippets.rb +0 -1
  171. data/plugins/snippets/lib/snippets/document_controller.rb +7 -1
  172. data/plugins/task_manager/lib/task_manager.rb +28 -0
  173. data/plugins/task_manager/plugin.rb +11 -0
  174. data/plugins/task_manager/views/index.html.erb +67 -0
  175. data/plugins/textmate/lib/textmate.rb +17 -21
  176. data/plugins/textmate/lib/textmate/plist.rb +1 -2
  177. data/plugins/textmate/lib/textmate/preference.rb +5 -1
  178. data/plugins/textmate/lib/textmate/snippet.rb +6 -1
  179. data/plugins/tree_view_swt/lib/tree_view_swt.rb +0 -6
  180. data/textmate/Bundles/Cucumber.tmbundle/Preferences/Comments.tmPreferences +1 -1
  181. data/textmate/Bundles/Cucumber.tmbundle/Preferences/next_Cucumber_Plain_Text_Feature_Completions.tmPreferences +30 -0
  182. data/textmate/Bundles/Cucumber.tmbundle/Preferences/next_Symbol_list___Scenario.tmPreferences +19 -0
  183. data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/next_Cucumber_Plain_Text_Feature.tmLanguage +221 -0
  184. data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/next_Cucumber_Steps.tmLanguage +424 -0
  185. data/textmate/Bundles/Cucumber.tmbundle/Syntaxes/plaintext_template.erb +19 -77
  186. data/textmate/Bundles/Cucumber.tmbundle/info.plist +1 -20
  187. data/textmate/Bundles/Perl.tmbundle/Syntaxes/Perl.plist +1 -1
  188. data/textmate/Themes/Emacs Strict.tmTheme +241 -0
  189. data/textmate/Themes/IR_White.tmTheme +792 -0
  190. data/textmate/Themes/Monokai.tmTheme +291 -0
  191. data/textmate/Themes/WhysPoignant.tmTheme +191 -0
  192. metadata +92 -7
  193. data/plugins/application/features/main_window.feature +0 -8
  194. data/plugins/project/lib/project/project_command.rb +0 -5
  195. data/textmate/Bundles/Cucumber.tmbundle/Snippets/Scenario.tmSnippet +0 -22
  196. data/textmate/Bundles/Cucumber.tmbundle/Snippets/Story.tmSnippet +0 -25
@@ -0,0 +1,33 @@
1
+ <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets redcar.css))) %>
2
+ <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
3
+
4
+ <h3>Command History</h3>
5
+
6
+ <a href="controller/index">Refresh</a>
7
+ <br /><br />
8
+ <table>
9
+ <tr>
10
+ <th>Completed</th>
11
+ <th>Description</th>
12
+ </tr>
13
+ <% Redcar.app.history.reverse.each do |command| %>
14
+ <tr class="<%= "error" if command.error %>">
15
+ <td><%#= command.completed_time.strftime("%X") %></td>
16
+ <td><%= CGI.escapeHTML(command.class.to_s) %></td>
17
+ </tr>
18
+ <% if e = command.error %>
19
+ <tr>
20
+ <td colspan="3">
21
+ <strong><%= e.class %></strong>
22
+ <%= CGI.escapeHTML(e.message) %>
23
+ <br /><br />
24
+ <% e.backtrace.each do |line| %>
25
+ <%= line %><br />
26
+ <% end %>
27
+ </td>
28
+ </tr>
29
+ <% end %>
30
+ <% end %>
31
+ </table>
32
+
33
+
@@ -0,0 +1,33 @@
1
+ <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets redcar.css))) %>
2
+ <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
3
+
4
+ <h3>Command History</h3>
5
+
6
+ <a href="controller/index">Refresh</a>
7
+
8
+ <table>
9
+ <tr>
10
+ <th>Completed</th>
11
+ <th>Description</th>
12
+ </tr>
13
+ <% Redcar.app.history.reverse.each do |command| %>
14
+ <tr class="<%= "error" if command.error %>">
15
+ <td><%#= command.completed_time.strftime("%X") %></td>
16
+ <td><%= CGI.escapeHTML(command.class.to_s) %></td>
17
+ </tr>
18
+ <% if e = command.error %>
19
+ <tr>
20
+ <td colspan="3">
21
+ <strong><%= e.class %></strong>
22
+ <%= CGI.escapeHTML(e.message) %>
23
+ <br /><br />
24
+ <% e.backtrace.each do |line| %>
25
+ <%= line %><br />
26
+ <% end %>
27
+ </td>
28
+ </tr>
29
+ <% end %>
30
+ <% end %>
31
+ </table>
32
+
33
+
@@ -5,7 +5,6 @@ module Redcar
5
5
  include Redcar::Document::Mirror
6
6
 
7
7
  POINTERS = {
8
- :output => "",
9
8
  :result => "=> ",
10
9
  :error => "x> "
11
10
  }
@@ -32,9 +31,9 @@ module Redcar
32
31
  results = entry.last
33
32
  str << prompt.to_s + command.to_s + "\n"
34
33
  results.each do |result|
35
- output, entry_type = *result
34
+ text, entry_type = *result
36
35
  str << POINTERS[entry_type]
37
- output.scan(/.{1,80}/).each do |output_line|
36
+ text.scan(/.{1,80}/).each do |output_line|
38
37
  str << output_line + "\n"
39
38
  end
40
39
  end
@@ -58,7 +57,6 @@ module Redcar
58
57
  rescue Object => e
59
58
  result, entry_type = format_error(e), :error
60
59
  end
61
- @history.last[1] << [@instance.output, :output] if @instance.output
62
60
  @history.last[1] << [result, entry_type]
63
61
  notify_listeners(:change)
64
62
  end
@@ -103,17 +101,7 @@ module Redcar
103
101
  end
104
102
 
105
103
  def execute(command)
106
- orig_stdout = $stdout
107
- stdout_handler = StringIO.new
108
- $stdout = stdout_handler
109
- begin
110
- result = eval(command, @binding)
111
- ensure
112
- $stdout.rewind
113
- @output = $stdout.read
114
- $stdout = orig_stdout
115
- end
116
- result
104
+ eval(command, @binding)
117
105
  end
118
106
  end
119
107
  end
@@ -157,14 +157,14 @@ RUBY
157
157
  describe "when executing" do
158
158
  it "should execute inside a main object" do
159
159
  @mirror.commit(prompt + ">> self")
160
- @mirror.history.last.should == ["self", [["", :output], ["main", :result]] ]
160
+ @mirror.history.last.should == ["self", [["main", :result]] ]
161
161
  end
162
162
 
163
163
  it "should persist local variables" do
164
164
  sent = prompt + ">> a = 13"
165
165
  @mirror.commit(sent)
166
166
  @mirror.commit(sent + "\n>> a")
167
- @mirror.history.last.should == ["a", [["", :output], ["13", :result]] ]
167
+ @mirror.history.last.should == ["a", [["13", :result]] ]
168
168
  end
169
169
  end
170
170
  end
@@ -19,7 +19,6 @@ module Redcar
19
19
  registry = Registry.new
20
20
  s = Time.now
21
21
  tm_snippets = Textmate.all_snippets
22
- puts "took #{Time.now - s}s to load snippets"
23
22
  registry.add(tm_snippets)
24
23
  registry
25
24
  end
@@ -104,7 +104,7 @@ module Redcar
104
104
  @stop_id = 0
105
105
 
106
106
  @env = Textmate::Environment.new
107
-
107
+ fix_line_endings
108
108
  # Not sure what to do about backticks. Currently they don't work in Redcar.
109
109
  #@content = execute_backticks(@content, bundle ? bundle.dir : nil)
110
110
  selection_range = document.selection_range
@@ -130,6 +130,12 @@ module Redcar
130
130
  line[/^(\s*)([^\s]|$)/, 1].chomp
131
131
  end
132
132
 
133
+ def fix_line_endings
134
+ if document.delim != "\n" # textmate uses "\n" everywhere
135
+ @content = @content.gsub("\n", document.delim)
136
+ end
137
+ end
138
+
133
139
  def compute_tab_stop(line, tab_width, soft_tabs)
134
140
  re = / {0,#{tab_width - 1}}\t|#{" "*tab_width}/
135
141
  sc = StringScanner.new(leading_whitespace(line))
@@ -0,0 +1,28 @@
1
+
2
+ require 'erb'
3
+ require 'cgi'
4
+
5
+ module Redcar
6
+ class TaskManager
7
+ class OpenCommand < Redcar::Command
8
+
9
+ def execute
10
+ controller = Controller.new
11
+ tab = win.new_tab(HtmlTab)
12
+ tab.html_view.controller = controller
13
+ tab.focus
14
+ end
15
+ end
16
+
17
+ class Controller
18
+ def title
19
+ "Tasks"
20
+ end
21
+
22
+ def index
23
+ rhtml = ERB.new(File.read(File.join(File.dirname(__FILE__), "..", "views", "index.html.erb")))
24
+ rhtml.result(binding)
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,11 @@
1
+
2
+ Plugin.define do
3
+ name "task_manager"
4
+ version "0.3.5"
5
+
6
+ object "Redcar::TaskManager"
7
+ file "lib", "task_manager"
8
+
9
+ dependencies "core", ">0",
10
+ "HTML View", ">=0.3.2"
11
+ end
@@ -0,0 +1,67 @@
1
+ <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets redcar.css))) %>
2
+ <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
3
+
4
+ <h3>Task Manager</h3>
5
+
6
+ <a href="controller/index">Refresh</a>
7
+
8
+ <h4>Pending</h4>
9
+
10
+ <table>
11
+ <tr>
12
+ <th>Enqueued</th>
13
+ <th>Description</th>
14
+ </tr>
15
+ <% Redcar.app.task_queue.pending.each do |task| %>
16
+ <tr>
17
+ <td><%= task.enqueue_time.strftime("%X") %></td>
18
+ <td><%= CGI.escapeHTML(task.description || task.class.to_s) %></td>
19
+ </tr>
20
+ <% end %>
21
+ </table>
22
+
23
+ <h4>In Process</h4>
24
+
25
+ <table>
26
+ <tr>
27
+ <th>Started</th>
28
+ <th>Description</th>
29
+ </tr>
30
+ <% if task = Redcar.app.task_queue.in_process %>
31
+ <tr>
32
+ <td><%= task.start_time.strftime("%X") %></td>
33
+ <td><%= CGI.escapeHTML(task.description || task.class.to_s) %></td>
34
+ </tr>
35
+ <% end %>
36
+ </table>
37
+
38
+ <h4>Completed</h4>
39
+
40
+ <table>
41
+ <tr>
42
+ <th>Completed</th>
43
+ <th>Description</th>
44
+ <th>Duration</th>
45
+ </tr>
46
+ <% Redcar.app.task_queue.completed.reverse.each do |task| %>
47
+ <tr class="<%= "error" if task.error %>">
48
+ <td><%= task.completed_time.strftime("%X") %></td>
49
+ <td><%= CGI.escapeHTML(task.description || task.class.to_s) %></td>
50
+ <td><%= task.completed_time - task.start_time %></td>
51
+ </tr>
52
+ <% if e = task.error %>
53
+ <tr>
54
+ <td colspan="3">
55
+ <strong><%= e.class %></strong>
56
+ <%= CGI.escapeHTML(e.message) %>
57
+ <br /><br />
58
+ <% e.backtrace.each do |line| %>
59
+ <%= line %><br />
60
+ <% end %>
61
+ </td>
62
+ </tr>
63
+ <% end %>
64
+ <% end %>
65
+ </table>
66
+
67
+
@@ -11,25 +11,6 @@ module Redcar
11
11
  Dir[File.join(Redcar.root, "textmate", "Bundles", "*")]
12
12
  end
13
13
 
14
- def self.attach_menus(builder)
15
- s = Time.now
16
- @menus ||= begin
17
- Menu::Builder.build do |a|
18
- all_bundles.sort_by {|b| (b.name||"").downcase}.each do |bundle|
19
- bundle.build_menu(a)
20
- end
21
- end
22
- end
23
- @menus.entries.each {|i| builder.append(i) }
24
- puts "took #{Time.now - s}s to attach bundle menus"
25
- end
26
-
27
- #def self.attach_keybindings(builder)
28
- # s = Time.now
29
- # all_bundles
30
- # puts "took #{Time.now - s}s to attach bundle menus"
31
- #end
32
-
33
14
  def self.uuid_hash
34
15
  @uuid_hash ||= begin
35
16
  h = {}
@@ -42,6 +23,17 @@ module Redcar
42
23
  end
43
24
  end
44
25
 
26
+ def self.attach_menus(builder)
27
+ #@menus ||= begin
28
+ # Menu::Builder.build do |a|
29
+ # all_bundles.sort_by {|b| (b.name||"").downcase}.each do |bundle|
30
+ # bundle.build_menu(a)
31
+ # end
32
+ # end
33
+ #end
34
+ #@menus.entries.each {|i| builder.append(i) }
35
+ end
36
+
45
37
  def self.all_bundles
46
38
  @all_bundles ||= begin
47
39
  cache = PersistentCache.new("textmate_bundles")
@@ -63,8 +55,12 @@ module Redcar
63
55
  end
64
56
  end
65
57
 
66
- # Translates a Textmate key equivalent into a Redcar
67
- # keybinding.
58
+ def self.settings(type=nil)
59
+ @all_settings_by_type ||= {}
60
+ @all_settings_by_type[type] ||= all_settings.select {|s| s.is_a?(type) }
61
+ end
62
+
63
+ # Translates a Textmate key equivalent into a Redcar keybinding.
68
64
  def self.translate_key_equivalent(keyeq, name=nil)
69
65
  if keyeq
70
66
  key_str = keyeq[-1..-1]
@@ -1,6 +1,4 @@
1
1
 
2
- require 'rexml/document'
3
-
4
2
  module Redcar
5
3
  # An Apple Plist parser.
6
4
  class Plist
@@ -14,6 +12,7 @@ module Redcar
14
12
  end
15
13
 
16
14
  def self.plist_from_xml(xml_string) # :nodoc:
15
+ require 'rexml/document'
17
16
  xml = REXML::Document.new(xml_string)
18
17
  plist_from_xml1(xml.root.elements.first)
19
18
  end
@@ -43,7 +43,7 @@ module Redcar
43
43
  end
44
44
 
45
45
  class Setting
46
- attr_reader :scope
46
+ attr_reader :scope, :plist
47
47
 
48
48
  def initialize(scope, plist)
49
49
  @scope = scope
@@ -67,15 +67,19 @@ module Redcar
67
67
  end
68
68
 
69
69
  class IncreaseIndentPatternSetting < Setting
70
+ def pattern; @plist; end
70
71
  end
71
72
 
72
73
  class DecreaseIndentPatternSetting < Setting
74
+ def pattern; @plist; end
73
75
  end
74
76
 
75
77
  class UnIndentedLinePatternSetting < Setting
78
+ def pattern; @plist; end
76
79
  end
77
80
 
78
81
  class IndentNextLinePatternSetting < Setting
82
+ def pattern; @plist; end
79
83
  end
80
84
 
81
85
  class ShowInSymbolListSetting < Setting
@@ -35,7 +35,12 @@ module Redcar
35
35
 
36
36
  def to_menu_string
37
37
  r = name.clone
38
- r << " (#{tab_trigger}↦)" if tab_trigger
38
+ # It doesn't seem to be possible to set accelerator text on OSX.
39
+ if Redcar.platform == :osx
40
+ r << " (#{tab_trigger}↦)" if tab_trigger
41
+ else
42
+ r << "\t#{tab_trigger}" if tab_trigger
43
+ end
39
44
  r
40
45
  end
41
46
  end
@@ -36,7 +36,6 @@ module Redcar
36
36
  puts e.message
37
37
  puts e.backtrace
38
38
  end
39
- puts "tree refresh took #{Time.now - s} seconds"
40
39
  end
41
40
  end
42
41
 
@@ -50,27 +49,22 @@ module Redcar
50
49
 
51
50
  class TreeListener
52
51
  def tree_collapsed(e)
53
- p [:collapsed, e]
54
52
  end
55
53
 
56
54
  def tree_expanded(e)
57
- p [:expanded, e]
58
55
  end
59
56
  end
60
57
 
61
58
  class SelectionListener
62
59
  def widget_default_selected(e)
63
- p [:def_selected, e]
64
60
  end
65
61
 
66
62
  def widget_selected(e)
67
- p [:selected, e]
68
63
  end
69
64
  end
70
65
 
71
66
  class DoubleClickListener
72
67
  def double_click(e)
73
- p [:double_click, e]
74
68
  end
75
69
  end
76
70
 
@@ -5,7 +5,7 @@
5
5
  <key>name</key>
6
6
  <string>Comments</string>
7
7
  <key>scope</key>
8
- <string>text.cucumber.feature</string>
8
+ <string>text.gherkin.feature</string>
9
9
  <key>settings</key>
10
10
  <dict>
11
11
  <key>shellVariables</key>
@@ -0,0 +1,30 @@
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>name</key>
6
+ <string>Gherkin Completions</string>
7
+ <key>scope</key>
8
+ <string>text.gherkin.feature</string>
9
+ <key>settings</key>
10
+ <dict>
11
+ <key>completions</key>
12
+ <array>
13
+ <string>As a</string>
14
+ <string>As an</string>
15
+ <string>I want to</string>
16
+ <string>So that</string>
17
+ <string>Story:</string>
18
+ <string>Scenario:</string>
19
+ <string>Scenario Outline:</string>
20
+ <string>Given</string>
21
+ <string>Then</string>
22
+ <string>When</string>
23
+ <string>And</string>
24
+ <string>But</string>
25
+ </array>
26
+ </dict>
27
+ <key>uuid</key>
28
+ <string>8B547854-6A6A-4E45-B51E-9324F0E9D364</string>
29
+ </dict>
30
+ </plist>