ruby_fly 0.22.0.pre.1 → 0.26.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ruby_fly.rb +4 -0
- data/lib/ruby_fly/commands.rb +1 -0
- data/lib/ruby_fly/commands/base.rb +1 -0
- data/lib/ruby_fly/commands/get_pipeline.rb +5 -0
- data/lib/ruby_fly/commands/login.rb +42 -0
- data/lib/ruby_fly/commands/mixins/environment.rb +29 -0
- data/lib/ruby_fly/commands/set_pipeline.rb +5 -0
- data/lib/ruby_fly/commands/unpause_pipeline.rb +5 -0
- data/lib/ruby_fly/rc.rb +9 -0
- data/lib/ruby_fly/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9009ca11dd23325ac48457a3e328ebbea4238b740a45c4d1eb632e77e7cf056
|
4
|
+
data.tar.gz: f88791482aa8f5e21b16ae05c829679898258ce09cc33eb757fd35099cc3ffcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7514713d9964c05883b85f4aaa09fff06d5508cb142ac6049ef435c413f029e50fbb05674d048be0b8b130fe0207c965e28b1afa0cedf21b0f5e9e793afd0952
|
7
|
+
data.tar.gz: 7b652df06e8441359f38fbb2513f06ee3d8d25effd293147cdf1b16ee1bfcfeefcc2d52d6f0f487e1cf4036955d577a6b6605fedfeb72f38bd57230ab1040d50
|
data/Gemfile.lock
CHANGED
data/lib/ruby_fly.rb
CHANGED
data/lib/ruby_fly/commands.rb
CHANGED
@@ -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
|
data/lib/ruby_fly/rc.rb
CHANGED
@@ -174,6 +174,15 @@ module RubyFly
|
|
174
174
|
@targets[target_name] = updated_target
|
175
175
|
end
|
176
176
|
|
177
|
+
def add_or_update_target(target_name, &block)
|
178
|
+
mutable_target = has_target?(target_name) ?
|
179
|
+
find_target(target_name) :
|
180
|
+
Target.new({name: target_name})
|
181
|
+
block.call(mutable_target)
|
182
|
+
updated_target = Target.clone(mutable_target, name: target_name)
|
183
|
+
@targets[target_name] = updated_target
|
184
|
+
end
|
185
|
+
|
177
186
|
def rename_target(old_target_name, new_target_name)
|
178
187
|
old_target = find_target(old_target_name)
|
179
188
|
new_target = Target.clone(old_target, name: new_target_name)
|
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.26.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-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
|