redcar-dev 0.12.17dev → 0.12.18dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. data/CHANGES +4 -2
  2. data/README.md +5 -41
  3. data/Rakefile +3 -35
  4. data/lib/redcar.rb +19 -17
  5. data/lib/redcar/runner.rb +1 -7
  6. data/lib/redcar_quick_start.rb +5 -5
  7. data/plugins/application/features/main_menu.feature +1 -1
  8. data/plugins/application/features/step_definitions/command_steps.rb +8 -7
  9. data/plugins/application/features/step_definitions/filter_list_dialog_steps.rb +25 -10
  10. data/plugins/application/features/step_definitions/key_steps.rb +6 -4
  11. data/plugins/application/features/step_definitions/menu_steps.rb +27 -26
  12. data/plugins/application/features/step_definitions/speedbar_steps.rb +28 -16
  13. data/plugins/application/features/step_definitions/tree_steps.rb +88 -64
  14. data/plugins/application/features/step_definitions/window_steps.rb +14 -10
  15. data/plugins/application/features/support/env.rb +85 -83
  16. data/plugins/application/spec/application/application_spec.rb +1 -1
  17. data/plugins/application/spec/application/clipboard_spec.rb +1 -1
  18. data/plugins/application/spec/application/command/executor_spec.rb +1 -1
  19. data/plugins/application/spec/application/command/history_spec.rb +1 -1
  20. data/plugins/application/spec/application/command_spec.rb +1 -1
  21. data/plugins/application/spec/application/keymap/builder_spec.rb +1 -1
  22. data/plugins/application/spec/application/menu/builder_spec.rb +1 -1
  23. data/plugins/application/spec/application/menu/menu_item_spec.rb +1 -1
  24. data/plugins/application/spec/application/menu_spec.rb +1 -1
  25. data/plugins/application/spec/application/navigation_history_spec.rb +2 -0
  26. data/plugins/application/spec/application/notebook_spec.rb +1 -1
  27. data/plugins/application/spec/application/sensitive_spec.rb +1 -1
  28. data/plugins/application/spec/application/speedbar_spec.rb +1 -1
  29. data/plugins/application/spec/application/treebook_spec.rb +1 -1
  30. data/plugins/application/spec/application/window_spec.rb +1 -1
  31. data/plugins/application/spec/spec_helper.rb +4 -6
  32. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +1 -1
  33. data/plugins/application_swt/lib/application_swt/gradient.rb +15 -5
  34. data/plugins/application_swt/lib/application_swt/window.rb +1 -1
  35. data/plugins/application_swt/spec/application_swt/gradient_spec.rb +13 -14
  36. data/plugins/application_swt/spec/application_swt/menu/binding_translator_spec.rb +1 -1
  37. data/plugins/application_swt/spec/application_swt/menu_spec.rb +1 -1
  38. data/plugins/application_swt/spec/spec_helper.rb +1 -19
  39. data/plugins/auto_completer/features/auto_complete.feature +7 -7
  40. data/plugins/auto_completer/features/step_definitions/auto_complete_steps.rb +3 -1
  41. data/plugins/auto_completer/features/step_definitions/dependency_steps.rb +0 -0
  42. data/plugins/auto_indenter/features/java_style_indentation.feature +5 -3
  43. data/plugins/auto_indenter/features/ruby_style_indentation.feature +13 -13
  44. data/plugins/auto_indenter/features/step_definitions/indentation_steps.rb +3 -1
  45. data/plugins/auto_indenter/spec/auto_indenter/analyzer_spec.rb +1 -1
  46. data/plugins/auto_indenter/spec/spec_helper.rb +1 -5
  47. data/plugins/auto_pairer/features/auto_pairer.feature +1 -1
  48. data/plugins/comment/features/line_comment.feature +31 -26
  49. data/plugins/comment/features/selection_comment.feature +1 -1
  50. data/plugins/comment/features/step_definitions/comment_steps.rb +6 -2
  51. data/plugins/comment/vendor/comment_lib.json +2 -0
  52. data/plugins/core/lib/core.rb +26 -0
  53. data/plugins/core/spec/core/base_storage_spec.rb +1 -1
  54. data/plugins/core/spec/core/gui_spec.rb +1 -1
  55. data/plugins/core/spec/core/observable_spec.rb +2 -1
  56. data/plugins/core/spec/core/persistent_cache_spec.rb +1 -1
  57. data/plugins/core/spec/core/shared_storage_spec.rb +1 -1
  58. data/plugins/core/spec/core/storage_spec.rb +1 -1
  59. data/plugins/core/spec/core/task_queue_spec.rb +1 -3
  60. data/plugins/core/spec/spec_helper.rb +1 -4
  61. data/plugins/declarations/spec/declarations/file_spec.rb +1 -1
  62. data/plugins/declarations/spec/spec_helper.rb +1 -5
  63. data/plugins/document_search/features/find.feature +39 -39
  64. data/plugins/document_search/features/step_definitions/find_steps.rb +6 -2
  65. data/plugins/edit_view/features/align_assignment.feature +6 -82
  66. data/plugins/edit_view/features/case_change.feature +22 -22
  67. data/plugins/edit_view/features/cursor_navigation.feature +2 -2
  68. data/plugins/edit_view/features/cut_and_paste.feature +9 -9
  69. data/plugins/edit_view/features/indentation_commands.feature +8 -8
  70. data/plugins/edit_view/features/line_delimiter.feature +7 -7
  71. data/plugins/edit_view/features/multiple_windows.feature +48 -48
  72. data/plugins/edit_view/features/step_definitions/dependency_steps.rb +0 -0
  73. data/plugins/edit_view/features/step_definitions/editing_steps.rb +237 -127
  74. data/plugins/edit_view/features/step_definitions/grammar_steps.rb +5 -1
  75. data/plugins/edit_view/features/step_definitions/notebook_steps.rb +38 -24
  76. data/plugins/edit_view/features/step_definitions/tab_steps.rb +83 -45
  77. data/plugins/edit_view/features/step_definitions/window_steps.rb +75 -54
  78. data/plugins/edit_view/features/support/env.rb +4 -23
  79. data/plugins/edit_view/lib/edit_view/commands/align_assignment_command.rb +29 -30
  80. data/plugins/edit_view/lib/edit_view/document.rb +23 -0
  81. data/plugins/edit_view/spec/edit_view/commands/align_assignment_command_spec.rb +83 -0
  82. data/plugins/edit_view/spec/edit_view/document/indentation_spec.rb +1 -1
  83. data/plugins/edit_view/spec/edit_view/document_spec.rb +1 -1
  84. data/plugins/edit_view/spec/spec_helper.rb +1 -4
  85. data/plugins/edit_view_swt/spec/edit_view_swt/word_movement_spec.rb +1 -1
  86. data/plugins/edit_view_swt/spec/spec_helper.rb +1 -4
  87. data/plugins/html_view/features/fixtures/sample.html +1 -1
  88. data/plugins/html_view/features/step_definitions/html_view_steps.rb +40 -39
  89. data/plugins/java/features/syntax_check_java.feature +18 -16
  90. data/plugins/line_tools/features/step_definitions/line_tools_steps.rb +18 -6
  91. data/plugins/macros/features/block_selection_in_macros.feature +47 -47
  92. data/plugins/macros/features/step_definitions/macro_steps.rb +9 -3
  93. data/plugins/macros/features/step_definitions/prediction_steps.rb +6 -2
  94. data/plugins/macros/plugin.rb +2 -1
  95. data/plugins/macros/spec/macros/predictive/sequence_finder_spec.rb +1 -1
  96. data/plugins/macros/spec/spec_helper.rb +1 -6
  97. data/plugins/outline_view/features/outline_view.feature +5 -5
  98. data/plugins/outline_view/features/step_definitions/outline_steps.rb +29 -17
  99. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +1 -1
  100. data/plugins/project/features/close_directory_tree.feature +0 -12
  101. data/plugins/project/features/open_directory_tree.feature +1 -2
  102. data/plugins/project/features/step_definitions/directory_steps.rb +13 -5
  103. data/plugins/project/features/step_definitions/file_steps.rb +23 -9
  104. data/plugins/project/features/step_definitions/find_file_steps.rb +6 -2
  105. data/plugins/project/features/step_definitions/project_tree_steps.rb +6 -2
  106. data/plugins/project/features/watch_for_modified_files.feature +1 -1
  107. data/plugins/project/spec/project/adapters/remote_protocols/ftp_spec.rb +1 -1
  108. data/plugins/project/spec/project/adapters/remote_protocols/sftp_spec.rb +1 -1
  109. data/plugins/project/spec/project/adapters/remote_spec.rb +1 -1
  110. data/plugins/project/spec/project/dir_mirror_spec.rb +1 -1
  111. data/plugins/project/spec/project/file_list_spec.rb +1 -1
  112. data/plugins/project/spec/project/file_mirror_spec.rb +2 -1
  113. data/plugins/project/spec/spec_helper.rb +1 -4
  114. data/plugins/project_search/spec/project_search/binary_data_detector_spec.rb +1 -1
  115. data/plugins/project_search/spec/project_search/word_search_spec.rb +1 -1
  116. data/plugins/project_search/spec/spec_helper.rb +1 -4
  117. data/plugins/{application → redcar}/features/navigation_history.feature +8 -8
  118. data/plugins/redcar/features/step_definitions/font_steps.rb +9 -5
  119. data/plugins/redcar/redcar.rb +0 -26
  120. data/plugins/repl/features/step_definitions/repl_steps.rb +15 -5
  121. data/plugins/repl/plugin.rb +1 -1
  122. data/plugins/repl/spec/repl/repl_mirror_spec.rb +1 -1
  123. data/plugins/repl/spec/spec_helper.rb +1 -4
  124. data/plugins/ruby/spec/ruby/repl_mirror_spec.rb +1 -1
  125. data/plugins/ruby/spec/spec_helper.rb +1 -5
  126. data/plugins/runnables/features/parameter_input.feature +43 -43
  127. data/plugins/runnables/features/step_definitions/runnable_steps.rb +9 -3
  128. data/plugins/runnables/plugin.rb +2 -2
  129. data/plugins/runnables/spec/runnables/output_processor_spec.rb +1 -1
  130. data/plugins/runnables/spec/spec_helper.rb +1 -5
  131. data/plugins/scm_svn/features/add_and_commit.feature +1 -0
  132. data/plugins/scm_svn/features/checkout.feature +1 -0
  133. data/plugins/scm_svn/features/edit_and_index.feature +1 -0
  134. data/plugins/scm_svn/features/ignore_files.feature +1 -0
  135. data/plugins/scm_svn/features/merge.feature +1 -0
  136. data/plugins/scm_svn/features/resolve_conflict.feature +1 -0
  137. data/plugins/scm_svn/features/revert_and_delete.feature +1 -0
  138. data/plugins/scm_svn/features/step_definitions/branch_and_merge_steps.rb +14 -9
  139. data/plugins/scm_svn/features/support/env.rb +4 -4
  140. data/plugins/scm_svn/features/switch_branches.feature +1 -0
  141. data/plugins/scm_svn/features/update.feature +1 -0
  142. data/plugins/strip_trailing_spaces/features/strip_trailing_spaces.feature +4 -4
  143. data/plugins/test_runner/plugin.rb +3 -1
  144. data/plugins/test_runner/spec/run_test_command_spec.rb +58 -50
  145. data/plugins/test_runner/spec/spec_helper.rb +1 -5
  146. data/plugins/textmate/features/step_definitions/tree_steps.rb +2 -0
  147. data/plugins/todo_list/features/todo_list.feature +1 -1
  148. data/plugins/todo_list/spec/spec_helper.rb +1 -4
  149. data/plugins/todo_list/spec/todo_list/file_parser_spec.rb +1 -1
  150. data/plugins/tree_view_swt/lib/tree_view_swt.rb +2 -1
  151. data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +1 -1
  152. metadata +48 -48
  153. data/lib/redcar/installer.rb +0 -178
  154. data/plugins/key_bindings/spec/spec_helper.rb +0 -5
  155. data/plugins/scm/spec/spec_helper.rb +0 -5
