redcar 0.6.1 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +26 -0
- data/README.md +17 -31
- data/Rakefile +1 -1
- data/bin/redcar +1 -1
- data/lib/redcar.rb +8 -4
- data/lib/redcar/installer.rb +2 -1
- data/plugins/application/features/step_definitions/dialog_steps.rb +5 -0
- data/plugins/application/features/step_definitions/tree_steps.rb +1 -1
- data/plugins/application/features/support/env.rb +38 -17
- data/plugins/application/lib/application.rb +4 -0
- data/plugins/application/lib/application/command.rb +8 -2
- data/plugins/application/lib/application/command/executor.rb +37 -8
- data/plugins/application/lib/application/command/history.rb +3 -3
- data/plugins/application/lib/application/menu.rb +4 -0
- data/plugins/application/lib/application/menu/item.rb +9 -1
- data/plugins/application/lib/application/tab.rb +11 -0
- data/plugins/application/spec/application/command/executor_spec.rb +3 -3
- data/plugins/application/spec/application/command_spec.rb +24 -0
- data/plugins/application/spec/spec_helper.rb +1 -0
- data/plugins/application_swt/lib/application_swt.rb +27 -24
- data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +4 -33
- data/plugins/application_swt/lib/application_swt/dialogs/input_dialog.rb +46 -0
- data/plugins/application_swt/lib/application_swt/dialogs/text_and_file_dialog.rb +118 -0
- data/plugins/application_swt/lib/application_swt/icon.rb +37 -0
- data/plugins/application_swt/lib/application_swt/menu.rb +8 -3
- data/plugins/application_swt/lib/application_swt/tab.rb +6 -3
- data/plugins/application_swt/lib/application_swt/treebook.rb +29 -31
- data/plugins/application_swt/lib/swt/graphics_utils.rb +170 -0
- data/plugins/application_swt/lib/swt/vtab_folder.rb +125 -0
- data/plugins/application_swt/lib/swt/vtab_item.rb +69 -0
- data/plugins/application_swt/lib/swt/vtab_label.rb +84 -0
- data/plugins/auto_indenter/lib/auto_indenter.rb +4 -2
- data/plugins/core/lib/core/controller.rb +18 -0
- data/plugins/declarations/lib/declarations.rb +1 -1
- data/plugins/document_search/lib/document_search.rb +8 -6
- data/plugins/document_search/lib/document_search/replace.rb +51 -31
- data/plugins/document_search/lib/document_search/search_and_replace.rb +12 -11
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +33 -17
- data/plugins/edit_view/lib/edit_view.rb +100 -21
- data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +34 -11
- data/plugins/edit_view/lib/edit_view/actions/deletion.rb +10 -0
- data/plugins/edit_view/lib/edit_view/command.rb +5 -1
- data/plugins/edit_view/lib/edit_view/document.rb +8 -3
- data/plugins/edit_view/lib/edit_view/document/command.rb +15 -1
- data/plugins/edit_view/lib/edit_view/document/controller.rb +9 -0
- data/plugins/edit_view/lib/edit_view/document/history.rb +41 -0
- data/plugins/edit_view/lib/edit_view/tab_settings.rb +1 -11
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +150 -4
- data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +1 -1
- data/plugins/edit_view_swt/vendor/java-mateview.rb +1 -1
- data/plugins/find-in-project/lib/find_in_project.rb +7 -5
- data/plugins/html_view/features/step_definitions/html_view_steps.rb +2 -2
- data/plugins/line_tools/features/step_definitions/line_tools_steps.rb +0 -1
- data/plugins/line_tools/lib/line_tools.rb +7 -9
- data/plugins/macros/features/block_selection_in_macros.feature +48 -0
- data/plugins/macros/features/predictive_macros.feature +79 -0
- data/plugins/macros/features/record_and_run_macro.feature +87 -0
- data/plugins/macros/features/step_definitions/macro_steps.rb +66 -0
- data/plugins/macros/features/step_definitions/prediction_steps.rb +8 -0
- data/plugins/macros/features/support/env.rb +2 -0
- data/plugins/macros/lib/macros.rb +167 -0
- data/plugins/macros/lib/macros/action_sequence.rb +30 -0
- data/plugins/macros/lib/macros/commands.rb +108 -0
- data/plugins/macros/lib/macros/macro.rb +37 -0
- data/plugins/macros/lib/macros/manager_controller.rb +67 -0
- data/plugins/macros/lib/macros/predictive/document_controller.rb +69 -0
- data/plugins/macros/lib/macros/predictive/sequence_finder.rb +112 -0
- data/plugins/macros/plugin.rb +9 -0
- data/plugins/macros/spec/macros/predictive/sequence_finder_spec.rb +142 -0
- data/plugins/macros/spec/spec_helper.rb +6 -0
- data/plugins/macros/views/macro_manager.html.erb +86 -0
- data/plugins/outline_view/lib/outline_view.rb +1 -1
- data/plugins/project/lib/project/commands.rb +2 -2
- data/plugins/redcar/redcar.rb +37 -46
- data/plugins/repl/lib/repl.rb +4 -4
- data/plugins/runnables/features/command_tree.feature +1 -1
- data/plugins/runnables/features/parameter_input.feature +42 -0
- data/plugins/runnables/features/step_definitions/runnable_steps.rb +6 -0
- data/plugins/runnables/features/support/env.rb +28 -8
- data/plugins/runnables/lib/runnables.rb +35 -206
- data/plugins/runnables/lib/runnables/commands.rb +65 -0
- data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable.rb +62 -0
- data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_group.rb +59 -0
- data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb +32 -0
- data/plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb +41 -0
- data/plugins/runnables/lib/runnables/tree_mirror/tree_mirror.rb +61 -0
- data/plugins/scm/lib/scm.rb +78 -45
- data/plugins/scm/lib/scm/commands.rb +18 -4
- data/plugins/scm/lib/scm/model.rb +54 -41
- data/plugins/scm_svn/LICENSE +48 -0
- data/plugins/scm_svn/features/add_and_commit.feature +18 -0
- data/plugins/scm_svn/features/checkout.feature +5 -0
- data/plugins/scm_svn/features/edit_and_index.feature +12 -0
- data/plugins/scm_svn/features/ignore_files.feature +14 -0
- data/plugins/scm_svn/features/merge.feature +34 -0
- data/plugins/scm_svn/features/resolve_conflict.feature +23 -0
- data/plugins/scm_svn/features/revert_and_delete.feature +21 -0
- data/plugins/scm_svn/features/step_definitions/branch_and_merge_steps.rb +27 -0
- data/plugins/scm_svn/features/step_definitions/checkout_steps.rb +25 -0
- data/plugins/scm_svn/features/step_definitions/edit_and_index_steps.rb +50 -0
- data/plugins/scm_svn/features/step_definitions/scm_svn_steps.rb +57 -0
- data/plugins/scm_svn/features/support/env.rb +74 -0
- data/plugins/scm_svn/features/switch_branches.feature +53 -0
- data/plugins/scm_svn/features/update.feature +16 -0
- data/plugins/scm_svn/lib/scm_svn.rb +423 -9
- data/plugins/scm_svn/lib/scm_svn/change.rb +116 -0
- data/plugins/swt/lib/swt.rb +0 -15
- data/plugins/swt/lib/swt/cucumber_patches.rb +2 -37
- data/plugins/swt/lib/swt/cucumber_runner.rb +1 -0
- data/plugins/swt/lib/swt/full_swt.rb +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Clojure.tmbundle/Syntaxes/Clojure.tmLanguage +14 -2
- data/plugins/todo_list/lib/todo_list/todo_controller.rb +1 -1
- data/plugins/todo_list/views/default.css +50 -0
- data/plugins/todo_list/views/index.html.erb +5 -16
- data/plugins/todo_list/views/redcar_small_icon.png +0 -0
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +14 -33
- data/plugins/view_shortcuts/views/default.css +31 -0
- data/plugins/view_shortcuts/views/index.html.erb +26 -16
- data/plugins/view_shortcuts/views/redcar_small_icon.png +0 -0
- data/{plugins/runnables → share}/icons/cog.png +0 -0
- data/share/icons/folder-gear-emblem.png +0 -0
- data/share/icons/folder-gear.png +0 -0
- data/share/icons/folder-open-small-gears.png +0 -0
- metadata +59 -5
@@ -0,0 +1,86 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Macro Manager</title>
|
5
|
+
<% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets redcar.css))) %>
|
6
|
+
<link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
|
7
|
+
<% jquery_path = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets jquery-1.4.min.js))) %>
|
8
|
+
<script type="text/javascript" src="file://<%= jquery_path %>"></script>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<script type="text/javascript" src="file://<%= Redcar::HtmlView.jquery_path %>"></script>
|
12
|
+
<h3>Macro Manager</h3>
|
13
|
+
<h4>Unsaved Macros</h4>
|
14
|
+
<% if Macros.session_macros.any? %>
|
15
|
+
<table>
|
16
|
+
<% Macros.session_macros.each_with_index do |macro, i| %>
|
17
|
+
<tr>
|
18
|
+
<td class="macro-name"><%= macro.name %></td>
|
19
|
+
<td><a class="show-actions" href="#">Show Actions</a></td>
|
20
|
+
<td><a class="assign-name" href="#">Assign Name and Save</a></td>
|
21
|
+
<td><a class="delete-macro" href="#">Delete Macro</a></td>
|
22
|
+
</tr>
|
23
|
+
<%= macro_steps(macro) %>
|
24
|
+
<% end %>
|
25
|
+
</table>
|
26
|
+
<% else %>
|
27
|
+
None
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<h4>Saved Macros</h4>
|
31
|
+
<% if Macros.saved_macros.any? %>
|
32
|
+
<table>
|
33
|
+
<% Macros.saved_macros.reverse.each do |macro| %>
|
34
|
+
<tr>
|
35
|
+
<td class="macro-name"><%= macro.name %></td>
|
36
|
+
<td><a class="show-actions" href="#">Show Actions</a></td>
|
37
|
+
<td><a class="rename-macro" href="#">Rename</a></td>
|
38
|
+
<td><a class="delete-macro" href="#">Delete Macro</a></td>
|
39
|
+
</tr>
|
40
|
+
<%= macro_steps(macro) %>
|
41
|
+
<% end %>
|
42
|
+
</table>
|
43
|
+
<% else %>
|
44
|
+
None
|
45
|
+
<% end %>
|
46
|
+
</body>
|
47
|
+
</html>
|
48
|
+
|
49
|
+
<script language="javascript">
|
50
|
+
$("a.assign-name").click(function(e) {
|
51
|
+
e.preventDefault();
|
52
|
+
var macroName = $(this).parent().parent().find(".macro-name").text();
|
53
|
+
try {
|
54
|
+
Controller.assignName(macroName);
|
55
|
+
Controller.reloadIndex();
|
56
|
+
} catch(e) {
|
57
|
+
alert(e.message);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
$("a.show-actions").click(function(e) {
|
61
|
+
e.preventDefault();
|
62
|
+
var actions = $(this).parent().parent().next(".macro-actions");
|
63
|
+
actions.show();
|
64
|
+
});
|
65
|
+
|
66
|
+
$("a.rename-macro").click(function(e) {
|
67
|
+
e.preventDefault();
|
68
|
+
var macroName = $(this).parent().parent().find(".macro-name").text();
|
69
|
+
try {
|
70
|
+
Controller.renameMacro(macroName);
|
71
|
+
Controller.reloadIndex();
|
72
|
+
} catch(e) {
|
73
|
+
alert(e.message);
|
74
|
+
}
|
75
|
+
});
|
76
|
+
$("a.delete-macro").click(function(e) {
|
77
|
+
e.preventDefault();
|
78
|
+
var macroName = $(this).parent().parent().find(".macro-name").text();
|
79
|
+
try {
|
80
|
+
Controller.deleteMacro(macroName);
|
81
|
+
Controller.reloadIndex();
|
82
|
+
} catch(e) {
|
83
|
+
alert(e.message);
|
84
|
+
}
|
85
|
+
});
|
86
|
+
</script>
|
@@ -55,7 +55,7 @@ module Redcar
|
|
55
55
|
|
56
56
|
def selected(match, closing=true)
|
57
57
|
if @last_list
|
58
|
-
DocumentSearch::FindNextRegex.new(Regexp.new(Regexp.quote(match)), true).
|
58
|
+
DocumentSearch::FindNextRegex.new(Regexp.new(Regexp.quote(match)), true).run_in_focussed_tab_edit_view
|
59
59
|
close if closing
|
60
60
|
end
|
61
61
|
end
|
@@ -305,7 +305,7 @@ module Redcar
|
|
305
305
|
when :osx
|
306
306
|
run_application('open', '-a', 'finder', path)
|
307
307
|
when :windows
|
308
|
-
run_application('explorer.exe', path)
|
308
|
+
run_application('explorer.exe', path.gsub("/","\\"))
|
309
309
|
when :linux
|
310
310
|
app = {
|
311
311
|
'Thunar' => [path],
|
@@ -337,7 +337,7 @@ module Redcar
|
|
337
337
|
when :osx
|
338
338
|
run_application('open', path)
|
339
339
|
when :windows
|
340
|
-
run_application('cmd.exe', '/
|
340
|
+
run_application('start cmd.exe', '/kcd ' + path.gsub("/","\\"))
|
341
341
|
when :linux
|
342
342
|
app = {
|
343
343
|
'xfce4-terminal' => ["--working-directory=#{path}"],
|
data/plugins/redcar/redcar.rb
CHANGED
@@ -364,10 +364,9 @@ Redcar.environment: #{Redcar.environment}
|
|
364
364
|
end
|
365
365
|
end
|
366
366
|
|
367
|
-
class MoveHomeCommand <
|
367
|
+
class MoveHomeCommand < DocumentCommand
|
368
368
|
|
369
369
|
def execute
|
370
|
-
doc = tab.edit_view.document
|
371
370
|
line_ix = doc.line_at_offset(doc.cursor_offset)
|
372
371
|
line = doc.get_line(line_ix)
|
373
372
|
prefix = line[0...doc.cursor_line_offset]
|
@@ -387,19 +386,17 @@ Redcar.environment: #{Redcar.environment}
|
|
387
386
|
end
|
388
387
|
end
|
389
388
|
|
390
|
-
class MoveTopCommand <
|
389
|
+
class MoveTopCommand < DocumentCommand
|
391
390
|
|
392
391
|
def execute
|
393
|
-
doc = tab.edit_view.document
|
394
392
|
doc.cursor_offset = 0
|
395
393
|
doc.ensure_visible(0)
|
396
394
|
end
|
397
395
|
end
|
398
396
|
|
399
|
-
class MoveEndCommand <
|
397
|
+
class MoveEndCommand < DocumentCommand
|
400
398
|
|
401
399
|
def execute
|
402
|
-
doc = tab.edit_view.document
|
403
400
|
line_ix = doc.line_at_offset(doc.cursor_offset)
|
404
401
|
if line_ix == doc.line_count - 1
|
405
402
|
doc.cursor_offset = doc.length
|
@@ -410,18 +407,16 @@ Redcar.environment: #{Redcar.environment}
|
|
410
407
|
end
|
411
408
|
end
|
412
409
|
|
413
|
-
class MoveBottomCommand <
|
410
|
+
class MoveBottomCommand < DocumentCommand
|
414
411
|
|
415
412
|
def execute
|
416
|
-
doc = tab.edit_view.document
|
417
413
|
doc.cursor_offset = doc.length
|
418
414
|
doc.ensure_visible(doc.length)
|
419
415
|
end
|
420
416
|
end
|
421
417
|
|
422
|
-
class ChangeIndentCommand <
|
418
|
+
class ChangeIndentCommand < DocumentCommand
|
423
419
|
def execute
|
424
|
-
doc = tab.edit_view.document
|
425
420
|
doc.compound do
|
426
421
|
doc.edit_view.delay_parsing do
|
427
422
|
if doc.selection?
|
@@ -487,14 +482,14 @@ Redcar.environment: #{Redcar.environment}
|
|
487
482
|
end
|
488
483
|
end
|
489
484
|
|
490
|
-
class SelectAllCommand < Redcar::
|
485
|
+
class SelectAllCommand < Redcar::DocumentCommand
|
491
486
|
|
492
487
|
def execute
|
493
488
|
doc.select_all
|
494
489
|
end
|
495
490
|
end
|
496
491
|
|
497
|
-
class SelectLineCommand < Redcar::
|
492
|
+
class SelectLineCommand < Redcar::DocumentCommand
|
498
493
|
|
499
494
|
def execute
|
500
495
|
doc.set_selection_range(
|
@@ -502,7 +497,7 @@ Redcar.environment: #{Redcar.environment}
|
|
502
497
|
end
|
503
498
|
end
|
504
499
|
|
505
|
-
class SelectWordCommand < Redcar::
|
500
|
+
class SelectWordCommand < Redcar::DocumentCommand
|
506
501
|
|
507
502
|
def execute
|
508
503
|
range = doc.current_word_range
|
@@ -667,10 +662,12 @@ Redcar.environment: #{Redcar.environment}
|
|
667
662
|
end
|
668
663
|
end
|
669
664
|
|
670
|
-
class ToggleBlockSelectionCommand < Redcar::
|
665
|
+
class ToggleBlockSelectionCommand < Redcar::DocumentCommand
|
671
666
|
|
672
667
|
def execute
|
673
|
-
|
668
|
+
unless doc.single_line?
|
669
|
+
doc.block_selection_mode = !doc.block_selection_mode?
|
670
|
+
end
|
674
671
|
end
|
675
672
|
end
|
676
673
|
|
@@ -696,12 +693,6 @@ Redcar.environment: #{Redcar.environment}
|
|
696
693
|
end
|
697
694
|
end
|
698
695
|
|
699
|
-
class ToggleAnnotations < Redcar::EditTabCommand
|
700
|
-
def execute
|
701
|
-
EditView.show_annotations = !EditView.show_annotations?
|
702
|
-
end
|
703
|
-
end
|
704
|
-
|
705
696
|
class ToggleToolbar < Command
|
706
697
|
|
707
698
|
def execute
|
@@ -943,38 +934,39 @@ Redcar.environment: #{Redcar.environment}
|
|
943
934
|
item "Cut", CutCommand
|
944
935
|
item "Copy", CopyCommand
|
945
936
|
item "Paste", PasteCommand
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
group(:priority => 25) do
|
951
|
-
separator
|
952
|
-
item "Top", MoveTopCommand
|
953
|
-
item "Home", MoveHomeCommand
|
954
|
-
item "End", MoveEndCommand
|
955
|
-
item "Bottom", MoveBottomCommand
|
956
|
-
end
|
957
|
-
|
958
|
-
group(:priority => 60) do
|
959
|
-
separator
|
960
|
-
item "Increase Indent", IncreaseIndentCommand
|
961
|
-
item "Decrease Indent", DecreaseIndentCommand
|
962
|
-
end
|
963
|
-
|
964
|
-
group(:priority => 70) do
|
965
|
-
separator
|
966
|
-
item "Goto Line", GotoLineCommand
|
937
|
+
sub_menu "Line Tools", :priority => 20 do
|
938
|
+
item "Duplicate Region", DuplicateCommand
|
939
|
+
item "Sort Lines in Region", SortLinesCommand
|
940
|
+
end
|
967
941
|
end
|
968
942
|
|
969
|
-
group(:priority =>
|
943
|
+
group(:priority => 30) do
|
970
944
|
separator
|
971
|
-
sub_menu "
|
945
|
+
sub_menu "Selection" do
|
972
946
|
item "All", SelectAllCommand
|
973
947
|
item "Line", SelectLineCommand
|
974
948
|
item "Current Word", SelectWordCommand
|
949
|
+
item "Toggle Block Selection", ToggleBlockSelectionCommand
|
975
950
|
end
|
976
|
-
item "Toggle Block Selection", ToggleBlockSelectionCommand
|
977
951
|
end
|
952
|
+
|
953
|
+
group(:priority => 40) do
|
954
|
+
sub_menu "Document Navigation" do
|
955
|
+
item "Goto Line", GotoLineCommand
|
956
|
+
item "Top", MoveTopCommand
|
957
|
+
item "Home", MoveHomeCommand
|
958
|
+
item "End", MoveEndCommand
|
959
|
+
item "Bottom", MoveBottomCommand
|
960
|
+
end
|
961
|
+
end
|
962
|
+
|
963
|
+
group(:priority => 50) do
|
964
|
+
sub_menu "Formatting" do
|
965
|
+
item "Increase Indent", IncreaseIndentCommand
|
966
|
+
item "Decrease Indent", DecreaseIndentCommand
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
978
970
|
end
|
979
971
|
sub_menu "Debug", :priority => 20 do
|
980
972
|
group(:priority => 10) do
|
@@ -1010,7 +1002,6 @@ Redcar.environment: #{Redcar.environment}
|
|
1010
1002
|
item "Show Toolbar", :command => ToggleToolbar, :type => :check, :active => Redcar.app.show_toolbar?
|
1011
1003
|
item "Show Invisibles", :command => ToggleInvisibles, :type => :check, :active => EditView.show_invisibles?
|
1012
1004
|
item "Show Line Numbers", :command => ToggleLineNumbers, :type => :check, :active => EditView.show_line_numbers?
|
1013
|
-
item "Show Annotations", :command => ToggleAnnotations, :type => :check, :active => EditView.show_annotations?
|
1014
1005
|
end
|
1015
1006
|
sub_menu "Bundles", :priority => 45 do
|
1016
1007
|
group(:priority => :first) do
|
data/plugins/repl/lib/repl.rb
CHANGED
@@ -17,13 +17,13 @@ module Redcar
|
|
17
17
|
|
18
18
|
def self.keymaps
|
19
19
|
osx = Keymap.build("main", :osx) do
|
20
|
-
link "Cmd+Shift+
|
21
|
-
link "Cmd+
|
20
|
+
link "Cmd+Shift+R", REPL::RubyOpenREPL
|
21
|
+
link "Cmd+R", REPL::CommitREPL
|
22
22
|
end
|
23
23
|
|
24
24
|
linwin = Keymap.build("main", [:linux, :windows]) do
|
25
|
-
link "Ctrl+Shift+
|
26
|
-
link "Ctrl+
|
25
|
+
link "Ctrl+Shift+R", REPL::RubyOpenREPL
|
26
|
+
link "Ctrl+R", REPL::CommitREPL
|
27
27
|
end
|
28
28
|
|
29
29
|
[linwin, osx]
|
@@ -7,7 +7,7 @@ Feature: Showing commands in a command tree
|
|
7
7
|
Scenario: Shows grouped commands from .redcar/runnables/*.json in the project
|
8
8
|
When I open the runnables tree
|
9
9
|
Then I should see "fixture_runnables" in the tree
|
10
|
-
|
10
|
+
|
11
11
|
Scenario: Shows individual commands in groups
|
12
12
|
When I open the runnables tree
|
13
13
|
And I expand the tree row "fixture_runnables"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Feature: Adding parameters to commands
|
2
|
+
As a user
|
3
|
+
I want to add parameters to commands
|
4
|
+
So I don't need to make many similar ones
|
5
|
+
|
6
|
+
Background:
|
7
|
+
When I will choose "plugins/runnables/features/fixtures" from the "open_directory" dialog
|
8
|
+
And I open a directory
|
9
|
+
|
10
|
+
Scenario: Running a command containing parameters
|
11
|
+
Given I would type "runnable_app.rb" in an input box
|
12
|
+
When I open the runnables tree
|
13
|
+
And I expand the tree row "fixture_runnables"
|
14
|
+
And I activate the "A params app" node in the tree
|
15
|
+
Then my active tab should be "A params app"
|
16
|
+
And the HTML tab should say "hello world"
|
17
|
+
|
18
|
+
Scenario: Running a command containing parameters
|
19
|
+
Given I would type "hello" in an input box
|
20
|
+
And I would type "world" in an input box
|
21
|
+
When I open the runnables tree
|
22
|
+
And I expand the tree row "fixture_runnables"
|
23
|
+
And I activate the "A multi-params app" node in the tree
|
24
|
+
Then my active tab should be "A multi-params app"
|
25
|
+
And the HTML tab should say "hello world"
|
26
|
+
|
27
|
+
Scenario: Appending parameters before running a command
|
28
|
+
Given I would type "world" in an input box
|
29
|
+
When I open the runnables tree
|
30
|
+
And I expand the tree row "fixture_runnables"
|
31
|
+
And I append parameters to the "An appendable app" node in the tree
|
32
|
+
Then my active tab should be "An appendable app"
|
33
|
+
And the HTML tab should say "hello world"
|
34
|
+
|
35
|
+
Scenario: Appending parameters to a command which ends in parameters is disallowed
|
36
|
+
Given I would type "runnable_app.rb" in an input box
|
37
|
+
And I would type "there" in an input box
|
38
|
+
When I open the runnables tree
|
39
|
+
And I expand the tree row "fixture_runnables"
|
40
|
+
And I append parameters to the "A params app" node in the tree
|
41
|
+
Then my active tab should be "A params app"
|
42
|
+
And the HTML tab should say "hello world"
|
@@ -19,4 +19,10 @@ end
|
|
19
19
|
|
20
20
|
Then /^I should see (\d+) more windows?$/ do |window_count|
|
21
21
|
Redcar.app.windows.size.should == (@windows + window_count.to_i)
|
22
|
+
end
|
23
|
+
|
24
|
+
When /^I append parameters to the "([^"]*)" node in the tree$/ do |node_text|
|
25
|
+
mirror = Redcar.app.focussed_window.treebook.focussed_tree.tree_mirror
|
26
|
+
node = find_node_with_text(mirror.top, node_text)
|
27
|
+
Redcar::Runnables::AppendParamsAndRunCommand.new(node).run
|
22
28
|
end
|
@@ -1,6 +1,7 @@
|
|
1
|
+
RequireSupportFiles File.dirname(__FILE__) + "/../../../application/features/"
|
1
2
|
RequireSupportFiles File.dirname(__FILE__) + "/../../../edit_view/features/"
|
2
|
-
RequireSupportFiles File.dirname(__FILE__) + "/../../../project/features/"
|
3
3
|
RequireSupportFiles File.dirname(__FILE__) + "/../../../html_view/features/"
|
4
|
+
RequireSupportFiles File.dirname(__FILE__) + "/../../../project/features/"
|
4
5
|
|
5
6
|
def runnable_fixtures
|
6
7
|
File.expand_path(File.dirname(__FILE__) + "/../fixtures")
|
@@ -15,11 +16,16 @@ def reset_runnable_fixtures
|
|
15
16
|
FileUtils.rm_rf runnable_fixtures
|
16
17
|
FileUtils.mkdir_p runnable_fixtures
|
17
18
|
FileUtils.mkdir_p File.dirname(runnable_config)
|
18
|
-
|
19
|
+
|
19
20
|
File.open("#{runnable_fixtures}/runnable_app.rb", 'w') do |f|
|
20
21
|
f.puts %Q|puts "hello world"|
|
21
22
|
end
|
22
|
-
|
23
|
+
|
24
|
+
File.open("#{runnable_fixtures}/params_app.rb", 'w') do |f|
|
25
|
+
#f.puts "puts ARGV[0] +' '+ ARGV[1]"
|
26
|
+
f.puts "ARGV.each { |it| print it+' '}"
|
27
|
+
end
|
28
|
+
|
23
29
|
File.open(runnable_config, 'w') do |f|
|
24
30
|
f.print <<-EOS
|
25
31
|
{
|
@@ -27,22 +33,34 @@ def reset_runnable_fixtures
|
|
27
33
|
{
|
28
34
|
"name": "An app",
|
29
35
|
"command": "jruby runnable_app.rb",
|
30
|
-
"description": "Runs the app"
|
31
|
-
|
32
|
-
},
|
36
|
+
"description": "Runs the app"
|
37
|
+
},
|
33
38
|
{
|
34
39
|
"name": "A silent app",
|
35
40
|
"command": "jruby runnable_app.rb",
|
36
41
|
"description": "Runs the app silently",
|
37
|
-
"type": "task/ruby",
|
38
42
|
"output": "none"
|
39
43
|
},
|
40
44
|
{
|
41
45
|
"name": "A windowed app",
|
42
46
|
"command": "jruby runnable_app.rb",
|
43
47
|
"description": "Runs the app in a window",
|
44
|
-
"type": "task/ruby",
|
45
48
|
"output": "window"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "A params app",
|
52
|
+
"command": "jruby __PARAMS__",
|
53
|
+
"description": "Runs the app with a parameter"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"name": "A multi-params app",
|
57
|
+
"command": "jruby params_app.rb __PARAMS__ __PARAMS__",
|
58
|
+
"description": "Runs the app with many parameters"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"name": "An appendable app",
|
62
|
+
"command": "jruby params_app.rb hello",
|
63
|
+
"description": "Runs an app that prints parameters"
|
46
64
|
}
|
47
65
|
],
|
48
66
|
"file_runners":[
|
@@ -60,8 +78,10 @@ end
|
|
60
78
|
|
61
79
|
Before do
|
62
80
|
reset_runnable_fixtures
|
81
|
+
Redcar.gui.dialog_adapter.clear_input
|
63
82
|
end
|
64
83
|
|
65
84
|
After do
|
66
85
|
FileUtils.rm_rf runnable_fixtures
|
86
|
+
Redcar.gui.dialog_adapter.clear_input
|
67
87
|
end
|