gd_bam 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bam/version.rb +1 -1
- data/lib/base/project.rb +9 -0
- metadata +1 -1
data/lib/bam/version.rb
CHANGED
data/lib/base/project.rb
CHANGED
@@ -47,6 +47,15 @@ module GoodData
|
|
47
47
|
taps = Pathname.glob(p + "*.json").map do |p|
|
48
48
|
Tap.create(JSON.parse(File.read(p), :symbolize_names => true))
|
49
49
|
end
|
50
|
+
|
51
|
+
groups = taps.group_by {|t| t[:id]}.map {|k,v| [k, v.count]}
|
52
|
+
bad_groups = groups.find_all do |group|
|
53
|
+
group[1] > 1
|
54
|
+
end
|
55
|
+
unless bad_groups.empty?
|
56
|
+
fail "There are several taps that have the same id. Namely #{bad_groups.map {|g| g.first}.join(', ')}. The ids of taps need to be unique."
|
57
|
+
end
|
58
|
+
|
50
59
|
Project.create(project.merge({:taps => taps.map {|tap| Tap.create(tap)}}))
|
51
60
|
end
|
52
61
|
|