@@ -1,5 +1 @@
1
- $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
-
3
- require 'redcar'
4
- Redcar.environment = :test
5
- Redcar.load_unthreaded
1
+ Redcar.plugin_manager.load("auto_indenter")
@@ -39,7 +39,7 @@ Feature: Automatically insert paired characters
39
39
  Scenario: Wrap selected text
40
40
  When I open a new edit tab
41
41
  And I type "Boris"
42
- And I select from 0 to 5
42
+ And I select from (0,0) to (0,5)
43
43
  And I type "("
44
44
  Then the contents should be "(Boris)<c>"
45
45
 
@@ -6,7 +6,7 @@ Feature: Commenting lines by prefixing a comment string
6
6
  Scenario: Commenting a single line
7
7
  When I replace the contents with "A piece of code"
8
8
  And I switch the language to "C"
9
- And I move the cursor to 5
9
+ And I move the cursor to (0,5)
10
10
  And I toggle comment lines
11
11
  Then the contents should be "// A pie<c>ce of code"
12
12
  When I toggle comment lines
@@ -15,14 +15,14 @@ Feature: Commenting lines by prefixing a comment string
15
15
  Scenario: Uncommenting a single line
16
16
  When I replace the contents with "# A piece of code"
17
17
  And I switch the language to "Ruby"
