ruby_fly 0.29.0 → 0.34.0.pre.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afc2d262e88e2435febc5051197999892adad993a925e10d71d9ea176cc7dfb0
4
- data.tar.gz: 5f399183a8851cf4dbf28465e7a24cd53986678e381298b3e9825ed40a49c395
3
+ metadata.gz: 5bc79d618db90af4f12708379b4d8e10c14bb508f3f9c61a19d00c04e8305a11
4
+ data.tar.gz: a6b7de2c0126635b826c27f0e4c5c30a6c2751086a824f23c2717c1cb9698404
5
5
  SHA512:
6
- metadata.gz: 1d4dbf086bcc9422dc3b6f144a8c083981ad72b22c5e877103d355e7e6359021d6bee9e6ce9e2ffbfc18f0ade8cf8d5e1e44d15a3c714619fe7f8ca171cd696d
7
- data.tar.gz: aaa7a6d393c711d2d49c1db56d1bc1e258470f7d32bbc0038fba9406e46f14d5cd4f393784af4d5e479ceac09d81d2f9a44f9c5efc04d004076d905c25d73fe0
6
+ metadata.gz: a65a8ce1cf4f6e5bd8e75a7a7cb90c0a82cf9b95b8c3d014ad88af33e01e92f6d769677470cbb9ddd4ec6bb9c41f000336ee98415e5b7be193ccb38df7f0140f
7
+ data.tar.gz: 54cbffcf67a041b167f689e02027b381d53a29fe5d29c7d51c2f681d4e2469a357d99ed5dc9c5cd92f2eb1d501b683787cbafeea351aedc57f7f9ea184bc5732
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_fly (0.29.0)
4
+ ruby_fly (0.34.0.pre.1)
5
5
  lino (>= 1.5)
6
6
 
7
7
  GEM
@@ -104,4 +104,4 @@ DEPENDENCIES
104
104
  ruby_fly!
105
105
 
106
106
  BUNDLED WITH
107
- 2.2.4
107
+ 2.2.7
@@ -40,6 +40,10 @@ module RubyFly
40
40
  Commands::UnpausePipeline.new.execute(opts)
41
41
  end
42
42
 
43
+ def destroy_pipeline(opts = {})
44
+ Commands::DestroyPipeline.new.execute(opts)
45
+ end
46
+
43
47
  def version
44
48
  Commands::Version.new.execute
45
49
  end
@@ -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
- configure_command(builder, opts)
20
- .build
21
- .execute(
22
- stdin: stdin,
23
- stdout: stdout,
24
- stderr: stderr)
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
@@ -1,3 +1,3 @@
1
1
  module RubyFly
2
- VERSION = '0.29.0'
2
+ VERSION = '0.34.0.pre.1'
3
3
  end
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.29.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-05 00:00:00.000000000 Z
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: '0'
213
+ version: 1.3.1
213
214
  requirements: []
214
215
  rubygems_version: 3.0.1
215
216
  signing_key: