ruby_fly 0.22.0.pre.2 → 0.27.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: 6936660432f5ab2cd2a961181da22e3af7fe6f6df31f7b80a72f63781686d555
4
- data.tar.gz: 3f091a990741fdbb2de20437ed1a9f8062e9917861fbaf6e6498eff65d24b7e0
3
+ metadata.gz: 9a51cab475fee762ba99cafe67c2e797d22c3d9f564b23e1b3e4ebb2fb133d13
4
+ data.tar.gz: ce8399a8af389013f0836adf870fd04a34e13a82b27a2d3818cee6662473dc9f
5
5
  SHA512:
6
- metadata.gz: 346cb0acd08667202197256497c614f0e7dcb5ec7a1b0c1e5ae24a96f4d639003c5d3830c7b8b33735e991236ef2d59ba9e036a28b22cc69f6d312f339460c10
7
- data.tar.gz: 8ab302841f054f9a11b0d48e9013d749c4c81d368b7b640839654bf09f78ee49b212ec37b470dd156003e77846e5928bcf11409e3b6efd44070028e152b43b78
6
+ metadata.gz: '0828f4b252f8b18337b63f46f287563caa83b8535af96d13bb9e73568f8b075f9ba3d70983fc01587dced3ff4c5e5da19268ce537663c00d03ff65256b7000eb'
7
+ data.tar.gz: 863c71bc854bd329fd1735537d38cb23715a5463fdf03c1d9db71787a7ef73769ca4ad102c9d36032436a92bf340e72f440828bc5aa2ef0c159ea8a6912804dd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_fly (0.22.0.pre.2)
4
+ ruby_fly (0.27.0)
5
5
  lino (>= 1.5)
6
6
 
7
7
  GEM
@@ -20,6 +20,10 @@ module RubyFly
20
20
  end
21
21
 
22
22
  module ClassMethods
23
+ def login(opts = {})
24
+ Commands::Login.new.execute(opts)
25
+ end
26
+
23
27
  def get_pipeline(opts = {})
24
28
  Commands::GetPipeline.new.execute(opts)
25
29
  end
@@ -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.22.0.pre.2'
2
+ VERSION = '0.27.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.22.0.pre.2
4
+ version: 0.27.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-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: 1.3.1
211
+ version: '0'
210
212
  requirements: []
211
213
  rubygems_version: 3.0.1
212
214
  signing_key: