plugins/textmate/lib/textmate.rb in redcar-0.5 vs plugins/textmate/lib/textmate.rb in redcar-0.5.1dev
- old
+ new
@@ -2,13 +2,18 @@
require 'textmate/bundle'
require 'textmate/environment'
require 'textmate/plist'
require 'textmate/preference'
require 'textmate/snippet'
-require 'textmate/tree_mirror'
-require 'textmate/commands'
-
+begin
+ require 'textmate/tree_mirror'
+ require 'textmate/commands'
+rescue NameError => e
+ puts "Textmate plugin loading deferred until core loading is complete"
+ # In the installer we don't have all of core loaded yet
+end
+
module Redcar
module Textmate
def self.all_bundle_paths
Dir[File.join(Redcar.root, "plugins", "textmate", "vendor", "redcar-bundles", "Bundles", "*")] +
Dir[File.join(Redcar.user_dir, "Bundles", "*")]
@@ -152,28 +157,32 @@
end
res
end
end
- class InstalledBundles < Redcar::Command
- def execute
- controller = Controller.new
- tab = win.new_tab(HtmlTab)
- tab.html_view.controller = controller
- tab.focus
- end
+ begin
+ class InstalledBundles < Redcar::Command
+ def execute
+ controller = Controller.new
+ tab = win.new_tab(HtmlTab)
+ tab.html_view.controller = controller
+ tab.focus
+ end
- class Controller
- include Redcar::HtmlController
+ class Controller
+ include Redcar::HtmlController
- def title
- "Installed Bundles"
- end
+ def title
+ "Installed Bundles"
+ end
- def index
- rhtml = ERB.new(File.read(File.join(File.dirname(__FILE__), "..", "views", "installed_bundles.html.erb")))
- rhtml.result(binding)
+ def index
+ rhtml = ERB.new(File.read(File.join(File.dirname(__FILE__), "..", "views", "installed_bundles.html.erb")))
+ rhtml.result(binding)
+ end
end
end
+ rescue NameError => e
+ puts "Textmate plugin loading deferred until core loading is complete"
end
end
end