redcar 0.10 → 0.11.0dev
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.
- data/CHANGES +14 -0
- data/Rakefile +68 -29
- data/lib/redcar.rb +2 -2
- data/plugins/application/lib/application/dialogs/filter_list_dialog.rb +2 -1
- data/plugins/application_swt/spec/application_swt/gradient_spec.rb +3 -12
- data/plugins/core/lib/core/resource.rb +13 -5
- data/plugins/document_search/features/find.feature +366 -214
- data/plugins/document_search/features/incremental_search.feature +351 -0
- data/plugins/document_search/features/replace.feature +16 -16
- data/plugins/document_search/features/step_definitions/find_steps.rb +16 -0
- data/plugins/document_search/features/support/env.rb +11 -0
- data/plugins/document_search/lib/document_search.rb +149 -109
- data/plugins/document_search/lib/document_search/commands.rb +251 -202
- data/plugins/document_search/lib/document_search/find_speedbar.rb +138 -81
- data/plugins/document_search/lib/document_search/incremental_search_speedbar.rb +70 -0
- data/plugins/document_search/lib/document_search/query_options.rb +15 -39
- data/plugins/document_search/plugin.rb +1 -1
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +6 -2
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +2 -2
- data/plugins/file_parser/lib/file_parser.rb +6 -1
- data/plugins/html_view/features/step_definitions/web_view_steps.rb +12 -0
- data/plugins/html_view/features/support/env.rb +16 -0
- data/plugins/html_view/lib/html_view.rb +5 -1
- data/plugins/line_tools/lib/line_tools.rb +16 -0
- data/plugins/project/features/find_file.feature +28 -0
- data/plugins/project/features/open_and_save_files.feature +11 -0
- data/plugins/project/features/step_definitions/file_steps.rb +6 -1
- data/plugins/project/features/support/env.rb +2 -0
- data/plugins/project/lib/project.rb +49 -6
- data/plugins/project/lib/project/commands.rb +18 -6
- data/plugins/project/lib/project/find_file_dialog.rb +19 -8
- data/plugins/project/lib/project/find_recent_dialog.rb +30 -0
- data/plugins/project/lib/project/manager.rb +41 -10
- data/plugins/project/lib/project/recent.rb +64 -0
- data/plugins/project/spec/fixtures/myproject/vendor/bar.rb +0 -0
- data/plugins/project/spec/fixtures/myproject/vendor/plugins/bar.rb +0 -0
- data/plugins/{find-in-project → project_search}/TODO.md +3 -3
- data/plugins/project_search/features/support/env.rb +6 -0
- data/plugins/project_search/features/word_search.feature +34 -0
- data/plugins/project_search/lib/project_search.rb +73 -0
- data/plugins/project_search/lib/project_search/binary_data_detector.rb +46 -0
- data/plugins/project_search/lib/project_search/commands.rb +62 -0
- data/plugins/project_search/lib/project_search/hit.rb +17 -0
- data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/images/collapsed.png +0 -0
- data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/images/expanded.png +0 -0
- data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/images/spinner.gif +0 -0
- data/plugins/project_search/lib/project_search/lucene_index.rb +64 -0
- data/plugins/project_search/lib/project_search/lucene_refresh.rb +22 -0
- data/plugins/project_search/lib/project_search/project.rb +14 -0
- data/plugins/project_search/lib/project_search/query.rb +29 -0
- data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/stylesheets/style.css +14 -3
- data/plugins/project_search/lib/project_search/views/_file.html.erb +60 -0
- data/plugins/{find-in-project/lib/find_in_project → project_search/lib/project_search}/views/index.html.erb +12 -9
- data/plugins/project_search/lib/project_search/word_search.rb +105 -0
- data/plugins/project_search/lib/project_search/word_search_controller.rb +207 -0
- data/plugins/project_search/plugin.rb +8 -0
- data/plugins/project_search/spec/fixtures/project/binary_file.bin +0 -0
- data/plugins/project_search/spec/fixtures/project/foo.txt +43 -0
- data/plugins/project_search/spec/fixtures/project/qux.rb +3 -0
- data/plugins/project_search/spec/project_search/binary_data_detector_spec.rb +24 -0
- data/plugins/project_search/spec/project_search/word_search_spec.rb +157 -0
- data/plugins/project_search/spec/spec_helper.rb +27 -0
- data/plugins/redcar/redcar.rb +77 -71
- data/plugins/ruby/lib/ruby/syntax_checker.rb +1 -1
- data/plugins/snippets/features/snippets.feature +12 -0
- data/plugins/snippets/lib/snippets/tab_handler.rb +1 -1
- metadata +46 -25
- data/plugins/document_search/features/find_and_replace.feature +0 -723
- data/plugins/document_search/lib/document_search/find_and_replace_speedbar.rb +0 -142
- data/plugins/find-in-project/lib/find_in_project.rb +0 -35
- data/plugins/find-in-project/lib/find_in_project/commands.rb +0 -30
- data/plugins/find-in-project/lib/find_in_project/controllers.rb +0 -170
- data/plugins/find-in-project/lib/find_in_project/views/_divider.html.erb +0 -4
- data/plugins/find-in-project/lib/find_in_project/views/_file_heading.html.erb +0 -10
- data/plugins/find-in-project/lib/find_in_project/views/_file_line.html.erb +0 -6
- data/plugins/find-in-project/plugin.rb +0 -11
- data/plugins/project/lib/project/recent_directories.rb +0 -54
@@ -1,102 +1,159 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
class
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
module Redcar
|
2
|
+
module DocumentSearch
|
3
|
+
class FindSpeedbar < Redcar::Speedbar
|
4
|
+
class << self
|
5
|
+
attr_accessor :previous_query, :previous_replace, :previous_options
|
6
|
+
end
|
7
|
+
@previous_query = ''
|
8
|
+
@previous_replace = ''
|
9
|
+
@previous_options = QueryOptions.new
|
8
10
|
|
9
|
-
|
11
|
+
attr_accessor :initial_query
|
10
12
|
|
11
|
-
|
12
|
-
win = Redcar.app.focussed_window
|
13
|
-
tab = win.focussed_notebook_tab
|
14
|
-
tab.document if tab
|
15
|
-
end
|
13
|
+
NotFoundMessage = 'Not found!'
|
16
14
|
|
17
|
-
|
18
|
-
FindSpeedbar.previous_query ||= ""
|
19
|
-
self.query.value = @initial_query || FindSpeedbar.previous_query
|
20
|
-
self.query_type.value = QueryOptions.query_type_to_text(
|
21
|
-
FindSpeedbar.previous_options.query_type)
|
22
|
-
self.match_case.value = FindSpeedbar.previous_options.match_case
|
23
|
-
self.wrap_around.value = FindSpeedbar.previous_options.wrap_around
|
24
|
-
self.query.edit_view.document.select_all
|
25
|
-
end
|
15
|
+
### UI DEFINITION ###
|
26
16
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
update_options_from_ui
|
31
|
-
FindSpeedbar.find_incremental
|
17
|
+
# Override num_columns to control number of rows.
|
18
|
+
def num_columns
|
19
|
+
return 7
|
32
20
|
end
|
33
|
-
end
|
34
21
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
22
|
+
label :label_find, 'Find:'
|
23
|
+
textbox :query do |val|
|
24
|
+
FindSpeedbar.previous_query = val
|
25
|
+
end
|
40
26
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
FindSpeedbar.find_incremental
|
45
|
-
end
|
27
|
+
toggle :is_regex, 'Regex', nil, false do |val|
|
28
|
+
FindSpeedbar.previous_options.is_regex = val
|
29
|
+
end
|
46
30
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
FindSpeedbar.find_incremental
|
51
|
-
end
|
31
|
+
toggle :match_case, 'Match case', nil, false do |val|
|
32
|
+
FindSpeedbar.previous_options.match_case = val
|
33
|
+
end
|
52
34
|
|
53
|
-
|
54
|
-
|
55
|
-
update_options_from_ui
|
56
|
-
FindSpeedbar.find_previous
|
35
|
+
toggle :wrap_around, 'Wrap around', nil, true do |val|
|
36
|
+
FindSpeedbar.previous_options.wrap_around = val
|
57
37
|
end
|
58
|
-
end
|
59
38
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
39
|
+
label :label_not_found, NotFoundMessage # Hack: Set label for sizing, clear in after_draw
|
40
|
+
label :label_space_end_row1, ""
|
41
|
+
label :label_spacer_start_row2, ""
|
42
|
+
|
43
|
+
label :label_replace, 'Replace:'
|
44
|
+
textbox :replace do |val|
|
45
|
+
FindSpeedbar.previous_replace = val
|
64
46
|
end
|
65
|
-
end
|
66
47
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
FindSpeedbar.previous_options.match_case = self.match_case.value
|
73
|
-
FindSpeedbar.previous_options.wrap_around = self.wrap_around.value
|
48
|
+
button :replace_find, 'Replace && Find', 'Alt+Return' do
|
49
|
+
FindSpeedbar.replace_and_find(
|
50
|
+
FindSpeedbar.previous_query,
|
51
|
+
FindSpeedbar.previous_replace,
|
52
|
+
FindSpeedbar.previous_options) or not_found
|
74
53
|
end
|
75
|
-
end
|
76
54
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
55
|
+
button :replace_all, 'Replace All', nil do
|
56
|
+
FindSpeedbar.replace_all(
|
57
|
+
FindSpeedbar.previous_query,
|
58
|
+
FindSpeedbar.previous_replace,
|
59
|
+
FindSpeedbar.previous_options) or not_found
|
60
|
+
end
|
81
61
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
62
|
+
button :replace_all_in_selection, 'Replace in Selection', nil do
|
63
|
+
FindSpeedbar.replace_all_in_selection(
|
64
|
+
FindSpeedbar.previous_query,
|
65
|
+
FindSpeedbar.previous_replace,
|
66
|
+
FindSpeedbar.previous_options) or not_found
|
67
|
+
end
|
86
68
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
69
|
+
button :find_previous, 'Previous', 'Shift+Return' do
|
70
|
+
FindSpeedbar.find_previous or not_found
|
71
|
+
end
|
72
|
+
|
73
|
+
button :find_next, 'Next', 'Return' do
|
74
|
+
FindSpeedbar.find_next or not_found
|
75
|
+
end
|
76
|
+
|
77
|
+
### UI OPERATIONS ###
|
78
|
+
|
79
|
+
# Initializes UI elements.
|
80
|
+
def after_draw
|
81
|
+
clear_not_found
|
82
|
+
# If the current selection (from @initial_query) is equal to previous_replace, we ignore
|
83
|
+
# that selection and just use the previous value for the query.
|
84
|
+
#
|
85
|
+
# This is especially important in the following command sequence: Select; Use selection for
|
86
|
+
# query; Select; Use selection for replace; Open Find speedbar. Without the fix, the prior
|
87
|
+
# selection for the query gets overwritten with the current selection, which is annoying and
|
88
|
+
# useless.
|
89
|
+
if ((FindSpeedbar.previous_replace.length > 0) &&
|
90
|
+
(@initial_query == FindSpeedbar.previous_replace))
|
91
|
+
self.query.value = FindSpeedbar.previous_query
|
92
|
+
else
|
93
|
+
self.query.value = @initial_query || FindSpeedbar.previous_query
|
94
|
+
end
|
95
|
+
self.replace.value = FindSpeedbar.previous_replace || ""
|
96
|
+
self.is_regex.value = FindSpeedbar.previous_options.is_regex
|
97
|
+
self.match_case.value = FindSpeedbar.previous_options.match_case
|
98
|
+
self.wrap_around.value = FindSpeedbar.previous_options.wrap_around
|
99
|
+
self.query.edit_view.document.select_all
|
100
|
+
end
|
101
|
+
|
102
|
+
# Sets the "Not found" label message, invoking the system beep.
|
103
|
+
def not_found
|
104
|
+
Swt::Widgets::Display.get_current.beep
|
105
|
+
self.label_not_found.text = NotFoundMessage
|
106
|
+
end
|
107
|
+
|
108
|
+
# Clears the "Not found" label message.
|
109
|
+
def clear_not_found
|
110
|
+
self.label_not_found.text = ''
|
111
|
+
end
|
112
|
+
|
113
|
+
### COMMANDS ###
|
114
|
+
|
115
|
+
def self.find_next
|
116
|
+
cmd = FindNextCommand.new(FindSpeedbar.previous_query, FindSpeedbar.previous_options)
|
117
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.find_previous
|
121
|
+
cmd = FindPreviousCommand.new(FindSpeedbar.previous_query, FindSpeedbar.previous_options)
|
122
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
123
|
+
end
|
124
|
+
|
125
|
+
# Note: The assumption that we set find only from selected text means we don't have to update
|
126
|
+
# search.
|
127
|
+
def self.use_selection_for_find(doc, active_speedbar=nil)
|
128
|
+
return unless doc.selection?
|
129
|
+
FindSpeedbar.previous_query = doc.selected_text
|
130
|
+
if active_speedbar && (active_speedbar.is_a? FindSpeedbar)
|
131
|
+
active_speedbar.query.value = FindSpeedbar.previous_query
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.replace_and_find(query, replace, options)
|
136
|
+
cmd = ReplaceAndFindCommand.new(query, replace, options)
|
137
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.replace_all(query, replace, options)
|
141
|
+
cmd = ReplaceAllCommand.new(query, replace, options, false)
|
142
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.replace_all_in_selection(query, replace, options)
|
146
|
+
cmd = ReplaceAllCommand.new(query, replace, options, true)
|
147
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
148
|
+
end
|
91
149
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
active_speedbar.query.value = FindSpeedbar.previous_query
|
150
|
+
def self.use_selection_for_replace(doc, active_speedbar=nil)
|
151
|
+
return unless doc.selection?
|
152
|
+
FindSpeedbar.previous_replace = doc.selected_text
|
153
|
+
if active_speedbar && (active_speedbar.instance_of? FindSpeedbar)
|
154
|
+
active_speedbar.replace.value = FindSpeedbar.previous_replace
|
155
|
+
end
|
99
156
|
end
|
100
157
|
end
|
101
158
|
end
|
102
|
-
end
|
159
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Redcar
|
2
|
+
module DocumentSearch
|
3
|
+
class IncrementalSearchSpeedbar < Redcar::Speedbar
|
4
|
+
class << self
|
5
|
+
attr_accessor :previous_query, :previous_options
|
6
|
+
end
|
7
|
+
@previous_query = ''
|
8
|
+
@previous_options = QueryOptions.new
|
9
|
+
|
10
|
+
### UI ###
|
11
|
+
|
12
|
+
label :label, 'Find:'
|
13
|
+
textbox :query do |value|
|
14
|
+
# Check to avoid multiple searches from duplicate text update events.
|
15
|
+
if IncrementalSearchSpeedbar.previous_query != self.query.value
|
16
|
+
IncrementalSearchSpeedbar.previous_query = self.query.value
|
17
|
+
IncrementalSearchSpeedbar.find_incremental
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
toggle :is_regex, 'Regex', nil, false do |val|
|
22
|
+
IncrementalSearchSpeedbar.previous_options.is_regex = val
|
23
|
+
IncrementalSearchSpeedbar.find_incremental
|
24
|
+
end
|
25
|
+
|
26
|
+
toggle :match_case, 'Match case', nil, false do |val|
|
27
|
+
IncrementalSearchSpeedbar.previous_options.match_case = val
|
28
|
+
IncrementalSearchSpeedbar.find_incremental
|
29
|
+
end
|
30
|
+
|
31
|
+
toggle :wrap_around, 'Wrap around', nil, true do |val|
|
32
|
+
IncrementalSearchSpeedbar.previous_options.wrap_around = val
|
33
|
+
IncrementalSearchSpeedbar.find_incremental
|
34
|
+
end
|
35
|
+
|
36
|
+
def after_draw
|
37
|
+
IncrementalSearchSpeedbar.previous_query ||= ""
|
38
|
+
self.query.value = IncrementalSearchSpeedbar.previous_query
|
39
|
+
self.is_regex.value = IncrementalSearchSpeedbar.previous_options.is_regex
|
40
|
+
self.match_case.value = IncrementalSearchSpeedbar.previous_options.match_case
|
41
|
+
self.wrap_around.value = IncrementalSearchSpeedbar.previous_options.wrap_around
|
42
|
+
self.query.edit_view.document.select_all
|
43
|
+
end
|
44
|
+
|
45
|
+
### COMMANDS ###
|
46
|
+
|
47
|
+
def self.find_incremental
|
48
|
+
cmd = FindNextCommand.new(
|
49
|
+
IncrementalSearchSpeedbar.previous_query,
|
50
|
+
IncrementalSearchSpeedbar.previous_options,
|
51
|
+
always_start_within_selection=true)
|
52
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.find_next
|
56
|
+
cmd = FindNextCommand.new(
|
57
|
+
IncrementalSearchSpeedbar.previous_query,
|
58
|
+
IncrementalSearchSpeedbar.previous_options)
|
59
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.find_previous
|
63
|
+
cmd = FindPreviousCommand.new(
|
64
|
+
IncrementalSearchSpeedbar.previous_query,
|
65
|
+
IncrementalSearchSpeedbar.previous_options)
|
66
|
+
cmd.run(:env => {:edit_view => Redcar::EditView.focussed_tab_edit_view})
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -1,44 +1,20 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
module Redcar
|
2
|
+
module DocumentSearch
|
3
|
+
# Encapsulates options for search queries.
|
4
|
+
class QueryOptions
|
5
|
+
attr_accessor :is_regex
|
6
|
+
attr_accessor :match_case
|
7
|
+
attr_accessor :wrap_around
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
@match_case = false
|
12
|
-
@wrap_around = true
|
13
|
-
end
|
14
|
-
|
15
|
-
### UTILITY ###
|
16
|
-
|
17
|
-
# Maps a search type combo box value to the corresponding search type symbol.
|
18
|
-
def self.query_type_to_symbol(query_type_text)
|
19
|
-
case query_type_text
|
20
|
-
when "Plain"
|
21
|
-
:query_plain
|
22
|
-
when "Regex"
|
23
|
-
:query_regex
|
24
|
-
when "Glob"
|
25
|
-
:query_glob
|
26
|
-
else
|
27
|
-
raise "Invalid query type: #{query_type_text}"
|
28
|
-
end
|
29
|
-
end
|
9
|
+
DEFAULT_IS_REGEX = false
|
10
|
+
DEFAULT_MATCH_CASE = false
|
11
|
+
DEFAULT_WRAP_AROUND = true
|
30
12
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
when :query_regex
|
37
|
-
'Regex'
|
38
|
-
when :query_glob
|
39
|
-
'Glob'
|
40
|
-
else
|
41
|
-
raise "Invalid query type symbol: #{query_type_symbol}"
|
13
|
+
# Initializes with default options.
|
14
|
+
def initialize
|
15
|
+
@is_regex = DEFAULT_IS_REGEX
|
16
|
+
@match_case = DEFAULT_MATCH_CASE
|
17
|
+
@wrap_around = DEFAULT_WRAP_AROUND
|
42
18
|
end
|
43
19
|
end
|
44
20
|
end
|
@@ -108,7 +108,7 @@ When /^I press the Backspace key in the edit tab$/ do
|
|
108
108
|
edit_view.backspace_pressed([])
|
109
109
|
end
|
110
110
|
|
111
|
-
Then /^the contents should be "(.*)"$/ do |text|
|
111
|
+
Then /^the contents should (not )?be "(.*)"$/ do |negative,text|
|
112
112
|
expected = unescape_text(text)
|
113
113
|
doc = Redcar::EditView.focussed_edit_view_document
|
114
114
|
actual = doc.to_s
|
@@ -121,7 +121,11 @@ Then /^the contents should be "(.*)"$/ do |text|
|
|
121
121
|
end
|
122
122
|
actual = actual.insert(actual.char_offset_to_byte_offset(char_seloff), "<s>") unless char_curoff == char_seloff
|
123
123
|
end
|
124
|
-
|
124
|
+
if negative
|
125
|
+
actual.should_not == expected
|
126
|
+
else
|
127
|
+
actual.should == expected
|
128
|
+
end
|
125
129
|
end
|
126
130
|
|
127
131
|
Then /^the contents of the edit tab should be "(.*)"$/ do |text|
|
@@ -195,7 +195,7 @@ module Redcar
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def create_undo_manager
|
198
|
-
@undo_manager = JFace::Text::TextViewerUndoManager.new(
|
198
|
+
@undo_manager = JFace::Text::TextViewerUndoManager.new(5000)
|
199
199
|
@undo_manager.connect(@mate_text.viewer)
|
200
200
|
end
|
201
201
|
|
@@ -527,7 +527,7 @@ module Redcar
|
|
527
527
|
def biggest_visible_line
|
528
528
|
@mate_text.viewer.get_bottom_index
|
529
529
|
end
|
530
|
-
|
530
|
+
|
531
531
|
def ensure_visible(offset)
|
532
532
|
line = @document.line_at_offset(offset)
|
533
533
|
line_start_offset = @document.offset_at_line(line)
|
@@ -21,6 +21,11 @@ module Redcar
|
|
21
21
|
self.skip_types = options['skip_types'] || [:executable, :mountpoint, :symlink, :zero]
|
22
22
|
end
|
23
23
|
|
24
|
+
def directory?(pathname)
|
25
|
+
f = java.io.File.new(pathname.path.to_java)
|
26
|
+
f.directory?
|
27
|
+
end
|
28
|
+
|
24
29
|
def each_file(&block)
|
25
30
|
file_index, excluded_paths = 0, []
|
26
31
|
structure = Dir.glob("#{root_path}/**/*", File::FNM_DOTMATCH)
|
@@ -29,7 +34,7 @@ module Redcar
|
|
29
34
|
next if excluded_paths.any? { |ep| fullpath =~ /^#{Regexp.escape(ep)}(\/|$)/ }
|
30
35
|
path = Pathname.new(fullpath)
|
31
36
|
is_excluded_pattern = excluded_patterns.any? { |pattern| fullpath =~ pattern }
|
32
|
-
if
|
37
|
+
if directory?(path)
|
33
38
|
excluded_paths << path if excluded_dirs.include?(path.basename.to_s) || is_excluded_pattern
|
34
39
|
else
|
35
40
|
skipped = skip_types.find { |st| path.send("#{st}?") }
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
Then /I should see "(.*)" in the web view/ do |expected|
|
3
|
+
body.include?(expected)
|
4
|
+
end
|
5
|
+
|
6
|
+
Given /^I fill in "(.*)" with "(.*)" in the web view$/ do |field, value|
|
7
|
+
fill_in(field, :with => value)
|
8
|
+
end
|
9
|
+
|
10
|
+
When /I press "(.*)" in the web view/ do |button_name|
|
11
|
+
click_button(button_name)
|
12
|
+
end
|