18
- And I move the cursor to 5
18
+ And I move the cursor to (0,5)
19
19
  And I toggle comment lines
20
20
  Then the contents should be "A p<c>iece of code"
21
21
 
22
22
  Scenario: Commenting a single line among many
23
23
  When I replace the contents with "foo\nbar\nbaz"
24
24
  And I switch the language to "Ruby"
25
- And I move the cursor to 4
25
+ And I move the cursor to (0,4)
26
26
  And I toggle comment lines
27
27
  Then the contents should be "foo\n<c># bar\nbaz"
28
28
  When I toggle comment lines
@@ -31,14 +31,14 @@ Feature: Commenting lines by prefixing a comment string
31
31
  Scenario: Uncommenting a single line that doesn't have the space
32
32
  When I replace the contents with "#A piece of code"
33
33
  And I switch the language to "Ruby"
34
- And I move the cursor to 5
34
+ And I move the cursor to (0,5)
35
35
  And I toggle comment lines
36
36
  Then the contents should be "A piece of code"
37
37
 
38
38
  Scenario: Commenting several lines
39
39
  When I replace the contents with "Two pieces\nof code"
40
40
  And I switch the language to "Ruby"
41
- And I select from 0 to 13
41
+ And I select from (0,0) to (1,2)
42
42
  And I toggle comment lines
43
43
  Then the contents should be "<s># Two pieces\n# of<c> code"
44
44
  When I toggle comment lines
@@ -47,14 +47,14 @@ Feature: Commenting lines by prefixing a comment string
47
47
  Scenario: Uncommenting several lines, not all of them have the space
48
48
  When I replace the contents with "# Two pieces\n#of code"
49
49
  And I switch the language to "Ruby"
50
- And I select from 0 to 16
50
+ And I select from (0,0) to (1,3)
51
51
  And I toggle comment lines
52
52
  Then the contents should be "<s>Two pieces\nof<c> code"
53
53
 
54
54
  Scenario: Commenting when not all the lines begin with the comment symbol
55
55
  When I replace the contents with "# foo\n# bar\nbaz"
56
56
  And I switch the language to "Ruby"
57
- And I select from 0 to 15
57
+ And I select from (0,0) to (2,3)
58
58
  And I toggle comment lines
59
59
  Then the contents should be "<s># # foo\n# # bar\n# baz<c>"
60
60
  When I toggle comment lines
@@ -63,7 +63,7 @@ Feature: Commenting lines by prefixing a comment string
63
63
  Scenario: Commenting when not all the lines begin with the comment symbol, reversed
64
64
  When I replace the contents with "# foo\n# bar\nbaz"
65
65
  And I switch the language to "Ruby"
66
- And I select from 15 to 0
66
+ And I select from (2,3) to (0,0)
67
67
  And I toggle comment lines
68
68
  Then the contents should be "<c># # foo\n# # bar\n# baz<s>"
69
69
  When I toggle comment lines
