k_director 0.12.0 → 0.12.1
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/directors/base_director.rb +11 -1
- data/lib/k_director/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +1 -2
- data/.builders/dsl/ruby_gem_dsl.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 299e8ce98da8e9466c4394c2bd5b004a62cc69f3f9f99df5e0d94166de79604c
|
4
|
+
data.tar.gz: d2919e383af54afd515024ec6c6cc0e11906455680bb1fe62661b2649a32f3e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afca62f2f2ceeb8bb99aab3d720f23963d4b559144e0388aebdc22bf58deb746da7e86dec8fac60ed90cb76815c146ca8acb9ce868cd2aa1c408b42c6ac2b275
|
7
|
+
data.tar.gz: 2fb3e677abf07ad9f7ec9cad4c94beaac720e1d1f8cce8cc0d9e12c988f17fde5e8be91ae6187018de18a4cc3cea032fb8ac277e927613dc0e7d57623b9354d9
|
data/docs/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.12.0](https://github.com/klueless-io/k_director/compare/v0.11.3...v0.12.0) (2022-02-11)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* split dom_builder out from actions_builder ([f728e0e](https://github.com/klueless-io/k_director/commit/f728e0e04ef668928ed78ed6e008c3996a2023e8))
|
7
|
+
|
1
8
|
## [0.11.3](https://github.com/klueless-io/k_director/compare/v0.11.2...v0.11.3) (2022-02-08)
|
2
9
|
|
3
10
|
|
@@ -10,13 +10,23 @@ module KDirector
|
|
10
10
|
class << self
|
11
11
|
def init(k_builder, builder = nil, **opts)
|
12
12
|
if builder.nil?
|
13
|
-
builder =
|
13
|
+
builder = builder_type.new
|
14
14
|
else
|
15
15
|
builder.reset
|
16
16
|
end
|
17
17
|
|
18
18
|
new(k_builder, builder, **opts)
|
19
19
|
end
|
20
|
+
|
21
|
+
def builder_type
|
22
|
+
return @builder_type if defined? @builder_type
|
23
|
+
|
24
|
+
@builder_type = KDirector::Builders::ActionsBuilder
|
25
|
+
end
|
26
|
+
|
27
|
+
def default_builder_type(type)
|
28
|
+
@builder_type = type
|
29
|
+
end
|
20
30
|
end
|
21
31
|
|
22
32
|
attr_reader :builder
|
data/lib/k_director/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "k_director",
|
3
|
-
"version": "0.12.
|
3
|
+
"version": "0.12.1",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "k_director",
|
9
|
-
"version": "0.12.
|
9
|
+
"version": "0.12.1",
|
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
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_director
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -90,7 +90,6 @@ extra_rdoc_files: []
|
|
90
90
|
files:
|
91
91
|
- ".builders/_.rb"
|
92
92
|
- ".builders/boot.rb"
|
93
|
-
- ".builders/dsl/ruby_gem_dsl.rb"
|
94
93
|
- ".builders/generators/01-bootstrap.rb"
|
95
94
|
- ".builders/run.rb"
|
96
95
|
- ".githooks/commit-msg"
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dsl
|
4
|
-
class RubyGemDsl < Dsl::Directors::BaseDirector
|
5
|
-
def default_director_name
|
6
|
-
'Ruby Gem'
|
7
|
-
end
|
8
|
-
|
9
|
-
def repo_name
|
10
|
-
options.repo_name
|
11
|
-
end
|
12
|
-
|
13
|
-
def repo_account
|
14
|
-
options.repo_account
|
15
|
-
end
|
16
|
-
|
17
|
-
# def default_template_base_folder
|
18
|
-
# end
|
19
|
-
# def initialize(k_builder, builder, **opts)
|
20
|
-
# super(k_builder, builder, **opts)
|
21
|
-
# # @on_action = opts[:on_action] || :queue # %i[queue execute]
|
22
|
-
# end
|
23
|
-
def github(**opts, &block)
|
24
|
-
github = Dsl::Github.new(self, **opts)
|
25
|
-
github.instance_eval(&block)
|
26
|
-
|
27
|
-
self
|
28
|
-
end
|
29
|
-
|
30
|
-
def blueprint(**opts, &block)
|
31
|
-
blueprint = Dsl::RubyGemBlueprint.new(self, **opts)
|
32
|
-
blueprint.instance_eval(&block)
|
33
|
-
|
34
|
-
self
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
class RubyGemBlueprint < Dsl::Directors::ChildDirector
|
39
|
-
def template_content(template_filename)
|
40
|
-
template_parts = [template_base_folder, template_filename]
|
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_filename, **opts)
|
48
|
-
template_parts = [template_base_folder, template_filename]
|
49
|
-
template_file = File.join(*template_parts)
|
50
|
-
|
51
|
-
script = k_builder.process_any_content(template_file: template_file, **opts)
|
52
|
-
|
53
|
-
run_script(script)
|
54
|
-
# action = k_builder.run_script_action(script)
|
55
|
-
# run_action(action)
|
56
|
-
end
|
57
|
-
|
58
|
-
# Create a single file
|
59
|
-
#
|
60
|
-
# @param [String] output_filename The output file name, this can be a relative path
|
61
|
-
# @param [Hash] **opts The options
|
62
|
-
# @option opts [String] :template_filename Template filename can be set or it will default to the same value as the output file name
|
63
|
-
# @option opts [String] :template_subfolder Template subfolder
|
64
|
-
def add(output_file, **opts)
|
65
|
-
template_file = opts[:template_file] || output_file
|
66
|
-
template_parts = [template_base_folder, opts[:template_subfolder], opts[:template_variant], template_file].reject(&:blank?)
|
67
|
-
|
68
|
-
opts[:template_file] = File.join(*template_parts)
|
69
|
-
|
70
|
-
add_file(output_file, **opts)
|
71
|
-
end
|
72
|
-
|
73
|
-
def oadd(name, **opts); add(name, **{ open: true }.merge(opts)); end
|
74
|
-
def tadd(name, **opts); add(name, **{ open_template: true }.merge(opts)); end
|
75
|
-
def fadd(name, **opts); add(name, **{ on_exist: :write }.merge(opts)); end
|
76
|
-
end
|
77
|
-
end
|