goodot 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2016 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ require_relative '../../version'
8
+ require_relative '../shared'
9
+
10
+ module GoodData
11
+ module GoodotCLI
12
+ desc 'Print version info'
13
+ skips_pre
14
+ command :version do |c|
15
+ c.action do |_global_options, _options, _args|
16
+ puts GoodData::Goodot::VERSION
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,93 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2016 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ require 'gli'
8
+ require 'pathname'
9
+
10
+ require_relative '../version'
11
+
12
+ module GoodData
13
+ module GoodotCLI
14
+ extend GLI::App
15
+
16
+ desc 'GoodData user name'
17
+ default_value nil
18
+ arg_name 'gooddata-login'
19
+ flag [:U, :username, :login]
20
+
21
+ desc 'GoodData password'
22
+ default_value nil
23
+ arg_name 'gooddata-password'
24
+ flag [:P, :password]
25
+
26
+ desc 'Project pid'
27
+ default_value nil
28
+ arg_name 'project-id'
29
+ flag [:p, :project_id]
30
+
31
+ desc 'Server'
32
+ default_value nil
33
+ arg_name 'server'
34
+ flag [:s, :server]
35
+
36
+ desc 'Domain'
37
+ default_value nil
38
+ arg_name 'domain'
39
+ flag [:d, :domain]
40
+
41
+ desc 'Verbose mode'
42
+ arg_name 'verbose'
43
+ switch [:v, :verbose]
44
+
45
+ desc 'Http logger on stdout'
46
+ arg_name 'http-logger'
47
+ default_value false
48
+ switch [:l, 'http-logger']
49
+
50
+ desc 'Http logger on stdout'
51
+ arg_name 'logger'
52
+ default_value true
53
+ switch ['verify-ssl']
54
+
55
+ pre do |global_options, _command, _options, _args|
56
+ require 'gooddata'
57
+ GoodData.logging_http_on if global_options[:'http-logger']
58
+ client = GoodData.connect(login: global_options[:login],
59
+ password: global_options[:password],
60
+ server: global_options[:server],
61
+ verify_ssl: global_options['verify-ssl'])
62
+ domain = client.domain(global_options[:domain])
63
+ global_options[:gd_client] = client
64
+ global_options[:gd_domain] = domain
65
+ true
66
+ end
67
+
68
+ def self.create_api_error_message(e)
69
+ HighLine.color(GoodData::Helpers.interpolate_error_message(MultiJson.load(e.http_body)), :red)
70
+ end
71
+
72
+ def self.table_with_headers(data, methods, options = {})
73
+ limit = options[:limit] || data.size
74
+ headers = options[:headers]
75
+ Terminal::Table.new do |t|
76
+ t << if headers
77
+ headers
78
+ else
79
+ methods.map(&:to_s).map(&:capitalize)
80
+ end
81
+ t << :separator
82
+ data.take(limit).each do |p|
83
+ res = if p.is_a?(Hash)
84
+ methods.map { |m| m.is_a?(Proc) ? m.call(p) : p[m] }
85
+ else
86
+ methods.map { |m| m.is_a?(Proc) ? m.call(p) : p.send(m) }
87
+ end
88
+ t.add_row(res)
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2016 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ module GoodData
8
+ module Goodot
9
+ VERSION = '0.0.2'.freeze
10
+ end
11
+ end
@@ -0,0 +1,50 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2016 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ require 'simplecov'
8
+ require 'rspec'
9
+ require 'pathname'
10
+
11
+ # Automagically include all helpers/*_helper.rb
12
+ base = Pathname(__FILE__).dirname.expand_path
13
+ Dir.glob(base + 'helpers/*_helper.rb').each do |file|
14
+ require file
15
+ end
16
+
17
+ RSpec::Expectations.configuration.warn_about_potential_false_positives = false
18
+
19
+ RSpec.configure do |config|
20
+ config.deprecation_stream = File.open('deprecations.txt', 'w')
21
+
22
+ config.filter_run_excluding :broken => true
23
+
24
+ config.fail_fast = false
25
+
26
+ config.before(:all) do
27
+ # TODO: Fully setup global environment
28
+ end
29
+
30
+ config.after(:all) do
31
+ # TODO: Fully tear-down global environment
32
+ end
33
+
34
+ config.before(:suite) do
35
+ # TODO: Setup test project
36
+ end
37
+
38
+ config.after(:suite) do
39
+ # TODO: Delete test project
40
+ end
41
+ end
42
+
43
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
44
+ SimpleCov::Formatter::HTMLFormatter
45
+ ]
46
+
47
+ SimpleCov.start do
48
+ add_filter 'spec/'
49
+ add_filter 'test/'
50
+ end
metadata ADDED
@@ -0,0 +1,200 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: goodot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Tomas Svarovsky
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: license_finder
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.0.4
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.0.4
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubocop
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: simplecov
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.11'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.11'
103
+ - !ruby/object:Gem::Dependency
104
+ name: gli
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: gooddata
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">"
122
+ - !ruby/object:Gem::Version
123
+ version: 0.6.24
124
+ type: :runtime
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">"
129
+ - !ruby/object:Gem::Version
130
+ version: 0.6.24
131
+ description: Uaa, not right now
132
+ email:
133
+ - svarovsky@gooddata.com
134
+ executables:
135
+ - goodot
136
+ extensions: []
137
+ extra_rdoc_files: []
138
+ files:
139
+ - ".gitignore"
140
+ - ".rspec"
141
+ - DEPENDENCIES.md
142
+ - Gemfile
143
+ - Gemfile.lock
144
+ - LICENSE
145
+ - LICENSE.rb
146
+ - README.md
147
+ - Rakefile
148
+ - bin/goodot
149
+ - dependency_decisions.yml
150
+ - goodot.gemspec
151
+ - img/hello_world.graffle
152
+ - img/hello_world.png
153
+ - img/master_segment.graffle
154
+ - img/master_segment.png
155
+ - img/project_etl.graffle
156
+ - img/project_etl.png
157
+ - img/relase.graffle
158
+ - img/release.png
159
+ - img/rollback.graffle
160
+ - img/rollback.png
161
+ - img/service_etl.graffle
162
+ - img/service_etl.png
163
+ - lib/goodot.rb
164
+ - lib/goodot/cli/app.rb
165
+ - lib/goodot/cli/cli.rb
166
+ - lib/goodot/cli/cmd/app_cmd.rb
167
+ - lib/goodot/cli/cmd/clients_cmd.rb
168
+ - lib/goodot/cli/cmd/jack_in.rb
169
+ - lib/goodot/cli/cmd/masters_cmd.rb
170
+ - lib/goodot/cli/cmd/segments_cmd.rb
171
+ - lib/goodot/cli/cmd/version_cmd.rb
172
+ - lib/goodot/cli/shared.rb
173
+ - lib/goodot/version.rb
174
+ - spec/spec_helper.rb
175
+ homepage: ''
176
+ licenses:
177
+ - MIT
178
+ metadata: {}
179
+ post_install_message:
180
+ rdoc_options: []
181
+ require_paths:
182
+ - lib
183
+ required_ruby_version: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ required_rubygems_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ requirements: []
194
+ rubyforge_project:
195
+ rubygems_version: 2.4.6
196
+ signing_key:
197
+ specification_version: 4
198
+ summary: Goodot is about doing a project in GD in a programmatic way
199
+ test_files:
200
+ - spec/spec_helper.rb