@@ -72,7 +72,7 @@ Feature: Commenting lines by prefixing a comment string
72
72
  Scenario: Commenting a single line with the cursor on the next line
73
73
  When I replace the contents with "Two pieces\nof code"
74
74
  And I switch the language to "Ruby"
75
- And I select from 0 to 11
75
+ And I select from (0,0) to (1,0)
76
76
  And I toggle comment lines
77
77
  Then the contents should be "<s># Two pieces\n<c>of code"
78
78
  When I toggle comment lines
@@ -81,7 +81,7 @@ Feature: Commenting lines by prefixing a comment string
81
81
  Scenario: Commenting a single line with the cursor on the next line, reversed
82
82
  When I replace the contents with "Two pieces\nof code"
83
83
  And I switch the language to "Ruby"
84
- And I select from 11 to 0
84
+ And I select from (1,0) to (0,0)
85
85
  And I toggle comment lines
86
86
  Then the contents should be "<c># Two pieces\n<s>of code"
87
87
  When I toggle comment lines
@@ -90,7 +90,7 @@ Feature: Commenting lines by prefixing a comment string
90
90
  Scenario: Commenting a single line with the cursor and selection point on the same line
91
91
  When I replace the contents with "Two pieces\nof code"
92
92
  And I switch the language to "Ruby"
93
- And I select from 3 to 0
93
+ And I select from (0,3) to (0,0)
94
94
  And I toggle comment lines
95
95
  Then the contents should be "<c># Two<s> pieces\nof code"
96
96
  When I toggle comment lines
@@ -99,7 +99,7 @@ Feature: Commenting lines by prefixing a comment string
99
99
  Scenario: Inserting a single space after comments when a line has no indentation
100
100
  When I replace the contents with "A few\nlines\nof unindented\ncode"
101
101
  And I switch the language to "Ruby"
102
- And I select from 2 to 27
102
+ And I select from (0,2) to (3,1)
103
103
  And I toggle comment lines
104
104
  Then the contents should be "A <s># few\n# lines\n# of unindented\n# c<c>ode"
105
105
  When I toggle comment lines
@@ -116,7 +116,7 @@ Feature: Commenting lines by prefixing a comment string
116
116
  Scenario: Commenting several lines, not from the start of one of them
117
117
  When I replace the contents with "Two pieces\nof code"
118
118
  And I switch the language to "Ruby"
119
- And I select from 2 to 13
119
+ And I select from (0,2) to (1,2)
120
120
  And I toggle comment lines
121
121
  Then the contents should be "Tw<s># o pieces\n# of<c> code"
122
122
  When I toggle comment lines
@@ -125,7 +125,7 @@ Feature: Commenting lines by prefixing a comment string
125
125
  Scenario: Commenting several lines, not from the start of one of them, reversed
126
126
  When I replace the contents with "Two pieces\nof code"
127
127
  And I switch the language to "Ruby"
128
- And I select from 13 to 2
128
+ And I select from (1,2) to (0,2)
129
129
  And I toggle comment lines
130
130
  Then the contents should be "Tw<c># o pieces\n# of<s> code"
131
131
  When I toggle comment lines
@@ -134,7 +134,7 @@ Feature: Commenting lines by prefixing a comment string
134
134
  Scenario: Commenting several lines, not from the start of one of them
135
135
  When I replace the contents with " foo\n bar"
136
136
  And I switch the language to "Ruby"
137
- And I select from 2 to 15
137
+ And I select from (0,2) to (1,7)
138
138
  And I toggle comment lines
139
139
  Then the contents should be " <s> # foo\n # bar<c>"
140
140
  When I toggle comment lines
@@ -143,16 +143,17 @@ Feature: Commenting lines by prefixing a comment string
143
143
  Scenario: Commenting several lines, with mismatched indentation, beginning in the start
144
144
  When I replace the contents with " def foo\n dfo\n sdfj\n asdf\nasdf"
145
145
  And I switch the language to "Ruby"
146
- And I select from 0 to 40
146
+ And I select from (0,0) to (4,2)
147
147
  And I toggle comment lines
148
148
  Then the contents should be "<s># def foo\n# dfo\n# sdfj\n# asdf\n# as<c>df"
149
149
 
150
150
  Scenario: Commenting several indented lines, beginning before the text starts
151
151
  Given the content is:
152
152
  """
153
- <s> def foo
154
- dfo<c>
153
+ def foo
154
+ dfo
155
155
  """
156
+ And I select from (0,2) to (1,11)
156
157
  And I switch the language to "Ruby"
157
158
  And I toggle comment lines
158
159
  Then the content should be:
@@ -164,9 +165,10 @@ Feature: Commenting lines by prefixing a comment string
164
165
  Scenario: Commenting several indented lines, beginning before the text starts, reversed
165
166
  Given the content is:
166
167
  """
167
- <c> def foo
168
- dfo<s>
168
+ def foo
169
+ dfo
169
170
  """
171
+ And I select from (1,11) to (0,2)
170
172
  And I switch the language to "Ruby"
171
173
  And I toggle comment lines
172
174
  Then the content should be:
@@ -178,9 +180,10 @@ Feature: Commenting lines by prefixing a comment string
178
180
  Scenario: Commenting several indented lines, beginning where the text starts
179
181
  Given the content is:
180
182
  """
181
- <s>def foo
182
- dfo<c>
183
+ def foo
184
+ dfo
183
185
  """
186
+ And I select from (0,6) to (1,11)
184
187
  And I switch the language to "Ruby"
185
188
  And I toggle comment lines
186
189
  Then the content should be:
