ruby_fly 0.28.0.pre.1 → 0.33.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df53a98dc14d09cb09532166d5b4284041a12626c7e5006c7bee75984b63d517
4
- data.tar.gz: 3aa60fd2315ceb3459672cc372037a5b9790cb88d18ed25a24480518f0dd17ad
3
+ metadata.gz: cf8342a925be431d44e80153152464a344fd13877d320ea3d06f13dc5749994b
4
+ data.tar.gz: c9645b0b2456f0b0374ed4e4b419ed54705faa7e07a44ac7f57c901611e20c0b
5
5
  SHA512:
6
- metadata.gz: 6b10280580120e377d99182136649fc1f0c2ea4cded7255b2d10b4310f869711c373d7a8634a3239e1c8c670b3df95d040b098802e374cefc5e5fb3fe9c1f3b4
7
- data.tar.gz: 8c85b694601460932878fd86aeb98a02cf1769b3d1d70294423ae154508ee369d9d1d141165cc5dc4f9a123384e2cc23a904ae824b3295856a079202788a5808
6
+ metadata.gz: 4db435ba5cdc94d3dda232e268a0a1bcd88bd4a118002f27c6a95ac6e767177a3e1030a6305868fd3c7fd05905cc3e47a309f3047ff31f05ab2064682198a1e3
7
+ data.tar.gz: 264b442435168d278662cd1d7d46f36730fecce36ca52d001b55d810a4d97c1bbd9a698206c05339ae7c4f63ab0fd9b5870f6d112ba1b885f0b431279cc91c52
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_fly (0.28.0.pre.1)
4
+ ruby_fly (0.33.0)
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,37 @@
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
+
28
+ builder
29
+ .with_subcommand('destroy-pipeline') do |sub|
30
+ sub = sub.with_option('-t', target)
31
+ sub = sub.with_option('-p', pipeline)
32
+ sub
33
+ end
34
+ end
35
+ end
36
+ end
37
+ 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.28.0.pre.1'
2
+ VERSION = '0.33.0'
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.28.0.pre.1
4
+ version: 0.33.0
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: 1.3.1
213
+ version: '0'
213
214
  requirements: []
214
215
  rubygems_version: 3.0.1
215
216
  signing_key: