kojo 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/bin/kojo +2 -2
- data/lib/kojo/cli.rb +2 -3
- data/lib/kojo/collection.rb +2 -2
- data/lib/kojo/commands/command_base.rb +1 -1
- data/lib/kojo/commands/config.rb +12 -12
- data/lib/kojo/commands/dir.rb +13 -13
- data/lib/kojo/commands/file.rb +13 -14
- data/lib/kojo/commands/form.rb +10 -11
- data/lib/kojo/commands/single.rb +11 -11
- data/lib/kojo/commands/to_json.rb +14 -14
- data/lib/kojo/config.rb +3 -4
- data/lib/kojo/exceptions.rb +1 -1
- data/lib/kojo/extensions/yaml.rb +1 -1
- data/lib/kojo/form.rb +7 -8
- data/lib/kojo/front_matter_template.rb +3 -7
- data/lib/kojo/refinements/array.rb +2 -5
- data/lib/kojo/refinements/hash.rb +3 -3
- data/lib/kojo/refinements/string.rb +11 -12
- data/lib/kojo/template.rb +7 -9
- data/lib/kojo/version.rb +2 -2
- data/lib/kojo.rb +4 -6
- metadata +21 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de58d04d2528d3ef48c8a0855aa64b9ea79329becb44c12ca14c016007268d51
|
4
|
+
data.tar.gz: fce2e51b807e1846914e89919d589662e6292322b68a332a7bf8ade7e96924bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acbcafca4007995e322ef0b0b21f6a1b8993263184c70ad0c30f1b37e7a511d6cc05be69fdde628128172c6959395996ecc926b4eefb436aa1b87ab4ca0d2a67
|
7
|
+
data.tar.gz: 1226331b78b9c630245d9e51e7f34ec356844816544303ee34b76c44e36cac564b2af7b9a55740a8ea8ecadd989e4ac000cebc01b95017b42329083e3e1578b9
|
data/README.md
CHANGED
@@ -41,10 +41,17 @@ format.
|
|
41
41
|
$ gem install kojo
|
42
42
|
```
|
43
43
|
|
44
|
+
Or with Homebrew:
|
45
|
+
|
46
|
+
```shell
|
47
|
+
$ brew install brew-gem # once only, to enable the brew gem command
|
48
|
+
$ brew gem install kojo
|
49
|
+
```
|
50
|
+
|
44
51
|
Or with Docker:
|
45
52
|
|
46
53
|
```shell
|
47
|
-
$ alias kojo='docker run --rm -it -
|
54
|
+
$ alias kojo='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app" dannyben/kojo'
|
48
55
|
```
|
49
56
|
|
50
57
|
## Usage
|
data/bin/kojo
CHANGED
data/lib/kojo/cli.rb
CHANGED
@@ -3,12 +3,12 @@ require 'kojo/version'
|
|
3
3
|
requires 'commands'
|
4
4
|
|
5
5
|
module Kojo
|
6
|
-
# The CLI class is used by the kojo binary and forwards incoming CLI
|
6
|
+
# The CLI class is used by the kojo binary and forwards incoming CLI
|
7
7
|
# commands to the relevant Kojo::Commands class
|
8
8
|
class CLI
|
9
9
|
def self.runner
|
10
10
|
Kojo.interactive = ENV['KOJO_INTERACTIVE'] != 'no'
|
11
|
-
|
11
|
+
|
12
12
|
runner = MisterBin::Runner.new version: Kojo::VERSION
|
13
13
|
|
14
14
|
runner.route 'file', to: Kojo::Commands::FileCmd
|
@@ -21,5 +21,4 @@ module Kojo
|
|
21
21
|
runner
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
25
24
|
end
|
data/lib/kojo/collection.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Kojo
|
2
|
-
# The Collection class is a wrapper around the {Template} object. It
|
2
|
+
# The Collection class is a wrapper around the {Template} object. It
|
3
3
|
# provides a mechanism for processing an entire directory of templates.
|
4
4
|
class Collection
|
5
5
|
using Refinements
|
@@ -28,7 +28,7 @@ module Kojo
|
|
28
28
|
template = Template.new file
|
29
29
|
template.import_base = import_base
|
30
30
|
|
31
|
-
path = file.sub(
|
31
|
+
path = file.sub(%r{#{dir}/}, '').resolve args
|
32
32
|
|
33
33
|
yield path, template.render(args)
|
34
34
|
end
|
data/lib/kojo/commands/config.rb
CHANGED
@@ -8,22 +8,22 @@ module Kojo::Commands
|
|
8
8
|
|
9
9
|
attr_reader :gen, :outdir, :opts, :import_base, :config_file
|
10
10
|
|
11
|
-
help
|
11
|
+
help 'Transform based on instructions from a config file'
|
12
12
|
|
13
|
-
usage
|
14
|
-
usage
|
13
|
+
usage 'kojo config CONFIG [--save DIR --imports DIR --args FILE] [ARGS...]'
|
14
|
+
usage 'kojo config (-h|--help)'
|
15
15
|
|
16
|
-
option
|
17
|
-
option
|
18
|
-
option
|
16
|
+
option '-s --save DIR', 'Save output to directory instead of printing'
|
17
|
+
option '-i --imports DIR', 'Specify base directory for @import directives'
|
18
|
+
option '-a --args FILE', 'Load arguments from YAML file'
|
19
19
|
|
20
|
-
param
|
21
|
-
param
|
20
|
+
param 'CONFIG', 'YAML configuration file'
|
21
|
+
param 'ARGS', 'Optional key=value pairs'
|
22
22
|
|
23
|
-
example
|
24
|
-
example
|
25
|
-
example
|
26
|
-
example
|
23
|
+
example 'kojo config config.yml'
|
24
|
+
example 'kojo config config.yml --save output'
|
25
|
+
example 'kojo config config.yml -s output scale=3'
|
26
|
+
example 'kojo config config.yml -s output --args args.yml'
|
27
27
|
|
28
28
|
def run
|
29
29
|
@config_file = args['CONFIG']
|
data/lib/kojo/commands/dir.rb
CHANGED
@@ -8,22 +8,22 @@ module Kojo
|
|
8
8
|
|
9
9
|
attr_reader :opts, :indir, :outdir, :import_base
|
10
10
|
|
11
|
-
help
|
11
|
+
help 'Transform a folder of templates to a similar output folder'
|
12
12
|
|
13
|
-
usage
|
14
|
-
usage
|
13
|
+
usage 'kojo dir INDIR [--save DIR --imports DIR --args FILE] [ARGS...]'
|
14
|
+
usage 'kojo dir (-h|--help)'
|
15
15
|
|
16
|
-
option
|
17
|
-
option
|
18
|
-
option
|
16
|
+
option '-s --save DIR', 'Save output to directory instead of printing'
|
17
|
+
option '-i --imports DIR', 'Specify base directory for @import directives'
|
18
|
+
option '-a --args FILE', 'Load arguments from YAML file'
|
19
19
|
|
20
|
-
param
|
21
|
-
param
|
20
|
+
param 'INDIR', 'Directory containing templates to transform'
|
21
|
+
param 'ARGS', 'Optional key=value pairs'
|
22
22
|
|
23
|
-
example
|
24
|
-
example
|
25
|
-
example
|
26
|
-
example
|
23
|
+
example 'kojo dir indir'
|
24
|
+
example 'kojo dir in --save out env=production'
|
25
|
+
example 'kojo dir in --save out --imports snippets env=production'
|
26
|
+
example 'kojo dir in -s out -i snippets -a args.yml'
|
27
27
|
|
28
28
|
def run
|
29
29
|
@opts = args['ARGS'].args_to_hash
|
@@ -67,4 +67,4 @@ module Kojo
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
70
|
-
end
|
70
|
+
end
|
data/lib/kojo/commands/file.rb
CHANGED
@@ -8,22 +8,22 @@ module Kojo
|
|
8
8
|
|
9
9
|
attr_reader :opts, :outfile, :infile, :import_base
|
10
10
|
|
11
|
-
help
|
11
|
+
help 'Transform a file from a template'
|
12
12
|
|
13
|
-
usage
|
14
|
-
usage
|
13
|
+
usage 'kojo file INFILE [--save FILE --imports DIR --args FILE] [ARGS...]'
|
14
|
+
usage 'kojo file (-h|--help)'
|
15
15
|
|
16
|
-
option
|
17
|
-
option
|
18
|
-
option
|
16
|
+
option '-s --save FILE', 'Save to file instead of printing'
|
17
|
+
option '-i --imports DIR', 'Specify base directory for @import directives'
|
18
|
+
option '-a --args FILE', 'Load arguments from YAML file'
|
19
19
|
|
20
|
-
param
|
21
|
-
param
|
20
|
+
param 'INFILE', 'Template to transform'
|
21
|
+
param 'ARGS', 'Optional key=value pairs'
|
22
22
|
|
23
|
-
example
|
24
|
-
example
|
25
|
-
example
|
26
|
-
example
|
23
|
+
example 'kojo file main.yml'
|
24
|
+
example 'kojo file main.yml --save out.yml'
|
25
|
+
example 'kojo file main.yml -s out.yml app=lause'
|
26
|
+
example 'kojo file main.yml -s out.yml --args args.yml'
|
27
27
|
|
28
28
|
def run
|
29
29
|
@opts = args['ARGS'].args_to_hash
|
@@ -53,7 +53,6 @@ module Kojo
|
|
53
53
|
puts output
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
57
56
|
end
|
58
57
|
end
|
59
|
-
end
|
58
|
+
end
|
data/lib/kojo/commands/form.rb
CHANGED
@@ -6,30 +6,29 @@ module Kojo
|
|
6
6
|
class FormCmd < CommandBase
|
7
7
|
attr_reader :infile, :outdir
|
8
8
|
|
9
|
-
help
|
9
|
+
help 'Fill a template form interactively'
|
10
10
|
|
11
|
-
usage
|
12
|
-
usage
|
11
|
+
usage 'kojo form INFILE [--save FILE]'
|
12
|
+
usage 'kojo form (-h|--help)'
|
13
13
|
|
14
|
-
option
|
14
|
+
option '-s --save FILE', 'Save to file instead of printing'
|
15
15
|
|
16
|
-
param
|
16
|
+
param 'INFILE', 'ERBX template to transform'
|
17
17
|
|
18
|
-
example
|
19
|
-
example
|
18
|
+
example 'kojo form report.md'
|
19
|
+
example 'kojo form report.md --save output.md'
|
20
20
|
|
21
21
|
def run
|
22
22
|
infile = args['INFILE']
|
23
23
|
outfile = args['--save']
|
24
24
|
template = Kojo::Form.new infile
|
25
|
-
|
25
|
+
|
26
26
|
if outfile
|
27
27
|
save outfile, template.render
|
28
28
|
else
|
29
|
-
puts template.render
|
29
|
+
puts template.render
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
33
32
|
end
|
34
33
|
end
|
35
|
-
end
|
34
|
+
end
|
data/lib/kojo/commands/single.rb
CHANGED
@@ -8,20 +8,20 @@ module Kojo
|
|
8
8
|
|
9
9
|
attr_reader :opts, :infile, :outdir
|
10
10
|
|
11
|
-
help
|
11
|
+
help 'Transform using a single file that contains the instructions'
|
12
12
|
|
13
|
-
usage
|
14
|
-
usage
|
13
|
+
usage 'kojo single INFILE [--save DIR] [ARGS...]'
|
14
|
+
usage 'kojo single (-h|--help)'
|
15
15
|
|
16
|
-
option
|
16
|
+
option '-s --save DIR', 'Save output to directory instead of printing'
|
17
17
|
|
18
|
-
param
|
19
|
-
param
|
18
|
+
param 'INFILE', 'Template to transform. The template should contain a YAML front matter with transformation instructions'
|
19
|
+
param 'ARGS', 'Optional key=value pairs'
|
20
20
|
|
21
|
-
example
|
22
|
-
example
|
23
|
-
example
|
24
|
-
example
|
21
|
+
example 'kojo single Dockerfile'
|
22
|
+
example 'kojo single template.Dockerfile --save .'
|
23
|
+
example 'kojo single template.Dockerfile --save output'
|
24
|
+
example 'kojo single template.Dockerfile scale=2'
|
25
25
|
|
26
26
|
def run
|
27
27
|
@opts = args['ARGS'].args_to_hash
|
@@ -51,4 +51,4 @@ module Kojo
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
|
-
end
|
54
|
+
end
|
@@ -8,24 +8,24 @@ module Kojo
|
|
8
8
|
|
9
9
|
attr_reader :input, :save_files, :replace_files
|
10
10
|
|
11
|
-
help
|
11
|
+
help 'Convert one or more YAML files to JSON'
|
12
12
|
|
13
|
-
usage
|
14
|
-
usage
|
13
|
+
usage 'kojo tojson INPUT... [(--save | --replace)]'
|
14
|
+
usage 'kojo tojson (-h|--help)'
|
15
15
|
|
16
|
-
option
|
17
|
-
option
|
16
|
+
option '-s --save', 'Save each input file in the same directory'
|
17
|
+
option '-r --replace', 'Save each input file in the same directory and delete the input file'
|
18
18
|
|
19
|
-
param
|
19
|
+
param 'INPUT', 'Path to a YAML file or multiple files using a glob pattern'
|
20
20
|
|
21
|
-
example
|
22
|
-
example
|
23
|
-
example
|
24
|
-
example
|
25
|
-
example
|
21
|
+
example 'kojo tojson myfile.yaml'
|
22
|
+
example 'kojo tojson myfile.yaml --save'
|
23
|
+
example 'kojo tojson indir/*.yaml'
|
24
|
+
example 'kojo tojson indir/*.yaml --replace'
|
25
|
+
example 'kojo tojson indir/**/*.yml'
|
26
26
|
|
27
27
|
def run
|
28
|
-
@input =
|
28
|
+
@input = input_files
|
29
29
|
@save_files = args['--save'] || args['--replace']
|
30
30
|
@replace_files = args['--replace']
|
31
31
|
|
@@ -41,7 +41,7 @@ module Kojo
|
|
41
41
|
# Glob patterns are usually handled by the shell, but in case
|
42
42
|
# we still have '*' in our string (for example, if it was sent
|
43
43
|
# quoted), we will do the globbing ourselves
|
44
|
-
def
|
44
|
+
def input_files
|
45
45
|
args['INPUT'].map do |path|
|
46
46
|
path.include?('*') ? Dir[path].sort : path
|
47
47
|
end.flatten
|
@@ -64,4 +64,4 @@ module Kojo
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
|
-
end
|
67
|
+
end
|
data/lib/kojo/config.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Kojo
|
2
|
-
# The Config class handles multiple template generation from a
|
2
|
+
# The Config class handles multiple template generation from a
|
3
3
|
# definitions YAML file.
|
4
4
|
class Config
|
5
5
|
using Refinements
|
@@ -25,10 +25,10 @@ module Kojo
|
|
25
25
|
def generate_from_file(opts)
|
26
26
|
config['output'].each do |target, config_opts|
|
27
27
|
local_opts = opts.merge config_opts.symbolize_keys
|
28
|
-
|
28
|
+
|
29
29
|
template = Template.new source
|
30
30
|
template.import_base = import_base if import_base
|
31
|
-
|
31
|
+
|
32
32
|
yield target, template.render(local_opts)
|
33
33
|
end
|
34
34
|
end
|
@@ -62,5 +62,4 @@ module Kojo
|
|
62
62
|
@config ||= YAML.load_file config_file
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
66
65
|
end
|
data/lib/kojo/exceptions.rb
CHANGED
data/lib/kojo/extensions/yaml.rb
CHANGED
@@ -4,6 +4,6 @@ module YAML
|
|
4
4
|
# Make YAML.load behave the same in all Ruby versions
|
5
5
|
# ref: https://bugs.ruby-lang.org/issues/17866
|
6
6
|
class << self
|
7
|
-
|
7
|
+
alias load unsafe_load if YAML.respond_to? :unsafe_load
|
8
8
|
end
|
9
9
|
end
|
data/lib/kojo/form.rb
CHANGED
@@ -41,20 +41,19 @@ module Kojo
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
def
|
44
|
+
def respond_to_missing?(method_name, include_private = false)
|
45
45
|
prompt.respond_to?(method_name) || super
|
46
46
|
end
|
47
47
|
|
48
|
-
# Below are TTY::Prompt functions that are not captured by the
|
49
|
-
# `
|
48
|
+
# Below are TTY::Prompt functions that are not captured by the
|
49
|
+
# `method_missing`, so we specify them explicitly
|
50
50
|
|
51
|
-
def select(
|
52
|
-
prompt.select
|
51
|
+
def select(...)
|
52
|
+
prompt.select(...)
|
53
53
|
end
|
54
54
|
|
55
|
-
def warn(
|
56
|
-
prompt.warn
|
55
|
+
def warn(...)
|
56
|
+
prompt.warn(...)
|
57
57
|
end
|
58
|
-
|
59
58
|
end
|
60
59
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Kojo
|
2
|
-
# The FrontMatterTemplate class handles a single template file, that
|
2
|
+
# The FrontMatterTemplate class handles a single template file, that
|
3
3
|
# contains a YAML front matter.
|
4
4
|
class FrontMatterTemplate
|
5
5
|
using Refinements
|
@@ -23,10 +23,7 @@ module Kojo
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def handle(args = {})
|
26
|
-
|
27
|
-
content = content.eval_erb args, file
|
28
|
-
content = content.eval_vars args, file
|
29
|
-
content
|
26
|
+
template.eval_erb(args, file).eval_vars(args, file)
|
30
27
|
end
|
31
28
|
|
32
29
|
def read_file(file)
|
@@ -38,5 +35,4 @@ module Kojo
|
|
38
35
|
[config, content]
|
39
36
|
end
|
40
37
|
end
|
41
|
-
|
42
|
-
end
|
38
|
+
end
|
@@ -5,11 +5,8 @@ module Kojo
|
|
5
5
|
refine Array do
|
6
6
|
# Convert an array of +["key=value", "key=value"]+ pairs to a hash
|
7
7
|
def args_to_hash
|
8
|
-
|
9
|
-
.to_h
|
10
|
-
.symbolize_keys
|
11
|
-
.typecast_values
|
8
|
+
to_h { |a| a.split '=' }.symbolize_keys.typecast_values
|
12
9
|
end
|
13
10
|
end
|
14
11
|
end
|
15
|
-
end
|
12
|
+
end
|
@@ -4,12 +4,12 @@ module Kojo
|
|
4
4
|
module Refinements
|
5
5
|
refine Hash do
|
6
6
|
def symbolize_keys
|
7
|
-
transform_keys
|
7
|
+
transform_keys(&:to_sym)
|
8
8
|
end
|
9
9
|
|
10
10
|
def typecast_values
|
11
|
-
transform_values
|
11
|
+
transform_values(&:to_typed)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
@@ -6,11 +6,11 @@ module Kojo
|
|
6
6
|
refine String do
|
7
7
|
# Convert a string to the most appropriate type
|
8
8
|
def to_typed
|
9
|
-
if
|
10
|
-
|
9
|
+
if /\A[+-]?\d+\Z/.match?(self)
|
10
|
+
to_i
|
11
11
|
|
12
|
-
elsif
|
13
|
-
|
12
|
+
elsif /\A[+-]?\d+\.\d+\Z/.match?(self)
|
13
|
+
to_f
|
14
14
|
|
15
15
|
elsif %w[yes no true false].include? downcase
|
16
16
|
%w[yes true].include? downcase
|
@@ -23,12 +23,11 @@ module Kojo
|
|
23
23
|
|
24
24
|
def resolve(vars)
|
25
25
|
self % vars.symbolize_keys
|
26
|
-
|
27
26
|
rescue KeyError => e
|
28
27
|
raise unless Kojo.interactive?
|
29
28
|
|
30
29
|
print "> #{e.key}: "
|
31
|
-
vars[e.key] =
|
30
|
+
vars[e.key] = user_input
|
32
31
|
retry
|
33
32
|
end
|
34
33
|
|
@@ -47,16 +46,17 @@ module Kojo
|
|
47
46
|
end
|
48
47
|
|
49
48
|
def compress_imports
|
50
|
-
gsub
|
51
|
-
match.gsub
|
49
|
+
gsub(/^ *@import +[^(\s]+\s*\([\S\s]*?\) *$/) do |match|
|
50
|
+
match.gsub(/\r?\n\s*/, ' ')
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
|
-
private
|
54
|
+
private
|
56
55
|
|
57
|
-
def
|
56
|
+
def user_input
|
58
57
|
response = $stdin.gets
|
59
58
|
raise Kojo::Interrupt unless response # Ctrl+D
|
59
|
+
|
60
60
|
response.chomp
|
61
61
|
rescue ::Interrupt # Ctrl+C
|
62
62
|
raise Kojo::Interrupt
|
@@ -65,7 +65,6 @@ module Kojo
|
|
65
65
|
def erb(template, vars)
|
66
66
|
ERB.new(template, trim_mode: '-').result(OpenStruct.new(vars).instance_eval { binding })
|
67
67
|
end
|
68
|
-
|
69
68
|
end
|
70
69
|
end
|
71
|
-
end
|
70
|
+
end
|
data/lib/kojo/template.rb
CHANGED
@@ -24,15 +24,14 @@ module Kojo
|
|
24
24
|
protected
|
25
25
|
|
26
26
|
def evaluate(file)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
content = eval_imports content
|
31
|
-
content
|
27
|
+
eval_imports read_file(file)
|
28
|
+
.eval_erb(args, file)
|
29
|
+
.eval_vars(args, file)
|
32
30
|
end
|
33
31
|
|
34
32
|
def read_file(file)
|
35
33
|
raise Kojo::NotFoundError, "File not found: #{file}" unless File.exist? file
|
34
|
+
|
36
35
|
File.read file
|
37
36
|
end
|
38
37
|
|
@@ -46,18 +45,18 @@ module Kojo
|
|
46
45
|
if line =~ /^\s*@import ([^(\s]*)\s*(?:\((.*)\))?\s*/
|
47
46
|
file = $1
|
48
47
|
args = $2 || ''
|
49
|
-
args = instance_eval("{#{args}}")
|
48
|
+
args = instance_eval("{#{args}}", __FILE__, __LINE__)
|
50
49
|
imported = import file, args
|
51
50
|
line = indent imported, spaces
|
52
51
|
end
|
53
|
-
|
52
|
+
|
54
53
|
result.push line
|
55
54
|
end
|
56
55
|
|
57
56
|
result.join "\n"
|
58
57
|
end
|
59
58
|
|
60
|
-
def import(file, import_args={})
|
59
|
+
def import(file, import_args = {})
|
61
60
|
filename = File.expand_path "#{file}#{extension}", import_base
|
62
61
|
all_args = args.merge import_args
|
63
62
|
self.class.new(filename).render(all_args)
|
@@ -66,6 +65,5 @@ module Kojo
|
|
66
65
|
def indent(text, spaces)
|
67
66
|
text.lines.collect { |line| "#{' ' * spaces}#{line}" }.join.gsub(/^\s*$/, '')
|
68
67
|
end
|
69
|
-
|
70
68
|
end
|
71
69
|
end
|
data/lib/kojo/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Kojo
|
2
|
-
VERSION =
|
3
|
-
end
|
2
|
+
VERSION = '0.4.2'
|
3
|
+
end
|
data/lib/kojo.rb
CHANGED
@@ -16,14 +16,12 @@ require 'kojo/form'
|
|
16
16
|
|
17
17
|
module Kojo
|
18
18
|
class << self
|
19
|
+
attr_writer :interactive
|
20
|
+
|
19
21
|
def interactive?
|
20
22
|
return @interactive unless @interactive.nil?
|
21
|
-
@interactive = ENV['KOJO_INTERACTIVE'] == 'yes'
|
22
|
-
end
|
23
23
|
|
24
|
-
|
25
|
-
@interactive = value
|
24
|
+
@interactive = ENV['KOJO_INTERACTIVE'] == 'yes'
|
26
25
|
end
|
27
26
|
end
|
28
|
-
|
29
|
-
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,85 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kojo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: colsole
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: erbx
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: mister_bin
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.7.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.7.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: requires
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: tty-prompt
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: '0.21'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: '0.21'
|
83
83
|
description: Generate configuration files from templates, using variables and definition
|
84
84
|
files.
|
85
85
|
email: db@dannyben.com
|
@@ -114,7 +114,8 @@ files:
|
|
114
114
|
homepage: https://github.com/dannyben/kojo
|
115
115
|
licenses:
|
116
116
|
- MIT
|
117
|
-
metadata:
|
117
|
+
metadata:
|
118
|
+
rubygems_mfa_required: 'true'
|
118
119
|
post_install_message:
|
119
120
|
rdoc_options: []
|
120
121
|
require_paths:
|
@@ -123,14 +124,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
124
|
requirements:
|
124
125
|
- - ">="
|
125
126
|
- !ruby/object:Gem::Version
|
126
|
-
version: 2.
|
127
|
+
version: 2.7.0
|
127
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
129
|
requirements:
|
129
130
|
- - ">="
|
130
131
|
- !ruby/object:Gem::Version
|
131
132
|
version: '0'
|
132
133
|
requirements: []
|
133
|
-
rubygems_version: 3.
|
134
|
+
rubygems_version: 3.4.3
|
134
135
|
signing_key:
|
135
136
|
specification_version: 4
|
136
137
|
summary: Configuration Ninja
|