redcar 0.11.0dev → 0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +14 -1
- data/README.md +28 -8
- data/Rakefile +23 -18
- data/bin/redcar +9 -4
- data/lib/redcar.rb +42 -4
- data/lib/redcar/installer.rb +7 -2
- data/lib/redcar/logger.rb +64 -0
- data/lib/redcar/runner.rb +17 -8
- data/lib/redcar/usage.rb +2 -0
- data/plugins/application/features/step_definitions/tree_steps.rb +4 -4
- data/plugins/application/features/support/env.rb +6 -6
- data/plugins/application/lib/application.rb +31 -3
- data/plugins/application/lib/application/command.rb +6 -0
- data/plugins/application/lib/application/command/executor.rb +0 -1
- data/plugins/application/lib/application/commands/application_commands.rb +21 -0
- data/plugins/application/lib/application/commands/notebook_commands.rb +73 -0
- data/plugins/application/lib/application/commands/tab_commands.rb +105 -0
- data/plugins/application/lib/application/commands/treebook_commands.rb +117 -0
- data/plugins/application/lib/application/commands/window_commands.rb +68 -0
- data/plugins/{tree/lib → application/lib/application}/tree.rb +0 -4
- data/plugins/{tree/lib → application/lib/application}/tree/command.rb +0 -0
- data/plugins/{tree/lib → application/lib/application}/tree/controller.rb +0 -0
- data/plugins/{tree/lib → application/lib/application}/tree/mirror.rb +0 -0
- data/plugins/application/spec/application/keymap/builder_spec.rb +1 -1
- data/plugins/application/spec/application/menu/builder_spec.rb +2 -2
- data/plugins/application_swt/lib/application_swt.rb +4 -2
- data/plugins/application_swt/lib/swt/vtab_label.rb +6 -3
- data/plugins/auto_indenter/lib/auto_indenter/document_controller.rb +6 -3
- data/plugins/clojure/lib/clojure.rb +2 -2
- data/plugins/core/lib/core.rb +0 -4
- data/plugins/core/lib/core/gui.rb +2 -4
- data/plugins/core/lib/core/plugin/storage.rb +68 -21
- data/plugins/core/spec/core/base_storage_spec.rb +81 -0
- data/plugins/core/spec/core/shared_storage_spec.rb +49 -0
- data/plugins/core/spec/core/storage_spec.rb +13 -63
- data/plugins/declarations/lib/declarations.rb +3 -1
- data/plugins/document_search/features/replace.feature +29 -20
- data/plugins/document_search/lib/document_search/find_speedbar.rb +4 -1
- data/plugins/edit_view/features/indentation_commands.feature +6 -5
- data/plugins/edit_view/features/step_definitions/notebook_steps.rb +4 -4
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +7 -7
- data/plugins/edit_view/features/step_definitions/window_steps.rb +2 -2
- data/plugins/edit_view/lib/edit_view.rb +15 -1
- data/plugins/edit_view/lib/edit_view/modified_tabs_checker.rb +7 -7
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +7 -6
- data/plugins/execute_current_tab/lib/execute_current_tab.rb +1 -1
- data/plugins/groovy/lib/groovy.rb +3 -3
- data/plugins/groovy/lib/groovy/commands.rb +1 -1
- data/plugins/help/lib/help/view_controller.rb +5 -0
- data/plugins/help/views/index.html.erb +10 -1
- data/plugins/html_view/features/step_definitions/html_view_steps.rb +1 -1
- data/plugins/html_view/features/support/env.rb +0 -15
- data/plugins/html_view/lib/html_view.rb +3 -4
- data/plugins/html_view/lib/html_view/commands.rb +1 -1
- data/plugins/key_bindings/lib/key_bindings.rb +34 -0
- data/plugins/key_bindings/plugin.rb +8 -0
- data/plugins/{tree → key_bindings}/spec/spec_helper.rb +0 -0
- data/plugins/line_tools/features/lower_text.feature +3 -4
- data/plugins/line_tools/lib/line_tools.rb +6 -5
- data/plugins/mirah/lib/mirah.rb +2 -2
- data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +5 -3
- data/plugins/project/features/open_directory_tree.feature +1 -1
- data/plugins/project/features/step_definitions/file_steps.rb +5 -5
- data/plugins/project/features/step_definitions/find_file_steps.rb +2 -3
- data/plugins/project/features/support/env.rb +4 -0
- data/plugins/project/lib/project.rb +15 -9
- data/plugins/project/lib/project/commands.rb +46 -16
- data/plugins/project/lib/project/dir_controller.rb +1 -1
- data/plugins/project/lib/project/dir_mirror.rb +3 -2
- data/plugins/project/lib/project/drb_service.rb +3 -1
- data/plugins/project/lib/project/file_list.rb +99 -21
- data/plugins/project/lib/project/find_file_dialog.rb +8 -24
- data/plugins/project/lib/project/manager.rb +68 -12
- data/plugins/project/lib/project/project_tree_controller.rb +1 -1
- data/plugins/project/plugin.rb +1 -2
- data/plugins/project_search/features/word_search.feature +1 -1
- data/plugins/project_search/lib/project_search.rb +16 -6
- data/plugins/project_search/lib/project_search/commands.rb +15 -28
- data/plugins/project_search/lib/project_search/hit.rb +4 -0
- data/plugins/project_search/lib/project_search/lucene_index.rb +14 -4
- data/plugins/project_search/lib/project_search/views/_file.html.erb +11 -11
- data/plugins/project_search/lib/project_search/word_search.rb +22 -4
- data/plugins/project_search/spec/project_search/word_search_spec.rb +2 -2
- data/plugins/redcar/redcar.rb +140 -588
- data/plugins/repl/features/step_definitions/repl_steps.rb +3 -3
- data/plugins/repl/features/support/fake_repl.rb +1 -1
- data/plugins/ruby/lib/ruby.rb +4 -4
- data/plugins/runnables/features/fixtures/alternate.ruby +1 -0
- data/plugins/runnables/features/fixtures/line_app.rb +1 -0
- data/plugins/runnables/features/fixtures/name_app.rb +1 -0
- data/plugins/runnables/features/fixtures/params_app.rb +1 -0
- data/plugins/runnables/features/fixtures/runnable_app.rb +1 -0
- data/plugins/runnables/lib/runnables.rb +21 -0
- data/plugins/runnables/lib/runnables/command_output_controller.rb +14 -9
- data/plugins/runnables/lib/runnables/output_processor.rb +4 -4
- data/plugins/runnables/lib/runnables/running_process_checker.rb +6 -6
- data/plugins/runnables/plugin.rb +1 -2
- data/plugins/scm/lib/scm.rb +18 -18
- data/plugins/scm/lib/scm/commit_mirror.rb +2 -2
- data/plugins/scm/lib/scm/scm_changes_controller.rb +1 -1
- data/plugins/scm_hg/lib/scm_hg.rb +1 -1
- data/plugins/snippets/lib/snippets/document_controller.rb +46 -40
- data/plugins/swt/lib/swt.rb +2 -0
- data/plugins/test_runner/lib/test_runner.rb +1 -0
- data/plugins/test_runner/lib/test_runner/jasmine_test_runner.rb +15 -0
- data/plugins/test_runner/lib/test_runner/runnable_test_runner.rb +21 -5
- data/plugins/textmate/lib/textmate.rb +5 -1
- data/plugins/textmate/lib/textmate/preference.rb +4 -0
- data/plugins/textmate/lib/textmate/snippet.rb +0 -2
- data/plugins/textmate/lib/textmate/tree_mirror.rb +6 -5
- data/plugins/textmate/plugin.rb +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/C.tmbundle/Syntaxes/C.plist +2 -2
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Clojure.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Plain_Text_Feature.tmLanguage +0 -4
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Cucumber.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/info.plist +3 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Palm-WebOS-Development.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/SQL.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Scala.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/Preferences/GNU_Smalltalk.tmPreferences +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/Preferences/MIST_Smalltalk_Format.tmPreferences +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Vala.tmbundle/info.plist +4 -2
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Webrat.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/YAML.tmbundle/Syntaxes/YAML.plist +1 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/groovy.tmbundle/info.plist +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Themes/Twilight.tmTheme +0 -2
- data/plugins/todo_list/lib/todo_list.rb +3 -3
- data/plugins/todo_list/lib/todo_list/todo_controller.rb +1 -1
- data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +1 -1
- data/plugins/web_bookmarks/lib/web_bookmarks.rb +11 -4
- data/plugins/web_bookmarks/lib/web_bookmarks/commands.rb +1 -1
- data/plugins/web_bookmarks/plugin.rb +1 -2
- metadata +29 -20
- data/plugins/core/lib/core/logger.rb +0 -28
- data/plugins/file_parser/lib/file_parser.rb +0 -125
- data/plugins/file_parser/plugin.rb +0 -7
- data/plugins/tree/plugin.rb +0 -9
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'logger'
|
2
|
-
|
3
|
-
module Redcar
|
4
|
-
def self.logger
|
5
|
-
Core::Logger.root_logger
|
6
|
-
end
|
7
|
-
|
8
|
-
class Core
|
9
|
-
module HasLogger
|
10
|
-
def logger
|
11
|
-
Core::Logger.root_logger
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module Logger
|
16
|
-
def self.init
|
17
|
-
level = ENV["REDCAR_LOG"] || "error"
|
18
|
-
root_logger.level = ::Logger::ERROR
|
19
|
-
# appender = Logging::Appenders.stdout(:level => level)
|
20
|
-
# root_logger.add_appenders(appender)
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.root_logger
|
24
|
-
@logger ||= ::Logger.new(STDOUT)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,125 +0,0 @@
|
|
1
|
-
require 'pathname'
|
2
|
-
|
3
|
-
module Redcar
|
4
|
-
class FileParser
|
5
|
-
|
6
|
-
attr_accessor :root_path, :excluded_dirs, :excluded_files, :excluded_patterns, :skip_types
|
7
|
-
|
8
|
-
def self.measure(message, &block)
|
9
|
-
require 'benchmark'
|
10
|
-
r = nil
|
11
|
-
b = Benchmark.measure { r = yield }
|
12
|
-
puts message + ": " + b.to_s
|
13
|
-
r
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(root_path, options = {})
|
17
|
-
self.root_path = root_path.to_s
|
18
|
-
self.excluded_dirs = options['excluded_dirs'] || ['.git', '.svn', '.redcar']
|
19
|
-
self.excluded_files = options['excluded_files'] || []
|
20
|
-
self.excluded_patterns = options['excluded_patterns'] || [/tags$/, /\.log$/]
|
21
|
-
self.skip_types = options['skip_types'] || [:executable, :mountpoint, :symlink, :zero]
|
22
|
-
end
|
23
|
-
|
24
|
-
def directory?(pathname)
|
25
|
-
f = java.io.File.new(pathname.path.to_java)
|
26
|
-
f.directory?
|
27
|
-
end
|
28
|
-
|
29
|
-
def each_file(&block)
|
30
|
-
file_index, excluded_paths = 0, []
|
31
|
-
structure = Dir.glob("#{root_path}/**/*", File::FNM_DOTMATCH)
|
32
|
-
structure.sort.each do |path|
|
33
|
-
fullpath = File.expand_path(path)
|
34
|
-
next if excluded_paths.any? { |ep| fullpath =~ /^#{Regexp.escape(ep)}(\/|$)/ }
|
35
|
-
path = Pathname.new(fullpath)
|
36
|
-
is_excluded_pattern = excluded_patterns.any? { |pattern| fullpath =~ pattern }
|
37
|
-
if directory?(path)
|
38
|
-
excluded_paths << path if excluded_dirs.include?(path.basename.to_s) || is_excluded_pattern
|
39
|
-
else
|
40
|
-
skipped = skip_types.find { |st| path.send("#{st}?") }
|
41
|
-
excluded = excluded_files.include?(path.basename.to_s) || is_excluded_pattern
|
42
|
-
unless !path.readable? || path.read.is_binary_data? || skipped || excluded
|
43
|
-
yield(FileResult.new(path, file_index))
|
44
|
-
file_index += 1
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def each_line(&block)
|
51
|
-
each_file do |file|
|
52
|
-
file.each_line do |line|
|
53
|
-
yield(line)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
class FileResult
|
59
|
-
|
60
|
-
attr_reader :path, :index, :lines, :lines_size
|
61
|
-
|
62
|
-
def initialize(path, index)
|
63
|
-
@path, @index = path, index
|
64
|
-
@lines = @path.read.split("\n")
|
65
|
-
@lines_size = @lines.size
|
66
|
-
end
|
67
|
-
|
68
|
-
def num
|
69
|
-
index + 1
|
70
|
-
end
|
71
|
-
|
72
|
-
def name
|
73
|
-
@project_path ||= Project::Manager.focussed_project.path
|
74
|
-
path.realpath.to_s.gsub("#{@project_path}/", '')
|
75
|
-
end
|
76
|
-
|
77
|
-
def each_line(&block)
|
78
|
-
lines.each_with_index do |text, index|
|
79
|
-
yield(LineResult.new(self, index, text))
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def inspect
|
84
|
-
"#<FileResult path=#{path.to_s} index=#{index} lines=#{lines.size}>"
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
class LineResult
|
90
|
-
|
91
|
-
attr_reader :file, :index, :text
|
92
|
-
|
93
|
-
def initialize(file, index, text)
|
94
|
-
@file, @index, @text = file, index, text
|
95
|
-
end
|
96
|
-
|
97
|
-
def num
|
98
|
-
index + 1
|
99
|
-
end
|
100
|
-
|
101
|
-
def context(amount = 5)
|
102
|
-
from, to = (index - amount), (index + amount)
|
103
|
-
from = 0 if from < 0
|
104
|
-
last_line_index = (file.lines_size - 1)
|
105
|
-
to = last_line_index if to > last_line_index
|
106
|
-
|
107
|
-
before, after, range = Array.new, Array.new, (from..to)
|
108
|
-
lines = file.lines[range]
|
109
|
-
range.each_with_index do |ri, li|
|
110
|
-
next if ri == index
|
111
|
-
line = LineResult.new(file, ri, lines[li])
|
112
|
-
(ri < index) ? (before << line) : (after << line)
|
113
|
-
end
|
114
|
-
|
115
|
-
{ :before => before, :after => after }
|
116
|
-
end
|
117
|
-
|
118
|
-
def inspect
|
119
|
-
"#<LineResult index=#{index} file=#{file.to_s}>"
|
120
|
-
end
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
125
|
-
end
|