Allow frameworks to be diabled via configuration directive

This commit is contained in:
Derek Collison 2011-04-18 22:44:22 -05:00
Родитель 7c11e6c76b
Коммит 3ce0df12f1
2 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,15 @@
require 'spec_helper'
describe "A Framework should be able to be disabled" do
it 'should not list a disabled framework' do
node_path = File.join(STAGING_TEMP, 'node.yml')
node_manifest = File.read(node_path)
node_manifest += "disabled: true"
File.open(node_path, 'w') {|f| f.write(node_manifest) }
StagingPlugin.load_all_manifests
manifests = StagingPlugin.manifests
manifests.should_not have_key 'node'
end
end

Просмотреть файл

@ -155,7 +155,11 @@ class StagingPlugin
def self.load_manifest(path)
framework = File.basename(path, '.yml')
m = YAML.load_file(path)
manifests[framework] = m
unless m['disabled']
manifests[framework] = m
else
manifests.delete(framework)
end
rescue
puts "Failed to load staging manifest for #{framework} from #{path.inspect}"
exit 1