@@ -198,13 +201,14 @@ Feature: Commenting lines by prefixing a comment string
198
201
  Scenario: Commenting several indented lines, with a whitespace only line in between
199
202
  Given the content is:
200
203
  """
201
- <s>doc.compound do
204
+ doc.compound do
202
205
  all_lines_are_already_commented = true
203
206
  start_line_comment_offset = nil
204
207
  insertion_column = 1000
205
208
 
206
- <c>(start_line..end_line).each do |line|
209
+ (start_line..end_line).each do |line|
207
210
  """
211
+ And I select from (0,4) to (5,6)
208
212
  And I switch the language to "Ruby"
209
213
  And I toggle comment lines
210
214
  Then the content should be:
@@ -220,13 +224,14 @@ Feature: Commenting lines by prefixing a comment string
220
224
  Scenario: Commenting several indented lines, with a blank line in between
221
225
  Given the content is:
222
226
  """
223
- <s>doc.compound do
227
+ doc.compound do
224
228
  all_lines_are_already_commented = true
225
229
  start_line_comment_offset = nil
226
230
  insertion_column = 1000
227
231
 
228
- <c>(start_line..end_line).each do |line|
232
+ (start_line..end_line).each do |line|
229
233
  """
234
+ And I select from (0,4) to (5,6)
230
235
  And I switch the language to "Ruby"
231
236
  And I toggle comment lines
232
237
  Then the content should be:
@@ -14,7 +14,7 @@ Feature: Commenting a selected area of text
14
14
  Scenario: Commenting a selection spanning several lines
15
15
  When I replace the contents with "a piece\nof code"
16
16
  And I switch the language to "C++"
17
- And I select from 4 to 9
17
+ And I select from (0,4) to (1,1)
18
18
  And I toggle block comment
19
19
  Then I should see "a pi/*ece\no*/f code" in the edit tab
20
20
  And I toggle block comment
@@ -1,7 +1,11 @@
1
1
  When /^I toggle block comment$/ do
2
- Redcar::Comment::ToggleSelectionCommentCommand.new.run
2
+ Swt.sync_exec do
3
+ Redcar::Comment::ToggleSelectionCommentCommand.new.run
4
+ end
3
5
  end
4
6
 
5
7
  When /^I toggle comment lines$/ do
6
- Redcar::Comment::ToggleLineCommentCommand.new.run
8
+ Swt.sync_exec do
9
+ Redcar::Comment::ToggleLineCommentCommand.new.run
10
+ end
7
11
  end
@@ -4,6 +4,7 @@
4
4
  "C" : { "line_comment" : "//" , "start_block" : "/*" , "end_block" : "*/" },
5
5
  "C#" : { "line_comment" : "//" , "start_block" : "/*" , "end_block" : "*/" },
6
6
  "C++" : { "line_comment" : "//" , "start_block" : "/*" , "end_block" : "*/" },
7
+ "CSS" : { "start_block" : "/*" , "end_block" : "*/" },
7
8
  "Cucumber Plain Text Feature" : { "line_comment" : "#" },
8
9
  "Clojure" : { "line_comment" : ";" , "start_block" : "(comment", "end_block" : ")" },
9
10
  "CoffeeScript" : { "line_comment" : "#" , "start_block" : "###\n" , "end_block" : "\n###" },
@@ -30,6 +31,7 @@
30
31
  "RSpec" : { "line_comment" : "#" , "start_block" : "=begin\n", "end_block" : "\n=end" },
31
32
  "Ruby" : { "line_comment" : "#" , "start_block" : "=begin\n", "end_block" : "\n=end" },
32
33
  "Ruby on Rails" : { "line_comment" : "#" , "start_block" : "=begin\n", "end_block" : "\n=end" },
34
+ "Ruby Sass" : { "line_comment" : "//" },
33
35
  "Scala" : { "line_comment" : "//" , "start_block" : "/*" , "end_block" : "*/" },
34
36
  "Scheme" : { "line_comment" : ";" , "start_block" : "#|" , "end_block" : "|#" },
35
37
  "Shell Script (Bash)" : { "line_comment" : "#" },
@@ -38,4 +38,30 @@ module Redcar
38
38
  PersistentCache.storage_dir = File.join(Redcar.user_dir, "cache")
39
39
  end
40
40
  end
41
+
42
+ class TimeoutError < StandardError; end
43
+
44
+ def self.timeout(limit)
45
+ x = Thread.current
46
+ result = nil
47
+ y = Thread.new do
48
+ begin
49
+ result = yield
50
+ rescue Object => e
51
+ x.raise e
52
+ end
53
+ end
54
+ s = Time.now
55
+ loop do
56
+ if not y.alive?
57
+ break
58
+ elsif Time.now - s > limit
59
+ y.kill
60
+ raise Redcar::TimeoutError, "timed out after #{Time.now - s}s"
61
+ break
62
+ end
63
+ sleep 0.1
64
+ end
65
+ result
66
+ end
41
67
  end
@@ -1,5 +1,5 @@
1
1
 
2
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
+ require "spec_helper"
3
3
 
4
4
  describe Redcar::Plugin::BaseStorage do
5
5
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+ require "spec_helper"
2
2
 
3
3
  describe Redcar::Gui do
4
4
  before do
@@ -1,4 +1,5 @@
1
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
1
+
2
+ require "spec_helper"
2
3
 
3
4
  describe Redcar::Observable do
4
5
  class SeeMe
@@ -1,5 +1,5 @@
1
1
 
