xapixctl 1.1.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/cd.yaml +17 -0
- data/.rubocop.yml +5 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +57 -40
- data/Rakefile +1 -1
- data/lib/xapixctl.rb +0 -3
- data/lib/xapixctl/base_cli.rb +75 -0
- data/lib/xapixctl/cli.rb +59 -159
- data/lib/xapixctl/connector_cli.rb +49 -0
- data/lib/xapixctl/phoenix_client.rb +38 -247
- data/lib/xapixctl/phoenix_client/connection.rb +50 -0
- data/lib/xapixctl/phoenix_client/organization_connection.rb +61 -0
- data/lib/xapixctl/phoenix_client/project_connection.rb +184 -0
- data/lib/xapixctl/phoenix_client/result_handler.rb +35 -0
- data/lib/xapixctl/preview_cli.rb +54 -0
- data/lib/xapixctl/sync_cli.rb +166 -0
- data/lib/xapixctl/titan_cli.rb +281 -0
- data/lib/xapixctl/util.rb +42 -0
- data/lib/xapixctl/version.rb +3 -1
- data/xapixctl.gemspec +13 -6
- metadata +67 -14
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
|
5
|
+
module Xapixctl
|
6
|
+
module Util
|
7
|
+
extend self
|
8
|
+
|
9
|
+
class InvalidDocumentStructureError < StandardError
|
10
|
+
def initialize(file)
|
11
|
+
super("#{file} has invalid document structure")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
DOCUMENT_STRUCTURE = %w[version kind metadata definition].freeze
|
16
|
+
|
17
|
+
def resources_from_file(filename, ignore_missing: false)
|
18
|
+
load_files(filename, ignore_missing) do |actual_file, yaml_string|
|
19
|
+
yaml_string.split(/^---\s*\n/).map { |yml| Psych.safe_load(yml) }.compact.each do |doc|
|
20
|
+
raise InvalidDocumentStructureError, actual_file unless (DOCUMENT_STRUCTURE - doc.keys.map(&:to_s)).empty?
|
21
|
+
yield doc
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def load_files(filename, ignore_missing)
|
27
|
+
if filename == '-'
|
28
|
+
yield 'STDIN', $stdin.read
|
29
|
+
else
|
30
|
+
pn = filename.is_a?(Pathname) ? filename : Pathname.new(filename)
|
31
|
+
if pn.directory?
|
32
|
+
pn.glob(["**/*.yaml", "**/*.yml"]).sort.each { |dpn| yield dpn.to_s, dpn.read }
|
33
|
+
elsif pn.exist?
|
34
|
+
yield pn.to_s, pn.read
|
35
|
+
elsif !ignore_missing
|
36
|
+
warn "file not found: #{filename}"
|
37
|
+
exit 1
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/xapixctl/version.rb
CHANGED
data/xapixctl.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path("lib", __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require "xapixctl/version"
|
@@ -8,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
8
10
|
spec.authors = ["Michael Reinsch"]
|
9
11
|
spec.email = ["michael@xapix.io"]
|
10
12
|
|
11
|
-
spec.summary =
|
13
|
+
spec.summary = 'xapix client library and command line tool'
|
12
14
|
spec.homepage = "https://github.com/xapix-io/xapixctl"
|
13
15
|
spec.license = "EPL-2.0"
|
14
16
|
|
@@ -17,20 +19,25 @@ Gem::Specification.new do |spec|
|
|
17
19
|
|
18
20
|
# Specify which files should be added to the gem when it is released.
|
19
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
-
spec.files
|
22
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
21
23
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
24
|
end
|
23
25
|
spec.bindir = "exe"
|
24
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
27
|
spec.require_paths = ["lib"]
|
26
28
|
|
29
|
+
spec.required_ruby_version = '>= 2.6'
|
30
|
+
|
27
31
|
spec.add_dependency "activesupport", ">= 5.2.3", "< 6.0.0"
|
28
32
|
spec.add_dependency "rest-client", ">= 2.1.0", "< 3.0.0"
|
29
|
-
spec.add_dependency "thor", ">= 0.
|
33
|
+
spec.add_dependency "thor", ">= 1.0.0", "< 1.2.0"
|
30
34
|
|
31
|
-
spec.add_development_dependency "bundler", "~> 1.
|
35
|
+
spec.add_development_dependency "bundler", "~> 2.1.4"
|
32
36
|
spec.add_development_dependency "rake", "~> 13.0"
|
33
37
|
spec.add_development_dependency "relaxed-rubocop", "~> 2.5"
|
34
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
-
spec.add_development_dependency "rubocop", "~>
|
38
|
+
spec.add_development_dependency "rspec", "~> 3.10.0"
|
39
|
+
spec.add_development_dependency "rubocop", "~> 1.11.0"
|
40
|
+
spec.add_development_dependency "rubocop-rake", "~> 0.5.1"
|
41
|
+
spec.add_development_dependency "rubocop-rspec", "~> 2.2.0"
|
42
|
+
spec.add_development_dependency "webmock", "~> 3.11.0"
|
36
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xapixctl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Reinsch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -56,34 +56,34 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.
|
59
|
+
version: 1.0.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.
|
62
|
+
version: 1.2.0
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 1.0.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 1.
|
72
|
+
version: 1.2.0
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: bundler
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
77
|
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 1.
|
79
|
+
version: 2.1.4
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
84
|
- - "~>"
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 1.
|
86
|
+
version: 2.1.4
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: rake
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,28 +118,70 @@ dependencies:
|
|
118
118
|
requirements:
|
119
119
|
- - "~>"
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
121
|
+
version: 3.10.0
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
126
|
- - "~>"
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
128
|
+
version: 3.10.0
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: rubocop
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
135
|
+
version: 1.11.0
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 1.11.0
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: rubocop-rake
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: 0.5.1
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - "~>"
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: 0.5.1
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: rubocop-rspec
|
159
|
+
requirement: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - "~>"
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: 2.2.0
|
136
164
|
type: :development
|
137
165
|
prerelease: false
|
138
166
|
version_requirements: !ruby/object:Gem::Requirement
|
139
167
|
requirements:
|
140
168
|
- - "~>"
|
141
169
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
170
|
+
version: 2.2.0
|
171
|
+
- !ruby/object:Gem::Dependency
|
172
|
+
name: webmock
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - "~>"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 3.11.0
|
178
|
+
type: :development
|
179
|
+
prerelease: false
|
180
|
+
version_requirements: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - "~>"
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: 3.11.0
|
143
185
|
description:
|
144
186
|
email:
|
145
187
|
- michael@xapix.io
|
@@ -148,6 +190,7 @@ executables:
|
|
148
190
|
extensions: []
|
149
191
|
extra_rdoc_files: []
|
150
192
|
files:
|
193
|
+
- ".github/workflows/cd.yaml"
|
151
194
|
- ".gitignore"
|
152
195
|
- ".rspec"
|
153
196
|
- ".rubocop.yml"
|
@@ -161,8 +204,18 @@ files:
|
|
161
204
|
- bin/setup
|
162
205
|
- exe/xapixctl
|
163
206
|
- lib/xapixctl.rb
|
207
|
+
- lib/xapixctl/base_cli.rb
|
164
208
|
- lib/xapixctl/cli.rb
|
209
|
+
- lib/xapixctl/connector_cli.rb
|
165
210
|
- lib/xapixctl/phoenix_client.rb
|
211
|
+
- lib/xapixctl/phoenix_client/connection.rb
|
212
|
+
- lib/xapixctl/phoenix_client/organization_connection.rb
|
213
|
+
- lib/xapixctl/phoenix_client/project_connection.rb
|
214
|
+
- lib/xapixctl/phoenix_client/result_handler.rb
|
215
|
+
- lib/xapixctl/preview_cli.rb
|
216
|
+
- lib/xapixctl/sync_cli.rb
|
217
|
+
- lib/xapixctl/titan_cli.rb
|
218
|
+
- lib/xapixctl/util.rb
|
166
219
|
- lib/xapixctl/version.rb
|
167
220
|
- xapixctl.gemspec
|
168
221
|
homepage: https://github.com/xapix-io/xapixctl
|
@@ -179,14 +232,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
232
|
requirements:
|
180
233
|
- - ">="
|
181
234
|
- !ruby/object:Gem::Version
|
182
|
-
version: '
|
235
|
+
version: '2.6'
|
183
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
237
|
requirements:
|
185
238
|
- - ">="
|
186
239
|
- !ruby/object:Gem::Version
|
187
240
|
version: '0'
|
188
241
|
requirements: []
|
189
|
-
rubygems_version: 3.0.
|
242
|
+
rubygems_version: 3.0.9
|
190
243
|
signing_key:
|
191
244
|
specification_version: 4
|
192
245
|
summary: xapix client library and command line tool
|