Module: GoodData::Bam::Repository
- Defined in:
- lib/base/repo.rb
Class Method Summary collapse
Class Method Details
.create(repository) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/base/repo.rb', line 5 def self.create(repository) fail "repository has to have \"type\" defined. You specified \"#{repository}\"" unless repository.has_key?(:type) case repository[:type] when :file repository.merge({ :base => Pathname(repository[:base])}) when :hash fail "Repo has to have content defined" if repository[:content].nil? || !repository[:content].is_a?(Hash) repository end end |
.find(repository, path) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/base/repo.rb', line 17 def self.find(repository, path) case repository[:type] when :file path = repository[:base] + Pathname(path) if (path).exist? Graph.create({ :path => Pathname(path)., :repository => repository }) end when :hash Graph.create(repository[:content][path]) else fail "not implemented" end end |