2
- require File.join(File.dirname(__FILE__), *%w".. .. lib core persistent_cache")
2
+ require "spec_helper"
3
3
 
4
4
  PersistentCache = Redcar::PersistentCache
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
+ require "spec_helper"
3
3
 
4
4
  describe Redcar::Plugin::SharedStorage do
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
+ require "spec_helper"
3
3
 
4
4
  describe Redcar::Plugin::Storage do
5
5
 
@@ -1,7 +1,5 @@
1
1
 
2
- require 'java'
3
-
4
- require File.join(File.dirname(__FILE__), *%w".. spec_helper")
2
+ require "spec_helper"
5
3
 
6
4
  describe Redcar::TaskQueue do
7
5
  before do
@@ -1,8 +1,5 @@
1
- $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
1
 
3
- require 'redcar'
4
- Redcar.environment = :test
5
- Redcar.load_unthreaded
2
+ Redcar.plugin_manager.load("core")
6
3
 
7
4
  class QuickTask < Redcar::Task
8
5
  def initialize(id=nil)
@@ -1,5 +1,5 @@
1
1
 
2
- require File.join(File.dirname(__FILE__), "..", "spec_helper")
2
+ require "spec_helper"
3
3
 
4
4
  module Redcar
5
5
  describe Declarations::File do
@@ -1,5 +1 @@
1
- $:.push File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
2
-
3
- require 'redcar'
4
- Redcar.environment = :test
5
- Redcar.load_unthreaded
1
+ Redcar.plugin_manager.load("declarations")
@@ -8,21 +8,21 @@ Feature: Find
8
8
 
9
9
  Scenario: Open Find speedbar
10
10
  When I replace the contents with "Foo\nBar\nBaz"
11
- And I move the cursor to 0
12
- And I open the find speedbar
11
+ And I move the cursor to (0,0)
12
+ And I select menu item "Edit|Find|Find..."
13
13
  Then I should see the find speedbar
14
14
 
15
15
  Scenario: Search for a word should select next occurrence
16
16
  When I replace the contents with "Foo\nBar\nBaz"
17
- And I move the cursor to 0
18
- And I open the find speedbar
17
+ And I move the cursor to (0,0)
18
+ And I select menu item "Edit|Find|Find..."
19
19
  And I type "Bar" into the "Find" field in the speedbar
20
20
  And I press "Next" in the speedbar
21
21
  Then the selected text should be "Bar"
22
22
 
23
23
  Scenario: Search twice should move to the next occurrence
24
24
  When I replace the contents with "Foo\nBar\nFoo"
25
- And I move the cursor to 0
25
+ And I move the cursor to (0,0)
26
26
  And I open the find speedbar
27
27
  And I type "Foo" into the "Find" field in the speedbar
28
28
  And I press "Next" in the speedbar
@@ -33,7 +33,7 @@ Feature: Find
33
33
 
34
34
  Scenario: Search for a word adjacent to cursor should select word
35
35
  When I replace the contents with "Foo\nBar\nBaz"
36
- And I move the cursor to 0
36
+ And I move the cursor to (0,0)
37
37
  And I open the find speedbar
38
38
  And I type "Foo" into the "Find" field in the speedbar
39
39
  And I press "Next" in the speedbar
@@ -41,7 +41,7 @@ Feature: Find
41
41
 
42
42
  Scenario: Search for a word should find occurrence after the cursor
43
43
  When I replace the contents with "Foo\nBar\nBaz\nFoo"
44
- And I move the cursor to 1
44
+ And I move the cursor to (0,1)
45
45
  And I open the find speedbar
46
46
  And I type "Foo" into the "Find" field in the speedbar
47
47
  And I press "Next" in the speedbar
@@ -53,7 +53,7 @@ Feature: Find
53
53
 
54
54
  Scenario: Search for a word should wrap to earlier occurrence if none left
55
55
  When I replace the contents with "Foo\nBar\nBaz"
56
- And I move the cursor to 3
56
+ And I move the cursor to (0,3)
57
57
  And I open the find speedbar
58
58
  And I type "Foo" into the "Find" field in the speedbar
59
59
  And I press "Next" in the speedbar
@@ -62,7 +62,7 @@ Feature: Find
62
62
 
63
63
  Scenario: Should start searching after the selection if the query matches exactly
64
64
  When I replace the contents with "Foobar\nBarfoo\nBazhmm\nFoobar"
65
- And I select from 0 to 6
65
+ And I select from (0,0) to (0,6)
66
66
  And I open the find speedbar
67
67
  And I type "Foobar" into the "Find" field in the speedbar
68
68
  And I press "Next" in the speedbar
@@ -71,7 +71,7 @@ Feature: Find
71
71
 
72
72
  Scenario: Should start search within the selection if it matches the beginning of the query
73
73
  When I replace the contents with "Foobar\nBarfoo\nBazhmm\nFoobar"
74
- And I select from 0 to 3
74
+ And I select from (0,0) to (0,3)
75
75
  And I open the find speedbar
76
76
  And I type "Foobar" into the "Find" field in the speedbar
77
77
  And I press "Next" in the speedbar
@@ -80,7 +80,7 @@ Feature: Find
80
80
 
81
81
  Scenario: Should start search within the selection if the query matches partially
82
82
  When I replace the contents with "Foobar\nBarfoo\nBazhmm\nFoobar"
83
- And I select from 0 to 6
83
+ And I select from (0,0) to (0,6)
84
84
  And I open the find speedbar
85
85
  And I type "Foo" into the "Find" field in the speedbar
86
86
  And I press "Next" in the speedbar
