Module: GoodData::CloverGenerator::Repo

Defined in:
lib/repository/repo.rb

Class Method Summary collapse

Class Method Details

.load(path) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/repository/repo.rb', line 9

def self.load(path)
  definitions = nil
  FileUtils.cd(path) do
    definitions = Dir.glob('*.json').map do |f|
      parse(File.read(f))
    end
  end
  definitions 
end

.parse(json_definition) ⇒ Object



5
6
7
# File 'lib/repository/repo.rb', line 5

def self.parse(json_definition)
  JSON.parse(json_definition, :symbolize_names => true)
end