kojo 0.3.9 → 0.4.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: 1952c33f6d6360f1a027ee30eefcfea5636a062c2c28c02d83916d99e51ed7c1
4
- data.tar.gz: 9554ea0de969c79e11d40b237d4ffb24c3bceead6dc863511124af6b4753841b
3
+ metadata.gz: 6fe6f0b9571a1cdd9a808cccaac4dcf5049647d1bc3190702ca45b811421ed61
4
+ data.tar.gz: 7fde526ad1d6efd84a8571c87ef419da1b7f672f06d55982efe68dc487399a29
5
5
  SHA512:
6
- metadata.gz: 40bdbcfa32871516c1776923dffd3d78b0757463941da85708b4292e9a84f5c8308dd655e1707493e6da9411771a12c18a57d7098ae0d85cc1c537bf41d3fcb7
7
- data.tar.gz: 76d43feccd9c0210bd3239f86b089a27527fdbd293daaf771dcb3d8170dd5d57a864e2a7fc399a00b6989d963659eb1e7ea9a7b8e7f23561a288a27e7187d941
6
+ metadata.gz: e8fc1e607b10197997602db589b6e3ca4f692b7a17118b276fe2e2e5bfe7ee471b6217b3dcaf12f3a5cac85df2d9b50bbc8d2e77a2ccef542e5009a3952546d2
7
+ data.tar.gz: 2ea4b1943f5a6169881bcf4a68071718016041e0aa0a2e0d5a9673ead2eb5653dfa94f77533b320791d2c7fb8338b2cccfa3905b523b2d2a129c829d8ef4732e
data/README.md CHANGED
@@ -89,7 +89,15 @@ resulting configuration file.
89
89
  @import filename (arg: "value", arg2: "value")
90
90
  ```
91
91
 
92
- The space after `filename` is optional.
92
+ The space after `filename` is optional, and the arguments list can be split to
93
+ multiple lines:
94
+
95
+ ```ruby
96
+ @import filename (
97
+ arg: "value",
98
+ arg2: "value"
99
+ )
100
+ ```
93
101
 
94
102
  ### Transform an Entire Folder
95
103
 
@@ -46,6 +46,12 @@ module Kojo
46
46
  raise Kojo::TemplateError, "#{e.message}\nin: #{filename}"
47
47
  end
48
48
 
49
+ def compress_imports
50
+ gsub /^ *@import +[^(\s]+\s*\([\S\s]*?\) *$/ do |match|
51
+ match.gsub /\r?\n\s*/, " "
52
+ end
53
+ end
54
+
49
55
  private
50
56
 
51
57
  def get_user_input
data/lib/kojo/template.rb CHANGED
@@ -38,8 +38,8 @@ module Kojo
38
38
 
39
39
  def eval_imports(content)
40
40
  result = []
41
-
42
- content.lines.each do |line|
41
+
42
+ content.compress_imports.lines.each do |line|
43
43
  line.chomp!
44
44
  spaces = line[/^\s*/].size
45
45
 
data/lib/kojo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kojo
2
- VERSION = "0.3.9"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kojo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
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: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2022-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mister_bin