@@ -89,7 +89,7 @@ Feature: Find
89
89
 
90
90
  Scenario: Not thrown off by multi-byte characters
91
91
  When I replace the contents with "Benedikt Müller"
92
- And I move the cursor to 0
92
+ And I move the cursor to (0,0)
93
93
  And I open the find speedbar
94
94
  And I type "ler" into the "Find" field in the speedbar
95
95
  And I press "Next" in the speedbar
@@ -98,7 +98,7 @@ Feature: Find
98
98
 
99
99
  Scenario: Not thrown off by multi-byte characters 2
100
100
  When I replace the contents with "Benedikt Müller\n foo "
101
- And I move the cursor to 0
101
+ And I move the cursor to (0,0)
102
102
  And I open the find speedbar
103
103
  And I type "foo" into the "Find" field in the speedbar
104
104
  And I press "Next" in the speedbar
@@ -107,7 +107,7 @@ Feature: Find
107
107
 
108
108
  Scenario: Not thrown off by multi-byte characters 3
109
109
  When I replace the contents with "你好, 凯兰\nYou make my heart super happy."
110
- And I move the cursor to 0
110
+ And I move the cursor to (0,0)
111
111
  And I open the find speedbar
112
112
  And I type "you" into the "Find" field in the speedbar
113
113
  And I press "Next" in the speedbar
@@ -116,7 +116,7 @@ Feature: Find
116
116
 
117
117
  Scenario: Handles repeated search across by multi-byte characters
118
118
  When I replace the contents with "Foo\n你好, 凯兰\nFoo\nBar\nFoo\nBaz"
119
- And I move the cursor to 0
119
+ And I move the cursor to (0,0)
120
120
  And I open the find speedbar
121
121
  And I type "foo" into the "Find" field in the speedbar
122
122
  And I press "Next" in the speedbar
@@ -137,7 +137,7 @@ Feature: Find
137
137
 
138
138
  Scenario: Should select multi-byte characters
139
139
  When I replace the contents with "Benedikt Müller"
140
- And I move the cursor to 0
140
+ And I move the cursor to (0,0)
141
141
  And I open the find speedbar
142
142
  And I type "mül" into the "Find" field in the speedbar
143
143
  And I press "Next" in the speedbar
@@ -146,7 +146,7 @@ Feature: Find
146
146
 
147
147
  Scenario: Should select multi-byte characters
148
148
  When I replace the contents with "Benedikt Müller"
149
- And I move the cursor to 0
149
+ And I move the cursor to (0,0)
150
150
  And I open the find speedbar
151
151
  And I type "mül" into the "Find" field in the speedbar
152
152
  And I press "Next" in the speedbar
@@ -155,7 +155,7 @@ Feature: Find
155
155
 
156
156
  Scenario: Should select multi-byte characters 2
157
157
  When I replace the contents with "你好, 凯兰\nYou make my heart super happy."
158
- And I move the cursor to 0
158
+ And I move the cursor to (0,0)
159
159
  And I open the find speedbar
160
160
  And I type "凯兰" into the "Find" field in the speedbar
161
161
  And I press "Next" in the speedbar
@@ -164,7 +164,7 @@ Feature: Find
164
164
 
165
165
  Scenario: Doesn't search for a regex
166
166
  When I replace the contents with "Foo\nBar\nBaz"
167
- And I move the cursor to 0
167
+ And I move the cursor to (0,0)
168
168
  And I open the find speedbar
169
169
  And I type "Ba." into the "Find" field in the speedbar
170
170
  And I press "Next" in the speedbar
@@ -172,7 +172,7 @@ Feature: Find
172
172
 
173
173
  Scenario: Search for a regex
174
174
  When I replace the contents with "Foo\nBar\nBaz"
175
- And I move the cursor to 0
175
+ And I move the cursor to (0,0)
176
176
  And I open the find speedbar
177
177
  And I type "Ba." into the "Find" field in the speedbar
178
178
  And I press "Next" in the speedbar
@@ -185,7 +185,7 @@ Feature: Find
185
185
 
186
186
  Scenario: Should not match case by default
187
187
  When I replace the contents with "Foo\nBar\nBaz"
188
- And I move the cursor to 0
188
+ And I move the cursor to (0,0)
189
189
  And I open the find speedbar
190
190
  And I type "foo" into the "Find" field in the speedbar
191
191
  And I press "Next" in the speedbar
@@ -193,7 +193,7 @@ Feature: Find
193
193
 
194
194
  Scenario: Should not match case with regex by default
195
195
  When I replace the contents with "Foo\nBar\nBaz"
196
- And I move the cursor to 0
196
+ And I move the cursor to (0,0)
197
197
  And I open the find speedbar
198
198
  And I type "fo." into the "Find" field in the speedbar
199
199
  And I press "Next" in the speedbar
@@ -204,36 +204,36 @@ Feature: Find
204
204
 
205
205
  Scenario: Should match case if requested
206
206
  When I replace the contents with "Foo\nBar\nBaz"
207
- And I move the cursor to 0
207
+ And I move the cursor to (0,0)
208
208
  And I open the find speedbar
209
209
  And I type "foo" into the "Find" field in the speedbar
210
210
  And I press "Next" in the speedbar
211
211
  Then the selected text should be "Foo"
212
212
  When I check "Match case" in the speedbar
213
- And I move the cursor to 0
213
+ And I move the cursor to (0,0)
214
214
  And I press "Next" in the speedbar
215
215
  Then there should not be any text selected
216
216
  When I type "Foo" into the "Find" field in the speedbar
