gooddata 0.6.19 → 0.6.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -0
- data/Rakefile +17 -3
- data/gooddata.gemspec +8 -7
- data/lib/gooddata/bricks/middleware/base_middleware.rb +1 -1
- data/lib/gooddata/cli/commands/run_ruby_cmd.rb +2 -2
- data/lib/gooddata/cli/shared.rb +2 -1
- data/lib/gooddata/commands/auth.rb +58 -5
- data/lib/gooddata/commands/runners.rb +2 -6
- data/lib/gooddata/extensions/big_decimal.rb +4 -0
- data/lib/gooddata/extensions/false.rb +11 -0
- data/lib/gooddata/extensions/hash.rb +6 -17
- data/lib/gooddata/extensions/nil.rb +11 -0
- data/lib/gooddata/extensions/numeric.rb +11 -0
- data/lib/gooddata/extensions/object.rb +11 -0
- data/lib/gooddata/extensions/symbol.rb +11 -0
- data/lib/gooddata/extensions/true.rb +11 -0
- data/lib/gooddata/helpers/auth_helpers.rb +32 -2
- data/lib/gooddata/helpers/data_helper.rb +1 -1
- data/lib/gooddata/helpers/global_helpers.rb +98 -31
- data/lib/gooddata/mixins/md_finders.rb +15 -15
- data/lib/gooddata/mixins/md_object_query.rb +12 -2
- data/lib/gooddata/models/blueprint/blueprint_field.rb +2 -2
- data/lib/gooddata/models/blueprint/dataset_blueprint.rb +2 -2
- data/lib/gooddata/models/blueprint/project_blueprint.rb +3 -3
- data/lib/gooddata/models/blueprint/schema_blueprint.rb +1 -1
- data/lib/gooddata/models/datawarehouse.rb +1 -0
- data/lib/gooddata/models/domain.rb +13 -16
- data/lib/gooddata/models/from_wire.rb +0 -2
- data/lib/gooddata/models/membership.rb +1 -1
- data/lib/gooddata/models/metadata/attribute.rb +1 -1
- data/lib/gooddata/models/metadata/dashboard.rb +1 -1
- data/lib/gooddata/models/metadata/dataset.rb +1 -1
- data/lib/gooddata/models/metadata/dimension.rb +1 -1
- data/lib/gooddata/models/metadata/fact.rb +1 -1
- data/lib/gooddata/models/metadata/label.rb +16 -17
- data/lib/gooddata/models/metadata/metric.rb +1 -1
- data/lib/gooddata/models/metadata/report.rb +1 -1
- data/lib/gooddata/models/metadata/report_definition.rb +7 -7
- data/lib/gooddata/models/metadata/variable.rb +1 -1
- data/lib/gooddata/models/model.rb +2 -2
- data/lib/gooddata/models/profile.rb +2 -2
- data/lib/gooddata/models/project.rb +21 -23
- data/lib/gooddata/models/project_role.rb +3 -3
- data/lib/gooddata/models/schedule.rb +18 -4
- data/lib/gooddata/models/user_filters/mandatory_user_filter.rb +12 -15
- data/lib/gooddata/models/user_filters/user_filter.rb +8 -8
- data/lib/gooddata/models/user_filters/user_filter_builder.rb +16 -13
- data/lib/gooddata/models/user_filters/variable_user_filter.rb +1 -1
- data/lib/gooddata/rest/client.rb +4 -2
- data/lib/gooddata/rest/connection.rb +37 -30
- data/lib/gooddata/rest/connections/rest_client_connection.rb +1 -1
- data/lib/gooddata/version.rb +1 -1
- data/spec/environment/develop.rb +4 -4
- data/spec/environment/hotfix.rb +1 -1
- data/spec/environment/release.rb +1 -1
- data/spec/integration/full_project_spec.rb +3 -3
- data/spec/integration/over_to_user_filters_spec.rb +1 -0
- data/spec/integration/project_spec.rb +1 -1
- data/spec/integration/user_filters_spec.rb +0 -1
- data/spec/unit/commands/command_auth_spec.rb +10 -0
- data/spec/unit/extensions/hash_spec.rb +1 -1
- data/spec/unit/helpers_spec.rb +0 -8
- data/spec/unit/models/domain_spec.rb +1 -9
- data/spec/unit/models/from_wire_spec.rb +1 -19
- data/spec/unit/models/membership_spec.rb +1 -1
- data/spec/unit/models/metadata_spec.rb +1 -1
- data/spec/unit/models/profile_spec.rb +23 -47
- data/spec/unit/models/schedule_spec.rb +47 -3
- metadata +174 -50
- data/lib/gooddata/models/from_wire_parse.rb +0 -125
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# # encoding: UTF-8
|
|
2
|
-
#
|
|
3
|
-
# module GoodData
|
|
4
|
-
# module Model
|
|
5
|
-
# module FromWire
|
|
6
|
-
# # Converts anchor from wire format into an internal blueprint representation
|
|
7
|
-
# #
|
|
8
|
-
# # @param stuff [Hash] Whatever comes from wire
|
|
9
|
-
# # @return [Hash] Manifest for a particular reference
|
|
10
|
-
# def self.parse_anchor(stuff)
|
|
11
|
-
# attribute = stuff['dataset']['anchor']['attribute']
|
|
12
|
-
# if !attribute.key?('labels')
|
|
13
|
-
# []
|
|
14
|
-
# else
|
|
15
|
-
# labels = attribute['labels'] || []
|
|
16
|
-
# default_label = attribute['defaultLabel']
|
|
17
|
-
# primary_label_name = attribute['identifier'].split('.').last
|
|
18
|
-
# dataset_name = attribute['identifier'].split('.')[1]
|
|
19
|
-
# primary_label_identifier = GoodData::Model.identifier_for({ name: dataset_name }, type: :primary_label, name: primary_label_name)
|
|
20
|
-
# primary_labels, regular_labels = labels.partition { |x| x['label']['identifier'] == primary_label_identifier }
|
|
21
|
-
# dl = primary_labels.map do |label|
|
|
22
|
-
# parse_label(attribute, label, 'anchor', default_label)
|
|
23
|
-
# end
|
|
24
|
-
# rl = regular_labels.map do |label|
|
|
25
|
-
# parse_label(attribute, label, 'label', default_label)
|
|
26
|
-
# end
|
|
27
|
-
# dl + rl
|
|
28
|
-
# end
|
|
29
|
-
# end
|
|
30
|
-
#
|
|
31
|
-
# # Converts attrbutes from wire format into an internal blueprint representation
|
|
32
|
-
# #
|
|
33
|
-
# # @param stuff [Hash] Whatever comes from wire
|
|
34
|
-
# # @return [Hash] Manifest for a particular reference
|
|
35
|
-
# def self.parse_attributes(stuff)
|
|
36
|
-
# dataset = stuff['dataset']
|
|
37
|
-
# attributes = dataset['attributes'] || []
|
|
38
|
-
# attributes.mapcat do |a|
|
|
39
|
-
# attribute = a['attribute']
|
|
40
|
-
# labels = attribute['labels'] || []
|
|
41
|
-
# default_label = attribute['defaultLabel']
|
|
42
|
-
# primary_label_name = attribute['identifier'].split('.').last
|
|
43
|
-
# dataset_name = attribute['identifier'].split('.')[1]
|
|
44
|
-
# primary_label_identifier = GoodData::Model.identifier_for({ name: dataset_name }, type: :primary_label, name: primary_label_name)
|
|
45
|
-
# primary_labels, regular_labels = labels.partition { |x| x['label']['identifier'] == primary_label_identifier }
|
|
46
|
-
# dl = primary_labels.map do |label|
|
|
47
|
-
# parse_label(attribute, label, 'attribute', default_label)
|
|
48
|
-
# end
|
|
49
|
-
# rl = regular_labels.map do |label|
|
|
50
|
-
# parse_label(attribute, label, 'label', default_label)
|
|
51
|
-
# end
|
|
52
|
-
# dl + rl
|
|
53
|
-
# end
|
|
54
|
-
# end
|
|
55
|
-
#
|
|
56
|
-
# # Converts date dimensions from wire format into an internal blueprint representation
|
|
57
|
-
# #
|
|
58
|
-
# # @param stuff [Hash] Whatever comes from wire
|
|
59
|
-
# # @return [Hash] Manifest for a particular reference
|
|
60
|
-
# def self.parse_date_dimensions(stuff)
|
|
61
|
-
# {}.tap do |d|
|
|
62
|
-
# d[:type] = :date_dimension
|
|
63
|
-
# # d[:urn] = :date_dimension
|
|
64
|
-
# d[:name] = stuff['dateDimension']['name']
|
|
65
|
-
# d[:title] = stuff['dateDimension']['title'] if stuff['dateDimension']['title'] != d[:name].titleize
|
|
66
|
-
# end
|
|
67
|
-
# end
|
|
68
|
-
#
|
|
69
|
-
# # Converts facts from wire format into an internal blueprint representation
|
|
70
|
-
# #
|
|
71
|
-
# # @param stuff [Hash] Whatever comes from wire
|
|
72
|
-
# # @return [Hash] Manifest for a particular reference
|
|
73
|
-
# def self.parse_facts(stuff)
|
|
74
|
-
# facts = stuff['dataset']['facts'] || []
|
|
75
|
-
# facts.map do |fact|
|
|
76
|
-
# {}.tap do |f|
|
|
77
|
-
# f[:type] = fact['fact']['identifier'] =~ /^dt\./ ? :date_fact : :fact
|
|
78
|
-
# f[:name] = fact['fact']['identifier'].split('.').last
|
|
79
|
-
# f[:title] = fact['fact']['title'] if fact['fact']['title'] != fact['fact']['identifier'].split('.').last.titleize
|
|
80
|
-
# f[:gd_data_type] = fact['fact']['dataType'] if fact['fact'].key?('dataType')
|
|
81
|
-
# end
|
|
82
|
-
# end
|
|
83
|
-
# end
|
|
84
|
-
#
|
|
85
|
-
# # Converts label from wire format into an internal blueprint representation
|
|
86
|
-
# #
|
|
87
|
-
# # @param stuff [Hash] Whatever comes from wire
|
|
88
|
-
# # @return [Hash] Manifest for a particular reference
|
|
89
|
-
# def self.parse_label(attribute, label, type, default_label = nil)
|
|
90
|
-
# {}.tap do |l|
|
|
91
|
-
# l[:type] = type
|
|
92
|
-
# l[:reference] = attribute['identifier'].split('.').last if type == 'label'
|
|
93
|
-
# l[:name] = label['label']['identifier'].split('.').last
|
|
94
|
-
# l[:title] = label['label']['title'] if label['label']['title'] != label['label']['identifier'].split('.').last.titleize
|
|
95
|
-
# l[:gd_data_type] = label['label']['dataType'] if label['label'].key?('dataType')
|
|
96
|
-
# l[:gd_type] = label['label']['type'] if label['label'].key?('type')
|
|
97
|
-
# l[:default_label] = true if default_label == label['label']['identifier']
|
|
98
|
-
# end
|
|
99
|
-
# end
|
|
100
|
-
#
|
|
101
|
-
# # Converts label from wire format into an internal blueprint representation
|
|
102
|
-
# #
|
|
103
|
-
# # @param stuff [Hash] Whatever comes from wire
|
|
104
|
-
# # @return [Hash] Manifest for a particular reference
|
|
105
|
-
# def self.parse_references(stuff)
|
|
106
|
-
# references = stuff['dataset']['references'] || []
|
|
107
|
-
# references.map do |ref|
|
|
108
|
-
# if ref =~ /^dataset\./
|
|
109
|
-
# {
|
|
110
|
-
# :type => :reference,
|
|
111
|
-
# :name => ref.gsub(/^dataset\./, ''),
|
|
112
|
-
# :dataset => ref.gsub(/^dataset\./, '')
|
|
113
|
-
# }
|
|
114
|
-
# else
|
|
115
|
-
# {
|
|
116
|
-
# :type => :date,
|
|
117
|
-
# :name => ref.gsub(/^dataset\./, ''),
|
|
118
|
-
# :dataset => ref.gsub(/^dataset\./, '')
|
|
119
|
-
# }
|
|
120
|
-
# end
|
|
121
|
-
# end
|
|
122
|
-
# end
|
|
123
|
-
# end
|
|
124
|
-
# end
|
|
125
|
-
# end
|