ruby_fly 0.23.0 → 0.24.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: b19bf3dc6ccd8b781c66d6bd6e60f7f5d6507fc196b274daee72839cfbd2cd47
4
- data.tar.gz: 9ab71c32055783c25736a981f52071f12021ce392dc0462afe77a9646a30c0b5
3
+ metadata.gz: 33b926dd167cbf0156ba4b47080990fadfd565aea77fab53a1f42ef16fee641a
4
+ data.tar.gz: a9b0e981ec9c68fa5d20c4e3c0aa574b3c471d5185b9d079088ac4b35a3b0804
5
5
  SHA512:
6
- metadata.gz: 69c158ddfdebda0ac27540b415247080b0ab005306cc5cfd9e65ab9df018c0ebad4edee9043724696d9d66d4ccddb89d7109fef493ad631a4568c3f70186fcb5
7
- data.tar.gz: 26bd6a866dae473a88d288b57ce20cde1e339a1adca3de5071857c9f55d45dc80063dd6aca785fee6fd0fd30ce5f66cee895bcecc0869486504bafd261c1d4a0
6
+ metadata.gz: 1c908d892ebf255cc874abb2e2db9245b076e5b20f323618e26dfed8b4f1b6966bd6d3d54cc574e3563b1decf3780e3071f437bbd11d4f6b3f66f8b4e2f79a04
7
+ data.tar.gz: 0170606241bb949fa67920b761bf384aebb1a8bb4ffb0cc683c88e8bf6ac0bb8ea6284026696a4ddff97ff4a56390ff8fc8a57aa7442b2066d64d83cdc1e2b1b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_fly (0.23.0)
4
+ ruby_fly (0.24.0.pre.1)
5
5
  lino (>= 1.5)
6
6
 
7
7
  GEM
@@ -1,3 +1,4 @@
1
+ require_relative 'commands/login'
1
2
  require_relative 'commands/get_pipeline'
2
3
  require_relative 'commands/set_pipeline'
3
4
  require_relative 'commands/unpause_pipeline'
@@ -44,6 +44,7 @@ module RubyFly
44
44
  end
45
45
 
46
46
  def configure_command(builder, opts)
47
+ builder
47
48
  end
48
49
 
49
50
  def do_after(opts)
@@ -1,10 +1,15 @@
1
1
  require 'lino'
2
2
  require_relative 'base'
3
+ require_relative 'mixins/environment'
3
4
 
4
5
  module RubyFly
5
6
  module Commands
6
7
  class GetPipeline < Base
8
+ include Mixins::Environment
9
+
7
10
  def configure_command(builder, opts)
11
+ builder = super(builder, opts)
12
+
8
13
  missing_params = [
9
14
  :target,
10
15
  :pipeline
@@ -0,0 +1,42 @@
1
+ require 'lino'
2
+ require_relative 'base'
3
+ require_relative 'mixins/environment'
4
+
5
+ module RubyFly
6
+ module Commands
7
+ class Login < Base
8
+ include Mixins::Environment
9
+
10
+ def configure_command(builder, opts)
11
+ builder = super(builder, opts)
12
+
13
+ missing_params = [
14
+ :target
15
+ ].select { |param| opts[param].nil? }
16
+
17
+ unless missing_params.empty?
18
+ description = missing_params.map { |p| "'#{p}'" }.join(', ')
19
+ raise(
20
+ ArgumentError,
21
+ "Error: #{description} required but not provided.")
22
+ end
23
+
24
+ target = opts[:target]
25
+ concourse_url = opts[:concourse_url]
26
+ username = opts[:username]
27
+ password = opts[:password]
28
+ team = opts[:team]
29
+
30
+ builder
31
+ .with_subcommand('login') do |sub|
32
+ sub = sub.with_option('-t', target)
33
+ sub = sub.with_option('-c', concourse_url) if concourse_url
34
+ sub = sub.with_option('-u', username) if username
35
+ sub = sub.with_option('-p', password) if password
36
+ sub = sub.with_option('-n', team) if team
37
+ sub
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,29 @@
1
+ module RubyFly
2
+ module Commands
3
+ module Mixins
4
+ module Environment
5
+ def initialize(opts={})
6
+ super(opts)
7
+ @environment = opts[:environment]
8
+ end
9
+
10
+ def for_environment(environment)
11
+ @environment = environment
12
+ self
13
+ end
14
+
15
+ def configure_command(builder, opts)
16
+ builder = super(builder, opts)
17
+ environment = opts[:environment] || @environment
18
+ if environment
19
+ builder = environment.to_a
20
+ .inject(builder) do |b, environment_variable|
21
+ b.with_environment_variable(*environment_variable)
22
+ end
23
+ end
24
+ builder
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,10 +1,15 @@
1
1
  require 'lino'
2
2
  require_relative 'base'
3
+ require_relative 'mixins/environment'
3
4
 
4
5
  module RubyFly
5
6
  module Commands
6
7
  class SetPipeline < Base
8
+ include Mixins::Environment
9
+
7
10
  def configure_command(builder, opts)
11
+ builder = super(builder, opts)
12
+
8
13
  missing_params = [
9
14
  :target,
10
15
  :pipeline,
@@ -1,10 +1,15 @@
1
1
  require 'lino'
2
2
  require_relative 'base'
3
+ require_relative 'mixins/environment'
3
4
 
4
5
  module RubyFly
5
6
  module Commands
6
7
  class UnpausePipeline < Base
8
+ include Mixins::Environment
9
+
7
10
  def configure_command(builder, opts)
11
+ builder = super(builder, opts)
12
+
8
13
  missing_params = [
9
14
  :target,
10
15
  :pipeline
@@ -1,3 +1,3 @@
1
1
  module RubyFly
2
- VERSION = '0.23.0'
2
+ VERSION = '0.24.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.23.0
4
+ version: 0.24.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-03 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lino
@@ -184,6 +184,8 @@ files:
184
184
  - lib/ruby_fly/commands.rb
185
185
  - lib/ruby_fly/commands/base.rb
186
186
  - lib/ruby_fly/commands/get_pipeline.rb
187
+ - lib/ruby_fly/commands/login.rb
188
+ - lib/ruby_fly/commands/mixins/environment.rb
187
189
  - lib/ruby_fly/commands/set_pipeline.rb
188
190
  - lib/ruby_fly/commands/unpause_pipeline.rb
189
191
  - lib/ruby_fly/commands/version.rb
@@ -204,9 +206,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
206
  version: '2.6'
205
207
  required_rubygems_version: !ruby/object:Gem::Requirement
206
208
  requirements:
207
- - - ">="
209
+ - - ">"
208
210
  - !ruby/object:Gem::Version
209
- version: '0'
211
+ version: 1.3.1
210
212
  requirements: []
211
213
  rubygems_version: 3.0.1
212
214
  signing_key: