lib/docman/commands/command.rb in docman-0.0.76 vs lib/docman/commands/command.rb in docman-0.0.77
- old
+ new
@@ -65,15 +65,18 @@
end
end
end
def add_action(name, hook, context = nil)
- hook['order'] = 0 unless hook['order']
- if @hooks.has_key? name
- @hooks[name] << hook
- else
- @hooks[name] = [hook]
+ version = Docman::Application.instance.config.version
+ unless hook['version'].nil? || hook['version'] != version
+ hook['order'] = 0 unless hook['order']
+ if @hooks.has_key? name
+ @hooks[name] << hook
+ else
+ @hooks[name] = [hook]
+ end
end
end
def run_actions(name)
if @hooks.has_key?(name) and not @hooks[name].nil?
@@ -135,9 +138,10 @@
value.gsub!('$ROOT$', @context['docroot_config'].root['full_build_path']) unless @context['docroot_config'].root['full_build_path'].nil?
value.gsub!('$DOCROOT$', @context['docroot_config'].docroot_dir) unless @context['docroot_config'].docroot_dir.nil?
value.gsub!('$PROJECT$', @context['full_build_path']) unless @context['full_build_path'].nil?
value.gsub!('$INFO$', @context['full_path']) unless @context['full_path'].nil?
value.gsub!('$ENVIRONMENT$', @context.environment_name) unless @context.environment_name.nil?
+ value.gsub!('$DOCMAN_BIN$', Application::bin)
end
end
end
\ No newline at end of file