redcar 0.11.0dev → 0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. data/CHANGES +14 -1
  2. data/README.md +28 -8
  3. data/Rakefile +23 -18
  4. data/bin/redcar +9 -4
  5. data/lib/redcar.rb +42 -4
  6. data/lib/redcar/installer.rb +7 -2
  7. data/lib/redcar/logger.rb +64 -0
  8. data/lib/redcar/runner.rb +17 -8
  9. data/lib/redcar/usage.rb +2 -0
  10. data/plugins/application/features/step_definitions/tree_steps.rb +4 -4
  11. data/plugins/application/features/support/env.rb +6 -6
  12. data/plugins/application/lib/application.rb +31 -3
  13. data/plugins/application/lib/application/command.rb +6 -0
  14. data/plugins/application/lib/application/command/executor.rb +0 -1
  15. data/plugins/application/lib/application/commands/application_commands.rb +21 -0
  16. data/plugins/application/lib/application/commands/notebook_commands.rb +73 -0
  17. data/plugins/application/lib/application/commands/tab_commands.rb +105 -0
  18. data/plugins/application/lib/application/commands/treebook_commands.rb +117 -0
  19. data/plugins/application/lib/application/commands/window_commands.rb +68 -0
  20. data/plugins/{tree/lib → application/lib/application}/tree.rb +0 -4
  21. data/plugins/{tree/lib → application/lib/application}/tree/command.rb +0 -0
  22. data/plugins/{tree/lib → application/lib/application}/tree/controller.rb +0 -0
  23. data/plugins/{tree/lib → application/lib/application}/tree/mirror.rb +0 -0
  24. data/plugins/application/spec/application/keymap/builder_spec.rb +1 -1
  25. data/plugins/application/spec/application/menu/builder_spec.rb +2 -2
  26. data/plugins/application_swt/lib/application_swt.rb +4 -2
  27. data/plugins/application_swt/lib/swt/vtab_label.rb +6 -3
  28. data/plugins/auto_indenter/lib/auto_indenter/document_controller.rb +6 -3
  29. data/plugins/clojure/lib/clojure.rb +2 -2
  30. data/plugins/core/lib/core.rb +0 -4
  31. data/plugins/core/lib/core/gui.rb +2 -4
  32. data/plugins/core/lib/core/plugin/storage.rb +68 -21
  33. data/plugins/core/spec/core/base_storage_spec.rb +81 -0
  34. data/plugins/core/spec/core/shared_storage_spec.rb +49 -0
  35. data/plugins/core/spec/core/storage_spec.rb +13 -63
  36. data/plugins/declarations/lib/declarations.rb +3 -1
  37. data/plugins/document_search/features/replace.feature +29 -20
  38. data/plugins/document_search/lib/document_search/find_speedbar.rb +4 -1
  39. data/plugins/edit_view/features/indentation_commands.feature +6 -5
  40. data/plugins/edit_view/features/step_definitions/notebook_steps.rb +4 -4
  41. data/plugins/edit_view/features/step_definitions/tab_steps.rb +7 -7
  42. data/plugins/edit_view/features/step_definitions/window_steps.rb +2 -2
  43. data/plugins/edit_view/lib/edit_view.rb +15 -1
  44. data/plugins/edit_view/lib/edit_view/modified_tabs_checker.rb +7 -7
  45. data/plugins/edit_view_swt/lib/edit_view_swt.rb +7 -6
  46. data/plugins/execute_current_tab/lib/execute_current_tab.rb +1 -1
  47. data/plugins/groovy/lib/groovy.rb +3 -3
  48. data/plugins/groovy/lib/groovy/commands.rb +1 -1
  49. data/plugins/help/lib/help/view_controller.rb +5 -0
  50. data/plugins/help/views/index.html.erb +10 -1
  51. data/plugins/html_view/features/step_definitions/html_view_steps.rb +1 -1
  52. data/plugins/html_view/features/support/env.rb +0 -15
  53. data/plugins/html_view/lib/html_view.rb +3 -4
  54. data/plugins/html_view/lib/html_view/commands.rb +1 -1
  55. data/plugins/key_bindings/lib/key_bindings.rb +34 -0
  56. data/plugins/key_bindings/plugin.rb +8 -0
  57. data/plugins/{tree → key_bindings}/spec/spec_helper.rb +0 -0
  58. data/plugins/line_tools/features/lower_text.feature +3 -4
  59. data/plugins/line_tools/lib/line_tools.rb +6 -5
  60. data/plugins/mirah/lib/mirah.rb +2 -2
  61. data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +5 -3
  62. data/plugins/project/features/open_directory_tree.feature +1 -1
  63. data/plugins/project/features/step_definitions/file_steps.rb +5 -5
  64. data/plugins/project/features/step_definitions/find_file_steps.rb +2 -3
  65. data/plugins/project/features/support/env.rb +4 -0
  66. data/plugins/project/lib/project.rb +15 -9
  67. data/plugins/project/lib/project/commands.rb +46 -16
  68. data/plugins/project/lib/project/dir_controller.rb +1 -1
  69. data/plugins/project/lib/project/dir_mirror.rb +3 -2
  70. data/plugins/project/lib/project/drb_service.rb +3 -1
  71. data/plugins/project/lib/project/file_list.rb +99 -21
  72. data/plugins/project/lib/project/find_file_dialog.rb +8 -24
  73. data/plugins/project/lib/project/manager.rb +68 -12
  74. data/plugins/project/lib/project/project_tree_controller.rb +1 -1
  75. data/plugins/project/plugin.rb +1 -2
  76. data/plugins/project_search/features/word_search.feature +1 -1
  77. data/plugins/project_search/lib/project_search.rb +16 -6
  78. data/plugins/project_search/lib/project_search/commands.rb +15 -28
  79. data/plugins/project_search/lib/project_search/hit.rb +4 -0
  80. data/plugins/project_search/lib/project_search/lucene_index.rb +14 -4
  81. data/plugins/project_search/lib/project_search/views/_file.html.erb +11 -11
  82. data/plugins/project_search/lib/project_search/word_search.rb +22 -4
  83. data/plugins/project_search/spec/project_search/word_search_spec.rb +2 -2
  84. data/plugins/redcar/redcar.rb +140 -588
  85. data/plugins/repl/features/step_definitions/repl_steps.rb +3 -3
  86. data/plugins/repl/features/support/fake_repl.rb +1 -1
  87. data/plugins/ruby/lib/ruby.rb +4 -4
  88. data/plugins/runnables/features/fixtures/alternate.ruby +1 -0
  89. data/plugins/runnables/features/fixtures/line_app.rb +1 -0
  90. data/plugins/runnables/features/fixtures/name_app.rb +1 -0
  91. data/plugins/runnables/features/fixtures/params_app.rb +1 -0
  92. data/plugins/runnables/features/fixtures/runnable_app.rb +1 -0
  93. data/plugins/runnables/lib/runnables.rb +21 -0
  94. data/plugins/runnables/lib/runnables/command_output_controller.rb +14 -9
  95. data/plugins/runnables/lib/runnables/output_processor.rb +4 -4
  96. data/plugins/runnables/lib/runnables/running_process_checker.rb +6 -6
  97. data/plugins/runnables/plugin.rb +1 -2
  98. data/plugins/scm/lib/scm.rb +18 -18
  99. data/plugins/scm/lib/scm/commit_mirror.rb +2 -2
  100. data/plugins/scm/lib/scm/scm_changes_controller.rb +1 -1
  101. data/plugins/scm_hg/lib/scm_hg.rb +1 -1
  102. data/plugins/snippets/lib/snippets/document_controller.rb +46 -40
  103. data/plugins/swt/lib/swt.rb +2 -0
  104. data/plugins/test_runner/lib/test_runner.rb +1 -0
  105. data/plugins/test_runner/lib/test_runner/jasmine_test_runner.rb +15 -0
  106. data/plugins/test_runner/lib/test_runner/runnable_test_runner.rb +21 -5
  107. data/plugins/textmate/lib/textmate.rb +5 -1
  108. data/plugins/textmate/lib/textmate/preference.rb +4 -0
  109. data/plugins/textmate/lib/textmate/snippet.rb +0 -2
  110. data/plugins/textmate/lib/textmate/tree_mirror.rb +6 -5
  111. data/plugins/textmate/plugin.rb +1 -1
  112. data/plugins/textmate/vendor/redcar-bundles/Bundles/C.tmbundle/Syntaxes/C.plist +2 -2
  113. data/plugins/textmate/vendor/redcar-bundles/Bundles/Clojure.tmbundle/info.plist +2 -0
  114. data/plugins/textmate/vendor/redcar-bundles/Bundles/Cucumber.tmbundle/Syntaxes/Cucumber_Plain_Text_Feature.tmLanguage +0 -4
  115. data/plugins/textmate/vendor/redcar-bundles/Bundles/Cucumber.tmbundle/info.plist +2 -0
  116. data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/info.plist +3 -1
  117. data/plugins/textmate/vendor/redcar-bundles/Bundles/Palm-WebOS-Development.tmbundle/info.plist +2 -0
  118. data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/info.plist +2 -0
  119. data/plugins/textmate/vendor/redcar-bundles/Bundles/SQL.tmbundle/info.plist +2 -0
  120. data/plugins/textmate/vendor/redcar-bundles/Bundles/Scala.tmbundle/info.plist +2 -0
  121. data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/Preferences/GNU_Smalltalk.tmPreferences +1 -1
  122. data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/Preferences/MIST_Smalltalk_Format.tmPreferences +1 -1
  123. data/plugins/textmate/vendor/redcar-bundles/Bundles/Smalltalk.tmbundle/info.plist +2 -0
  124. data/plugins/textmate/vendor/redcar-bundles/Bundles/Vala.tmbundle/info.plist +4 -2
  125. data/plugins/textmate/vendor/redcar-bundles/Bundles/Webrat.tmbundle/info.plist +2 -0
  126. data/plugins/textmate/vendor/redcar-bundles/Bundles/YAML.tmbundle/Syntaxes/YAML.plist +1 -0
  127. data/plugins/textmate/vendor/redcar-bundles/Bundles/groovy.tmbundle/info.plist +2 -0
  128. data/plugins/textmate/vendor/redcar-bundles/Themes/Twilight.tmTheme +0 -2
  129. data/plugins/todo_list/lib/todo_list.rb +3 -3
  130. data/plugins/todo_list/lib/todo_list/todo_controller.rb +1 -1
  131. data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +1 -1
  132. data/plugins/web_bookmarks/lib/web_bookmarks.rb +11 -4
  133. data/plugins/web_bookmarks/lib/web_bookmarks/commands.rb +1 -1
  134. data/plugins/web_bookmarks/plugin.rb +1 -2
  135. metadata +29 -20
  136. data/plugins/core/lib/core/logger.rb +0 -28
  137. data/plugins/file_parser/lib/file_parser.rb +0 -125
  138. data/plugins/file_parser/plugin.rb +0 -7
  139. 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
@@ -1,7 +0,0 @@
1
- Plugin.define do
2
- name "file_parser"
3
- version "0.2.0"
4
-
5
- object "Redcar::FileParser"
6
- file "lib", "file_parser"
7
- end
@@ -1,9 +0,0 @@
1
-
2
- Plugin.define do
3
- name "tree"
4
- version "1.0"
5
- file "lib", "tree"
6
- object "Redcar::Tree"
7
- dependencies "core", ">0",
8
- "application", ">0"
9
- end