lib/travis/keychain.rb in travis-deploy-0.1.0 vs lib/travis/keychain.rb in travis-deploy-0.2.0

- old
+ new

@@ -13,10 +13,33 @@ def fetch chdir { pull } read end + def source + @source ||= fetch + end + + def includes(name) + include_files[name] + end + protected + + def include_files + @include_files ||= begin + contents = {} + + chdir do + Dir['config/includes/*.yml'].each do |path| + name = File.basename(path).sub(/\.yml$/, '') + contents[name] = YAML.load(File.read(path)) + end + end + + contents + end + end def pull error 'There are unstaged changes in your travis-keychain working directory.' unless clean? say 'Fetching the keychain ...' run 'git pull'