gd_bam 0.1.16 → 0.1.17
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/errors.rb +8 -0
- data/lib/base/tap.rb +12 -10
- data/templates/flow.rb.erb +1 -1
- metadata +2 -2
data/lib/bam/version.rb
CHANGED
data/lib/base/errors.rb
CHANGED
@@ -11,5 +11,13 @@ module GoodData
|
|
11
11
|
@field = options[:field]
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
class IdInTapNotPresentError < RuntimeError
|
16
|
+
|
17
|
+
def initialize(tap)
|
18
|
+
super("Every tap needs to have an output field Id defined. Tap \"#{tap[:id]}\" does not have one.")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
14
22
|
end
|
15
23
|
end
|
data/lib/base/tap.rb
CHANGED
@@ -140,16 +140,18 @@ module GoodData
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def self.prepare_for_sf_downloader(tap)
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
fields = fields.map {|f| f[:name] ==
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
143
|
+
# begin
|
144
|
+
id_field = Tap.find_output_field(tap, "Id")
|
145
|
+
fail IdInTapNotPresentError.new(tap) if id_field.nil?
|
146
|
+
time_field = Tap.find_output_field(tap, "Timestamp")
|
147
|
+
tap = Tap.remove_acts_as(tap)
|
148
|
+
fields = tap[:fields].map {|f| f[:name] == id_field[:name] ? f.merge(:acts_as => ["Id"]) : f}
|
149
|
+
if time_field
|
150
|
+
fields = fields.map {|f| f[:name] == time_field[:name] ? f.merge(:acts_as => ["Timestamp"]) : f}
|
151
|
+
end
|
152
|
+
Tap.create(tap.merge({
|
153
|
+
:fields => fields
|
154
|
+
}))
|
153
155
|
end
|
154
156
|
|
155
157
|
def self.prepare_for_es_downloader(tap)
|
data/templates/flow.rb.erb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gd_bam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|