217
- And I move the cursor to 0
217
+ And I move the cursor to (0,0)
218
218
  And I press "Next" in the speedbar
219
219
  Then the selected text should be "Foo"
220
220
 
221
221
  Scenario: Should match case if requested with regex
222
222
  When I replace the contents with "Foo\nBar\nBaz"
223
- And I move the cursor to 0
223
+ And I move the cursor to (0,0)
224
224
  And I open the find speedbar
225
225
  And I check "Regex" in the speedbar
226
226
  And I type "fo." into the "Find" field in the speedbar
227
227
  And I press "Next" in the speedbar
228
228
  Then the selected text should be "Foo"
229
229
  When I check "Match case" in the speedbar
230
- And I move the cursor to 0
230
+ And I move the cursor to (0,0)
231
231
  And I press "Next" in the speedbar
232
232
  Then there should not be any text selected
233
233
 
234
234
  Scenario: Find next with wrap around
235
235
  When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
236
- And I move the cursor to 0
236
+ And I move the cursor to (0,0)
237
237
  And I open the find speedbar
238
238
  And I type "Foo" into the "Find" field in the speedbar
239
239
  And I press "Next" in the speedbar
@@ -251,7 +251,7 @@ Feature: Find
251
251
 
252
252
  Scenario: Find next without wrap around
253
253
  When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
254
- And I move the cursor to 0
254
+ And I move the cursor to (0,0)
255
255
  And I open the find speedbar
256
256
  And I uncheck "Wrap around" in the speedbar
257
257
  And I type "foo" into the "Find" field in the speedbar
@@ -269,7 +269,7 @@ Feature: Find
269
269
 
270
270
  Scenario: Find previous with wrap around by default
271
271
  When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
272
- And I move the cursor to 18
272
+ And I move the cursor to (3,2)
273
273
  And I open the find speedbar
274
274
  And I type "foo" into the "Find" field in the speedbar
275
275
  And I press "Next" in the speedbar
@@ -287,7 +287,7 @@ Feature: Find
287
287
 
288
288
  Scenario: Find previous without wrap around
289
289
  When I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
290
- And I move the cursor to 18
290
+ And I move the cursor to (3,2)
291
291
  And I open the find speedbar
292
292
  And I uncheck "Wrap around" in the speedbar
293
293
  And I type "Foo" into the "Find" field in the speedbar
@@ -308,7 +308,7 @@ Feature: Find
308
308
  Scenario: Should scroll vertically to the match
309
309
  When I replace the contents with 100 lines of "xxx" then "Foo"
310
310
  And I scroll to the top of the document
311
- And I move the cursor to 0
311
+ And I move the cursor to (0,0)
312
312
  And I open the find speedbar
313
313
  And I type "foo" into the "Find" field in the speedbar
314
314
  And I press "Next" in the speedbar
@@ -317,7 +317,7 @@ Feature: Find
317
317
 
318
318
  Scenario: "Should scroll horizontally to the match"
319
319
  When I replace the contents with 300 "x" then "Foo"
320
- And I move the cursor to 0
320
+ And I move the cursor to (0,0)
321
321
  And I open the find speedbar
322
322
  And I type "foo" into the "Find" field in the speedbar
323
323
  And I press "Next" in the speedbar
@@ -333,8 +333,8 @@ Feature: Find
333
333
 
334
334
  Scenario: Should initialize query with the currently selected text
335
335
  When I replace the contents with "Flux\nBar\nFoo"
336
- And I move the cursor to 0
337
- And I select from 0 to 4
336
+ And I move the cursor to (0,0)
337
+ And I select from (0,0) to (0,4)
338
338
  And I open the find speedbar
339
339
  Then the "Find" field in the speedbar should have text "Flux"
340
340
 
@@ -344,7 +344,7 @@ Feature: Find
344
344
 
345
345
  Scenario: Replace and find with no initial selection
346
346
  When I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
347
- And I move the cursor to 0
347
+ And I move the cursor to (0,0)
348
348
  And I open the find speedbar
349
349
  And I type "Rab" into the "Find" field in the speedbar
350
350
  And I type "RABBIT" into the "Replace" field in the speedbar
@@ -464,7 +464,7 @@ Feature: Find
464
464
 
465
465
  Scenario: Replace all replaces one
466
466
  When I replace the contents with "Foo\nBar\nBaz"
467
- And I move the cursor to 0
467
+ And I move the cursor to (0,0)
468
468
  And I open the find speedbar
469
469
  And I type "Bar" into the "Find" field in the speedbar
470
470
  And I type "Rab" into the "Replace" field in the speedbar
@@ -476,7 +476,7 @@ Feature: Find
476
476
 
477
477
  Scenario: Replace all replaces two
478
478
  When I replace the contents with "Foo\nBar\nBaz\nBar\nQux"
479
- And I move the cursor to 0
479
+ And I move the cursor to (0,0)
480
480
  And I open the find speedbar
481
481
  And I type "Bar" into the "Find" field in the speedbar
482
482
  And I type "Rab" into the "Replace" field in the speedbar
@@ -527,7 +527,7 @@ Feature: Find
527
527
 
528
528
  Scenario: Replace all regex with back-references
529
529
  When I replace the contents with "One fish\ntwo fish\nred fish\nblue fish"
530
- And I move the cursor to 0
530
+ And I move the cursor to (0,0)
531
531
  And I open the find speedbar
532
532
  And I type "(\w+) fish" into the "Find" field in the speedbar
533
533
  And I type "\1 car" into the "Replace" field in the speedbar