k_director 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +7 -0
- data/lib/k_director/builders/actions_builder.rb +13 -4
- data/lib/k_director/directors/base_director.rb +6 -0
- data/lib/k_director/directors/data.rb +9 -49
- data/lib/k_director/version.rb +1 -1
- data/lib/k_director.rb +1 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18b4641c3f5638987c5e9d8922b51fd9ec509df88012d2408393ddcdf1353b6
|
4
|
+
data.tar.gz: 7d38f50be00a404f176c3817228208eb980ebb158ea87f9966374e703c23d627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c4659dddb2c5b32a1e665ac633eb975711aee4e5f924d7ae26b97c63f4b0bcd6f406f4248a93dbf5c22c60cd3a03a099446aaa577168e053ba2bf1b61c71cd
|
7
|
+
data.tar.gz: 6ba9e757263833a14582d315d5dab1bb7b828b8f674486db65f566005386d2eeaa1f5d81d69540a75ba5ab14c7e6b69e67582f0ea7b61dcaa6efcd9788d09851
|
data/docs/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.5.0](https://github.com/klueless-io/k_director/compare/v0.4.1...v0.5.0) (2022-01-31)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* add group_set to action_builder ([62d87ed](https://github.com/klueless-io/k_director/commit/62d87ed27cb1479cf5ba3a2fa8cac70fa71f63fd))
|
7
|
+
|
1
8
|
## [0.4.1](https://github.com/klueless-io/k_director/compare/v0.4.0...v0.4.1) (2022-01-30)
|
2
9
|
|
3
10
|
|
@@ -26,10 +26,19 @@ module KDirector
|
|
26
26
|
# Set many key/value pairs gainst a group
|
27
27
|
#
|
28
28
|
# example:
|
29
|
-
# set_many(:github,
|
30
|
-
def group_set(group, **opts)
|
31
|
-
|
32
|
-
|
29
|
+
# set_many(:github, repo_name: 'repo-name', organization: 'org-name')
|
30
|
+
def group_set(group = nil, **opts)
|
31
|
+
return if group.nil? && opts.empty?
|
32
|
+
|
33
|
+
if group.nil?
|
34
|
+
opts.each do |key, value|
|
35
|
+
set(key, value)
|
36
|
+
end
|
37
|
+
else
|
38
|
+
dom[group] = {} if opts.empty? # initialize the group name if no options are provided
|
39
|
+
opts.each do |key, value|
|
40
|
+
set(group, key, value)
|
41
|
+
end
|
33
42
|
end
|
34
43
|
end
|
35
44
|
|
@@ -1,57 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module KDirector
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
class Blueprint < KDirector::Directors::ChildDirector
|
10
|
-
# Add a single file into the code base
|
11
|
-
#
|
12
|
-
# @param [String] output_filename The output file name, this can be a relative path
|
13
|
-
# @param [Hash] **opts The options
|
14
|
-
# @option opts [String] :template_filename Template filename can be set or it will default to the same value as the output file name
|
15
|
-
# @option opts [String] :template_subfolder Template subfolder
|
16
|
-
def add(output_file, **opts)
|
17
|
-
template_file = opts[:template_file] || output_file
|
18
|
-
template_parts = [template_base_folder, opts[:template_subfolder], template_file].reject(&:blank?)
|
19
|
-
template_path = File.join(*template_parts)
|
4
|
+
module Directors
|
5
|
+
# Data can update the underlying ActionBuilder DOM.
|
6
|
+
class Data
|
7
|
+
attr_reader :parent
|
8
|
+
attr_reader :name
|
20
9
|
|
21
|
-
|
22
|
-
|
10
|
+
def initialize(parent, name, **opts)
|
11
|
+
@parent = parent
|
12
|
+
@name = name
|
23
13
|
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
def oadd(name, **opts)
|
28
|
-
add(name, **{ open: true }.merge(opts))
|
29
|
-
end
|
30
|
-
|
31
|
-
def tadd(name, **opts)
|
32
|
-
add(name, **{ open_template: true }.merge(opts))
|
33
|
-
end
|
34
|
-
|
35
|
-
def fadd(name, **opts)
|
36
|
-
add(name, **{ on_exist: :write }.merge(opts))
|
37
|
-
end
|
38
|
-
|
39
|
-
# def template_content(template_file, **opts)
|
40
|
-
# template_parts = [template_base_folder, opts[:template_subfolder], template_file].reject(&:blank?)
|
41
|
-
# template_file = File.join(*template_parts)
|
42
|
-
|
43
|
-
# file = k_builder.find_template_file(template_file)
|
44
|
-
# File.read(file)
|
45
|
-
# end
|
46
|
-
|
47
|
-
def run_template_script(template_file, **opts)
|
48
|
-
template_parts = [template_base_folder, opts[:template_subfolder], template_file].reject(&:blank?)
|
49
|
-
template_path = File.join(*template_parts)
|
50
|
-
|
51
|
-
script = k_builder.process_any_content(template_file: template_path, **opts)
|
52
|
-
|
53
|
-
run_script(script)
|
54
|
-
end
|
14
|
+
parent.builder.group_set(name, **opts)
|
55
15
|
end
|
56
16
|
end
|
57
17
|
end
|
data/lib/k_director/version.rb
CHANGED
data/lib/k_director.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative 'k_director/version'
|
|
8
8
|
require_relative 'k_director/builders/actions_builder'
|
9
9
|
require_relative 'k_director/directors/base_director'
|
10
10
|
require_relative 'k_director/directors/child_director'
|
11
|
+
require_relative 'k_director/directors/data'
|
11
12
|
require_relative 'k_director/dsls/children/blueprint'
|
12
13
|
require_relative 'k_director/dsls/children/github'
|
13
14
|
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "k_director",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.6.0",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "k_director",
|
9
|
-
"version": "0.
|
9
|
+
"version": "0.6.0",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.1",
|
data/package.json
CHANGED