ruby_fly 0.29.0 → 0.34.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/ruby_fly.rb +4 -0
- data/lib/ruby_fly/commands.rb +1 -0
- data/lib/ruby_fly/commands/base.rb +12 -6
- data/lib/ruby_fly/commands/destroy_pipeline.rb +41 -0
- data/lib/ruby_fly/commands/status.rb +8 -0
- data/lib/ruby_fly/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc79d618db90af4f12708379b4d8e10c14bb508f3f9c61a19d00c04e8305a11
|
4
|
+
data.tar.gz: a6b7de2c0126635b826c27f0e4c5c30a6c2751086a824f23c2717c1cb9698404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a65a8ce1cf4f6e5bd8e75a7a7cb90c0a82cf9b95b8c3d014ad88af33e01e92f6d769677470cbb9ddd4ec6bb9c41f000336ee98415e5b7be193ccb38df7f0140f
|
7
|
+
data.tar.gz: 54cbffcf67a041b167f689e02027b381d53a29fe5d29c7d51c2f681d4e2469a357d99ed5dc9c5cd92f2eb1d501b683787cbafeea351aedc57f7f9ea184bc5732
|
data/Gemfile.lock
CHANGED
data/lib/ruby_fly.rb
CHANGED
data/lib/ruby_fly/commands.rb
CHANGED
@@ -3,6 +3,7 @@ require_relative 'commands/status'
|
|
3
3
|
require_relative 'commands/get_pipeline'
|
4
4
|
require_relative 'commands/set_pipeline'
|
5
5
|
require_relative 'commands/unpause_pipeline'
|
6
|
+
require_relative 'commands/destroy_pipeline'
|
6
7
|
require_relative 'commands/version'
|
7
8
|
|
8
9
|
module RubyFly
|
@@ -16,12 +16,14 @@ module RubyFly
|
|
16
16
|
builder = instantiate_builder
|
17
17
|
|
18
18
|
do_before(opts)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
do_around(opts) do |new_opts|
|
20
|
+
configure_command(builder, new_opts)
|
21
|
+
.build
|
22
|
+
.execute(
|
23
|
+
stdin: stdin,
|
24
|
+
stdout: stdout,
|
25
|
+
stderr: stderr)
|
26
|
+
end
|
25
27
|
do_after(opts)
|
26
28
|
end
|
27
29
|
|
@@ -34,6 +36,10 @@ module RubyFly
|
|
34
36
|
def do_before(opts)
|
35
37
|
end
|
36
38
|
|
39
|
+
def do_around(opts, &block)
|
40
|
+
block.call(opts)
|
41
|
+
end
|
42
|
+
|
37
43
|
def configure_command(builder, opts)
|
38
44
|
builder
|
39
45
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'lino'
|
2
|
+
require_relative 'base'
|
3
|
+
require_relative 'mixins/environment'
|
4
|
+
|
5
|
+
module RubyFly
|
6
|
+
module Commands
|
7
|
+
class DestroyPipeline < Base
|
8
|
+
include Mixins::Environment
|
9
|
+
|
10
|
+
def configure_command(builder, opts)
|
11
|
+
builder = super(builder, opts)
|
12
|
+
|
13
|
+
missing_params = [
|
14
|
+
:target,
|
15
|
+
:pipeline
|
16
|
+
].select { |param| opts[param].nil? }
|
17
|
+
|
18
|
+
unless missing_params.empty?
|
19
|
+
description = missing_params.map { |p| "'#{p}'" }.join(', ')
|
20
|
+
raise(
|
21
|
+
ArgumentError,
|
22
|
+
"Error: #{description} required but not provided.")
|
23
|
+
end
|
24
|
+
|
25
|
+
target = opts[:target]
|
26
|
+
pipeline = opts[:pipeline]
|
27
|
+
non_interactive = opts[:non_interactive]
|
28
|
+
team = opts[:team]
|
29
|
+
|
30
|
+
builder
|
31
|
+
.with_subcommand('destroy-pipeline') do |sub|
|
32
|
+
sub = sub.with_option('-t', target)
|
33
|
+
sub = sub.with_option('-p', pipeline)
|
34
|
+
sub = sub.with_option('--team', team) if team
|
35
|
+
sub = sub.with_flag('-n') if non_interactive
|
36
|
+
sub
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -38,6 +38,14 @@ module RubyFly
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
def do_around(opts, &block)
|
42
|
+
begin
|
43
|
+
block.call(opts)
|
44
|
+
rescue Open4::SpawnError => e
|
45
|
+
raise e unless e.status.exitstatus == 1
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
41
49
|
def do_after(opts)
|
42
50
|
output = stdout.string
|
43
51
|
error = stderr.string
|
data/lib/ruby_fly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_fly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.34.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lino
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- lib/ruby_fly.rb
|
184
184
|
- lib/ruby_fly/commands.rb
|
185
185
|
- lib/ruby_fly/commands/base.rb
|
186
|
+
- lib/ruby_fly/commands/destroy_pipeline.rb
|
186
187
|
- lib/ruby_fly/commands/get_pipeline.rb
|
187
188
|
- lib/ruby_fly/commands/login.rb
|
188
189
|
- lib/ruby_fly/commands/mixins/environment.rb
|
@@ -207,9 +208,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
208
|
version: '2.6'
|
208
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
210
|
requirements:
|
210
|
-
- - "
|
211
|
+
- - ">"
|
211
212
|
- !ruby/object:Gem::Version
|
212
|
-
version:
|
213
|
+
version: 1.3.1
|
213
214
|
requirements: []
|
214
215
|
rubygems_version: 3.0.1
|
215
216
|
signing_key:
|