lib/core/plugin/project.rb in nucleon-0.1.10 vs lib/core/plugin/project.rb in nucleon-0.1.11
- old
+ new
@@ -47,10 +47,15 @@
myself.plugin_name = path if ! plugin_name || plugin_name == plugin_provider
ui.resource = plugin_name
logger = plugin_name
+ unless reload
+ @cache = Util::Cache.new(directory, Nucleon.sha1(plugin_name), '.project_cache')
+ init_cache
+ end
+
if keys = delete(:keys, nil)
set(:private_key, keys[:private_key])
set(:public_key, keys[:public_key])
end
@@ -115,10 +120,16 @@
protected :project_directory?
#-----------------------------------------------------------------------------
# Property accessor / modifiers
+ def cache
+ @cache
+ end
+
+ #---
+
def reference
get(:reference, nil)
end
#---
@@ -296,10 +307,17 @@
protected :subproject_config
#-----------------------------------------------------------------------------
# Project operations
+ def init_cache
+ # Override in providers if needed
+ end
+ protected :init_cache
+
+ #---
+
def init_auth
if can_persist?
localize do
logger.info("Initializing project #{name} authorization")
yield if block_given?
@@ -441,9 +459,18 @@
logger.warn("Project #{name} does not meet the criteria for persistence and can be committed to")
end
success
end
+ #---
+
+ def ignore(files)
+ return unless directory
+ files = nil
+ files = yield if block_given?
+ commit(files, { :message => "Adding project ignores." }) if files
+ end
+
#-----------------------------------------------------------------------------
# Subproject operations
def load_subprojects(options = {})
subprojects = {}