rkwalify 1.4.0.pre.beta → 1.4.0
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/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/workflows/ruby.yml +2 -2
- data/.rubocop.yml +24 -2
- data/.ruby-version +1 -1
- data/Attic/spec/rspec-ex_spec.rb +1 -1
- data/CHANGELOG.md +60 -22
- data/CODE_OF_CONDUCT.md +147 -0
- data/Gemfile.lock +5 -4
- data/README.md +9 -12
- data/ROLL-OUT-STRATEGY.md +5 -4
- data/SECURITY.md +19 -0
- data/bin/kwalify +26 -31
- data/bin/kwalify.rb +26 -31
- data/devbin/README.md +6 -2
- data/{contrib → devbin}/inline-require +1 -1
- data/devbin/mkbig-rkwalify.sh +1 -3
- data/devbin/mktag +2 -2
- data/devbin/rubycheck.sh +39 -0
- data/devbin/run-smoketest.sh +17 -0
- data/devbin/smoke-tests.golden +67 -73
- data/devbin/smoke-tests.sh +23 -20
- data/devbin/update-rel-numbers.sh +3 -3
- data/doc-api/classes/CommandOptionError.html +1 -1
- data/doc-api/classes/Kwalify/Util.html +2 -2
- data/doc-api/classes/Kwalify.html +1 -1
- data/doc-api/files/__/README_txt.html +1 -1
- data/doc-api/files/kwalify/errors_rb.html +1 -1
- data/doc-api/files/kwalify/main_rb.html +1 -1
- data/doc-api/files/kwalify/messages_rb.html +1 -1
- data/doc-api/files/kwalify/meta-validator_rb.html +1 -1
- data/doc-api/files/kwalify/parser/base_rb.html +1 -1
- data/doc-api/files/kwalify/parser/yaml_rb.html +1 -1
- data/doc-api/files/kwalify/rule_rb.html +1 -1
- data/doc-api/files/kwalify/types_rb.html +1 -1
- data/doc-api/files/kwalify/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwalify/util/hash-interface_rb.html +1 -1
- data/doc-api/files/kwalify/util/hashlike_rb.html +1 -1
- data/doc-api/files/kwalify/util/option-parser_rb.html +1 -1
- data/doc-api/files/kwalify/util/ordered-hash_rb.html +1 -1
- data/doc-api/files/kwalify/util/testcase-helper_rb.html +1 -1
- data/doc-api/files/kwalify/util_rb.html +1 -1
- data/doc-api/files/kwalify/validator_rb.html +1 -1
- data/doc-api/files/kwalify/yaml-parser_rb.html +1 -1
- data/doc-api/files/kwalify_rb.html +1 -1
- data/examples/address-book/address-book.schema.yaml +1 -1
- data/examples/invoice/invoice.schema.yaml +1 -1
- data/examples/tapkit/tapkit.schema.yaml +1 -1
- data/lib/kwalify/errors.rb +2 -2
- data/lib/kwalify/main.rb +3 -5
- data/lib/kwalify/messages.rb +1 -1
- data/lib/kwalify/meta-validator.rb +4 -5
- data/lib/kwalify/parser/base.rb +2 -3
- data/lib/kwalify/parser/yaml.rb +5 -5
- data/lib/kwalify/rule.rb +13 -14
- data/lib/kwalify/templates/genclass-java.eruby +1 -1
- data/lib/kwalify/templates/genclass-php.eruby +1 -1
- data/lib/kwalify/templates/genclass-ruby.eruby +1 -1
- data/lib/kwalify/types.rb +1 -1
- data/lib/kwalify/util/assert-text-equal.rb +2 -2
- data/lib/kwalify/util/hash-interface.rb +1 -1
- data/lib/kwalify/util/hashlike.rb +5 -4
- data/lib/kwalify/util/option-parser.rb +1 -1
- data/lib/kwalify/util/ordered-hash.rb +1 -1
- data/lib/kwalify/util/testcase-helper.rb +1 -1
- data/lib/kwalify/util.rb +8 -7
- data/lib/kwalify/validator.rb +38 -13
- data/lib/kwalify/version.rb +1 -1
- data/lib/kwalify/yaml-parser.rb +17 -14
- data/lib/kwalify.rb +26 -1
- data/test/Rookbook.yaml +1 -1
- data/test/data/users-guide/answers-validator.rb +0 -0
- data/test/data/users-guide/validate08.rb +0 -0
- data/test/test-action.rb +1 -1
- data/test/test-action.yaml +1 -1
- data/test/test-databinding.rb +3 -5
- data/test/test-databinding.yaml +1 -1
- data/test/test-hashlike.rb +29 -0
- data/test/test-main.rb +1 -1
- data/test/test-main.yaml +1 -1
- data/test/test-metavalidator.rb +5 -5
- data/test/test-metavalidator.yaml +1 -1
- data/test/test-parser-yaml.rb +5 -5
- data/test/test-parser-yaml.yaml +1 -2
- data/test/test-rule.rb +1 -1
- data/test/test-rule.yaml +1 -2
- data/test/test-users-guide.rb +1 -1
- data/test/test-util.rb +1 -1
- data/test/test-validator.rb +4 -4
- data/test/test-validator.yaml +1 -1
- data/test/test-yaml-parser.rb +3 -3
- data/test/test-yaml-parser.yaml +47 -48
- data/test/test.rb +40 -25
- data/test/test_logger.rb +37 -0
- metadata +11 -6
- data/.rubocop_todo.yml +0 -1369
- data/contrib/kwalify +0 -4167
- /data/{contrib → Attic}/kwalify-0.7.2 +0 -0
- /data/{MIT-LICENSE → MIT-LICENSE.txt} +0 -0
data/bin/kwalify
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
###
|
|
4
4
|
### $Rev$
|
|
5
|
-
### $Release 1.4.0
|
|
5
|
+
### $Release 1.4.0 $
|
|
6
6
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
7
7
|
###
|
|
8
8
|
|
|
9
9
|
#--begin of require 'kwalify'
|
|
10
10
|
###
|
|
11
11
|
### $Rev$
|
|
12
|
-
### $Release 1.4.0
|
|
12
|
+
### $Release 1.4.0 $
|
|
13
13
|
### copyright(c) 2006 kuwata-lab.com all rights reserved.
|
|
14
14
|
###
|
|
15
15
|
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
### copyright(c) 2006 kuwata-lab.com all rights reserved.
|
|
18
18
|
|
|
19
19
|
module Kwalify
|
|
20
|
-
RELEASE = '1.4.0
|
|
20
|
+
RELEASE = '1.4.0' # Same as in the gemspec file.
|
|
21
21
|
end
|
|
22
22
|
#--end of require 'kwalify/version'
|
|
23
23
|
#--begin of require 'kwalify/types'
|
|
24
24
|
###
|
|
25
25
|
### $Rev$
|
|
26
|
-
### $Release 1.4.0
|
|
26
|
+
### $Release 1.4.0 $
|
|
27
27
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
28
28
|
###
|
|
29
29
|
|
|
@@ -181,7 +181,7 @@ end
|
|
|
181
181
|
#--begin of require 'kwalify/messages'
|
|
182
182
|
###
|
|
183
183
|
### $Rev$
|
|
184
|
-
### $Release 1.4.0
|
|
184
|
+
### $Release 1.4.0 $
|
|
185
185
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
186
186
|
###
|
|
187
187
|
|
|
@@ -356,7 +356,7 @@ end
|
|
|
356
356
|
#--begin of require 'kwalify/errors'
|
|
357
357
|
###
|
|
358
358
|
### $Rev$
|
|
359
|
-
### $Release 1.4.0
|
|
359
|
+
### $Release 1.4.0 $
|
|
360
360
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
361
361
|
###
|
|
362
362
|
|
|
@@ -485,10 +485,9 @@ end
|
|
|
485
485
|
#--begin of require 'kwalify/rule'
|
|
486
486
|
###
|
|
487
487
|
### $Rev$
|
|
488
|
-
### $Release 1.4.0
|
|
488
|
+
### $Release 1.4.0 $
|
|
489
489
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
490
490
|
###
|
|
491
|
-
# frozen_string_literal: false
|
|
492
491
|
|
|
493
492
|
#--already included require 'kwalify/messages'
|
|
494
493
|
#--already included require 'kwalify/errors'
|
|
@@ -1049,7 +1048,7 @@ end
|
|
|
1049
1048
|
#--begin of require 'kwalify/validator'
|
|
1050
1049
|
###
|
|
1051
1050
|
### $Rev$
|
|
1052
|
-
### $Release 1.4.0
|
|
1051
|
+
### $Release 1.4.0 $
|
|
1053
1052
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1054
1053
|
###
|
|
1055
1054
|
|
|
@@ -1333,7 +1332,7 @@ end
|
|
|
1333
1332
|
#--begin of require 'kwalify/meta-validator'
|
|
1334
1333
|
###
|
|
1335
1334
|
### $Rev$
|
|
1336
|
-
### $Release 1.4.0
|
|
1335
|
+
### $Release 1.4.0 $
|
|
1337
1336
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1338
1337
|
###
|
|
1339
1338
|
|
|
@@ -1343,7 +1342,7 @@ end
|
|
|
1343
1342
|
#--begin of require 'kwalify/parser/yaml'
|
|
1344
1343
|
###
|
|
1345
1344
|
### $Rev$
|
|
1346
|
-
### $Release 1.4.0
|
|
1345
|
+
### $Release 1.4.0 $
|
|
1347
1346
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1348
1347
|
###
|
|
1349
1348
|
|
|
@@ -1352,10 +1351,9 @@ end
|
|
|
1352
1351
|
#--begin of require 'kwalify/util'
|
|
1353
1352
|
###
|
|
1354
1353
|
### $Rev$
|
|
1355
|
-
### $Release 1.4.0
|
|
1354
|
+
### $Release 1.4.0 $
|
|
1356
1355
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1357
1356
|
###
|
|
1358
|
-
# frozen_string_literal: false
|
|
1359
1357
|
|
|
1360
1358
|
module Kwalify
|
|
1361
1359
|
|
|
@@ -1473,7 +1471,7 @@ module Kwalify
|
|
|
1473
1471
|
hashlist.each do |hash|
|
|
1474
1472
|
key = hash[primarykey]
|
|
1475
1473
|
unless key
|
|
1476
|
-
|
|
1474
|
+
raise "primary key '#{key}' not found."
|
|
1477
1475
|
end
|
|
1478
1476
|
if flag_duplicate_check && hashtable.key?(key)
|
|
1479
1477
|
raise "primary key '#{key}' duplicated (value '#{hashtable[key]}')"
|
|
@@ -1513,10 +1511,9 @@ end
|
|
|
1513
1511
|
#--begin of require 'kwalify/parser/base'
|
|
1514
1512
|
###
|
|
1515
1513
|
### $Rev$
|
|
1516
|
-
### $Release 1.4.0
|
|
1514
|
+
### $Release 1.4.0 $
|
|
1517
1515
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1518
1516
|
###
|
|
1519
|
-
# frozen_string_literal: false
|
|
1520
1517
|
|
|
1521
1518
|
require 'strscan'
|
|
1522
1519
|
#--already included require 'kwalify/errors'
|
|
@@ -2153,7 +2150,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2153
2150
|
else # indicator == '>'
|
|
2154
2151
|
if !text.empty? && spaces.length == indent
|
|
2155
2152
|
if s.sub!(/\r?\n((\r?\n)+)\z/, '\1')
|
|
2156
|
-
nil
|
|
2153
|
+
# Ruby will return "nil"
|
|
2157
2154
|
elsif is_folded
|
|
2158
2155
|
s.sub!(/\r?\n\z/, ' ')
|
|
2159
2156
|
end
|
|
@@ -2168,7 +2165,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2168
2165
|
end
|
|
2169
2166
|
## chomping
|
|
2170
2167
|
if chomping == '+'
|
|
2171
|
-
nil
|
|
2168
|
+
# Ruby will return "nil"
|
|
2172
2169
|
elsif chomping == '-'
|
|
2173
2170
|
s.sub!(/(\r?\n)+\z/, '')
|
|
2174
2171
|
else
|
|
@@ -2231,7 +2228,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2231
2228
|
scan('[')
|
|
2232
2229
|
skip_spaces_and_comments()
|
|
2233
2230
|
if scan(']')
|
|
2234
|
-
nil
|
|
2231
|
+
# Ruby will return "nil"
|
|
2235
2232
|
else
|
|
2236
2233
|
rule = seq_rule ? seq_rule.sequence[0] : nil #*V
|
|
2237
2234
|
uniq_table = rule ? rule._uniqueness_check_table() : nil #*V
|
|
@@ -2270,7 +2267,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2270
2267
|
scan('{')
|
|
2271
2268
|
skip_spaces_and_comments()
|
|
2272
2269
|
if scan('}')
|
|
2273
|
-
nil
|
|
2270
|
+
# Ruby will return "nil"
|
|
2274
2271
|
else
|
|
2275
2272
|
path.push(nil)
|
|
2276
2273
|
is_merged = false
|
|
@@ -2742,17 +2739,14 @@ end
|
|
|
2742
2739
|
#--begin of require 'kwalify/yaml-parser'
|
|
2743
2740
|
###
|
|
2744
2741
|
### $Rev$
|
|
2745
|
-
### $Release 1.4.0
|
|
2742
|
+
### $Release 1.4.0 $
|
|
2746
2743
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
2747
2744
|
###
|
|
2748
|
-
# frozen_string_literal: false
|
|
2749
2745
|
|
|
2750
2746
|
#--already included require 'kwalify/messages'
|
|
2751
2747
|
#--already included require 'kwalify/errors'
|
|
2752
2748
|
#--already included require 'kwalify/types'
|
|
2753
2749
|
|
|
2754
|
-
require 'date'
|
|
2755
|
-
|
|
2756
2750
|
|
|
2757
2751
|
module Kwalify
|
|
2758
2752
|
|
|
@@ -3298,7 +3292,7 @@ module Kwalify
|
|
|
3298
3292
|
s = ''
|
|
3299
3293
|
empty = ''
|
|
3300
3294
|
min_indent = -1
|
|
3301
|
-
while line = _getline()
|
|
3295
|
+
while (line = _getline())
|
|
3302
3296
|
line =~ /^( *)(.*)/
|
|
3303
3297
|
indent = $1.length
|
|
3304
3298
|
if $2.empty?
|
|
@@ -3447,8 +3441,10 @@ module Kwalify
|
|
|
3447
3441
|
if tzone_h
|
|
3448
3442
|
diff_sec = tzone_h.to_i * 60 * 60
|
|
3449
3443
|
if tzone_m
|
|
3450
|
-
if diff_sec > 0
|
|
3451
|
-
|
|
3444
|
+
if diff_sec > 0
|
|
3445
|
+
diff_sec += tzone_m.to_i * 60
|
|
3446
|
+
else
|
|
3447
|
+
diff_sec -= tzone_m.to_i * 60
|
|
3452
3448
|
end
|
|
3453
3449
|
end
|
|
3454
3450
|
p diff_sec
|
|
@@ -3663,10 +3659,9 @@ end
|
|
|
3663
3659
|
#--begin of require 'kwalify/main'
|
|
3664
3660
|
###
|
|
3665
3661
|
### $Rev$
|
|
3666
|
-
### $Release 1.4.0
|
|
3662
|
+
### $Release 1.4.0 $
|
|
3667
3663
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
3668
3664
|
###
|
|
3669
|
-
# frozen_string_literal: false
|
|
3670
3665
|
|
|
3671
3666
|
require 'yaml'
|
|
3672
3667
|
require 'erb'
|
|
@@ -3675,7 +3670,7 @@ require 'erb'
|
|
|
3675
3670
|
#--begin of require 'kwalify/util/ordered-hash'
|
|
3676
3671
|
###
|
|
3677
3672
|
### $Rev$
|
|
3678
|
-
### 1.4.0
|
|
3673
|
+
### 1.4.0
|
|
3679
3674
|
### $COPYRIGHT$
|
|
3680
3675
|
###
|
|
3681
3676
|
|
|
@@ -3850,7 +3845,7 @@ module Kwalify
|
|
|
3850
3845
|
exit 1
|
|
3851
3846
|
rescue Kwalify::KwalifyError => ex
|
|
3852
3847
|
raise ex if main.debug?
|
|
3853
|
-
$stderr.puts "ERROR: #{ex
|
|
3848
|
+
$stderr.puts "ERROR: #{ex}"
|
|
3854
3849
|
exit 1
|
|
3855
3850
|
#rescue => ex
|
|
3856
3851
|
# if main.debug?
|
data/bin/kwalify.rb
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
###
|
|
4
4
|
### $Rev$
|
|
5
|
-
### $Release 1.4.0
|
|
5
|
+
### $Release 1.4.0 $
|
|
6
6
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
7
7
|
###
|
|
8
8
|
|
|
9
9
|
#--begin of require 'kwalify'
|
|
10
10
|
###
|
|
11
11
|
### $Rev$
|
|
12
|
-
### $Release 1.4.0
|
|
12
|
+
### $Release 1.4.0 $
|
|
13
13
|
### copyright(c) 2006 kuwata-lab.com all rights reserved.
|
|
14
14
|
###
|
|
15
15
|
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
### copyright(c) 2006 kuwata-lab.com all rights reserved.
|
|
18
18
|
|
|
19
19
|
module Kwalify
|
|
20
|
-
RELEASE = '1.4.0
|
|
20
|
+
RELEASE = '1.4.0' # Same as in the gemspec file.
|
|
21
21
|
end
|
|
22
22
|
#--end of require 'kwalify/version'
|
|
23
23
|
#--begin of require 'kwalify/types'
|
|
24
24
|
###
|
|
25
25
|
### $Rev$
|
|
26
|
-
### $Release 1.4.0
|
|
26
|
+
### $Release 1.4.0 $
|
|
27
27
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
28
28
|
###
|
|
29
29
|
|
|
@@ -181,7 +181,7 @@ end
|
|
|
181
181
|
#--begin of require 'kwalify/messages'
|
|
182
182
|
###
|
|
183
183
|
### $Rev$
|
|
184
|
-
### $Release 1.4.0
|
|
184
|
+
### $Release 1.4.0 $
|
|
185
185
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
186
186
|
###
|
|
187
187
|
|
|
@@ -356,7 +356,7 @@ end
|
|
|
356
356
|
#--begin of require 'kwalify/errors'
|
|
357
357
|
###
|
|
358
358
|
### $Rev$
|
|
359
|
-
### $Release 1.4.0
|
|
359
|
+
### $Release 1.4.0 $
|
|
360
360
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
361
361
|
###
|
|
362
362
|
|
|
@@ -485,10 +485,9 @@ end
|
|
|
485
485
|
#--begin of require 'kwalify/rule'
|
|
486
486
|
###
|
|
487
487
|
### $Rev$
|
|
488
|
-
### $Release 1.4.0
|
|
488
|
+
### $Release 1.4.0 $
|
|
489
489
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
490
490
|
###
|
|
491
|
-
# frozen_string_literal: false
|
|
492
491
|
|
|
493
492
|
#--already included require 'kwalify/messages'
|
|
494
493
|
#--already included require 'kwalify/errors'
|
|
@@ -1049,7 +1048,7 @@ end
|
|
|
1049
1048
|
#--begin of require 'kwalify/validator'
|
|
1050
1049
|
###
|
|
1051
1050
|
### $Rev$
|
|
1052
|
-
### $Release 1.4.0
|
|
1051
|
+
### $Release 1.4.0 $
|
|
1053
1052
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1054
1053
|
###
|
|
1055
1054
|
|
|
@@ -1333,7 +1332,7 @@ end
|
|
|
1333
1332
|
#--begin of require 'kwalify/meta-validator'
|
|
1334
1333
|
###
|
|
1335
1334
|
### $Rev$
|
|
1336
|
-
### $Release 1.4.0
|
|
1335
|
+
### $Release 1.4.0 $
|
|
1337
1336
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1338
1337
|
###
|
|
1339
1338
|
|
|
@@ -1343,7 +1342,7 @@ end
|
|
|
1343
1342
|
#--begin of require 'kwalify/parser/yaml'
|
|
1344
1343
|
###
|
|
1345
1344
|
### $Rev$
|
|
1346
|
-
### $Release 1.4.0
|
|
1345
|
+
### $Release 1.4.0 $
|
|
1347
1346
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1348
1347
|
###
|
|
1349
1348
|
|
|
@@ -1352,10 +1351,9 @@ end
|
|
|
1352
1351
|
#--begin of require 'kwalify/util'
|
|
1353
1352
|
###
|
|
1354
1353
|
### $Rev$
|
|
1355
|
-
### $Release 1.4.0
|
|
1354
|
+
### $Release 1.4.0 $
|
|
1356
1355
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1357
1356
|
###
|
|
1358
|
-
# frozen_string_literal: false
|
|
1359
1357
|
|
|
1360
1358
|
module Kwalify
|
|
1361
1359
|
|
|
@@ -1473,7 +1471,7 @@ module Kwalify
|
|
|
1473
1471
|
hashlist.each do |hash|
|
|
1474
1472
|
key = hash[primarykey]
|
|
1475
1473
|
unless key
|
|
1476
|
-
|
|
1474
|
+
raise "primary key '#{key}' not found."
|
|
1477
1475
|
end
|
|
1478
1476
|
if flag_duplicate_check && hashtable.key?(key)
|
|
1479
1477
|
raise "primary key '#{key}' duplicated (value '#{hashtable[key]}')"
|
|
@@ -1513,10 +1511,9 @@ end
|
|
|
1513
1511
|
#--begin of require 'kwalify/parser/base'
|
|
1514
1512
|
###
|
|
1515
1513
|
### $Rev$
|
|
1516
|
-
### $Release 1.4.0
|
|
1514
|
+
### $Release 1.4.0 $
|
|
1517
1515
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
1518
1516
|
###
|
|
1519
|
-
# frozen_string_literal: false
|
|
1520
1517
|
|
|
1521
1518
|
require 'strscan'
|
|
1522
1519
|
#--already included require 'kwalify/errors'
|
|
@@ -2153,7 +2150,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2153
2150
|
else # indicator == '>'
|
|
2154
2151
|
if !text.empty? && spaces.length == indent
|
|
2155
2152
|
if s.sub!(/\r?\n((\r?\n)+)\z/, '\1')
|
|
2156
|
-
nil
|
|
2153
|
+
# Ruby will return "nil"
|
|
2157
2154
|
elsif is_folded
|
|
2158
2155
|
s.sub!(/\r?\n\z/, ' ')
|
|
2159
2156
|
end
|
|
@@ -2168,7 +2165,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2168
2165
|
end
|
|
2169
2166
|
## chomping
|
|
2170
2167
|
if chomping == '+'
|
|
2171
|
-
nil
|
|
2168
|
+
# Ruby will return "nil"
|
|
2172
2169
|
elsif chomping == '-'
|
|
2173
2170
|
s.sub!(/(\r?\n)+\z/, '')
|
|
2174
2171
|
else
|
|
@@ -2231,7 +2228,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2231
2228
|
scan('[')
|
|
2232
2229
|
skip_spaces_and_comments()
|
|
2233
2230
|
if scan(']')
|
|
2234
|
-
nil
|
|
2231
|
+
# Ruby will return "nil"
|
|
2235
2232
|
else
|
|
2236
2233
|
rule = seq_rule ? seq_rule.sequence[0] : nil #*V
|
|
2237
2234
|
uniq_table = rule ? rule._uniqueness_check_table() : nil #*V
|
|
@@ -2270,7 +2267,7 @@ class Kwalify::Yaml::Parser < Kwalify::BaseParser
|
|
|
2270
2267
|
scan('{')
|
|
2271
2268
|
skip_spaces_and_comments()
|
|
2272
2269
|
if scan('}')
|
|
2273
|
-
nil
|
|
2270
|
+
# Ruby will return "nil"
|
|
2274
2271
|
else
|
|
2275
2272
|
path.push(nil)
|
|
2276
2273
|
is_merged = false
|
|
@@ -2742,17 +2739,14 @@ end
|
|
|
2742
2739
|
#--begin of require 'kwalify/yaml-parser'
|
|
2743
2740
|
###
|
|
2744
2741
|
### $Rev$
|
|
2745
|
-
### $Release 1.4.0
|
|
2742
|
+
### $Release 1.4.0 $
|
|
2746
2743
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
2747
2744
|
###
|
|
2748
|
-
# frozen_string_literal: false
|
|
2749
2745
|
|
|
2750
2746
|
#--already included require 'kwalify/messages'
|
|
2751
2747
|
#--already included require 'kwalify/errors'
|
|
2752
2748
|
#--already included require 'kwalify/types'
|
|
2753
2749
|
|
|
2754
|
-
require 'date'
|
|
2755
|
-
|
|
2756
2750
|
|
|
2757
2751
|
module Kwalify
|
|
2758
2752
|
|
|
@@ -3298,7 +3292,7 @@ module Kwalify
|
|
|
3298
3292
|
s = ''
|
|
3299
3293
|
empty = ''
|
|
3300
3294
|
min_indent = -1
|
|
3301
|
-
while line = _getline()
|
|
3295
|
+
while (line = _getline())
|
|
3302
3296
|
line =~ /^( *)(.*)/
|
|
3303
3297
|
indent = $1.length
|
|
3304
3298
|
if $2.empty?
|
|
@@ -3447,8 +3441,10 @@ module Kwalify
|
|
|
3447
3441
|
if tzone_h
|
|
3448
3442
|
diff_sec = tzone_h.to_i * 60 * 60
|
|
3449
3443
|
if tzone_m
|
|
3450
|
-
if diff_sec > 0
|
|
3451
|
-
|
|
3444
|
+
if diff_sec > 0
|
|
3445
|
+
diff_sec += tzone_m.to_i * 60
|
|
3446
|
+
else
|
|
3447
|
+
diff_sec -= tzone_m.to_i * 60
|
|
3452
3448
|
end
|
|
3453
3449
|
end
|
|
3454
3450
|
p diff_sec
|
|
@@ -3663,10 +3659,9 @@ end
|
|
|
3663
3659
|
#--begin of require 'kwalify/main'
|
|
3664
3660
|
###
|
|
3665
3661
|
### $Rev$
|
|
3666
|
-
### $Release 1.4.0
|
|
3662
|
+
### $Release 1.4.0 $
|
|
3667
3663
|
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
3668
3664
|
###
|
|
3669
|
-
# frozen_string_literal: false
|
|
3670
3665
|
|
|
3671
3666
|
require 'yaml'
|
|
3672
3667
|
require 'erb'
|
|
@@ -3675,7 +3670,7 @@ require 'erb'
|
|
|
3675
3670
|
#--begin of require 'kwalify/util/ordered-hash'
|
|
3676
3671
|
###
|
|
3677
3672
|
### $Rev$
|
|
3678
|
-
### 1.4.0
|
|
3673
|
+
### 1.4.0
|
|
3679
3674
|
### $COPYRIGHT$
|
|
3680
3675
|
###
|
|
3681
3676
|
|
|
@@ -3850,7 +3845,7 @@ module Kwalify
|
|
|
3850
3845
|
exit 1
|
|
3851
3846
|
rescue Kwalify::KwalifyError => ex
|
|
3852
3847
|
raise ex if main.debug?
|
|
3853
|
-
$stderr.puts "ERROR: #{ex
|
|
3848
|
+
$stderr.puts "ERROR: #{ex}"
|
|
3854
3849
|
exit 1
|
|
3855
3850
|
#rescue => ex
|
|
3856
3851
|
# if main.debug?
|
data/devbin/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
2
3
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
3
4
|
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
|
@@ -18,12 +19,15 @@ Currently these scripts include:
|
|
|
18
19
|
* ruby_docs_wordlist.txt - list of words from ruby doc (not included)
|
|
19
20
|
* ruby_3_4_1_complete_rdocs (not included)
|
|
20
21
|
* chk-rad-repo.sh - Test code against ruby-advisory-db repo.
|
|
21
|
-
*
|
|
22
|
-
* smoke-tests.
|
|
22
|
+
* run-smoketest.sh - Wrapper to run the "smoke-tests.sh script.
|
|
23
|
+
* smoke-tests.sh - short and dirty version of testsuite.,
|
|
24
|
+
* smoke-tests.golden
|
|
25
|
+
* rubycheck.sh - Test code against "ruby -d -v".
|
|
23
26
|
* runtests.sh
|
|
24
27
|
|
|
25
28
|
* PACKAGING:
|
|
26
29
|
* mkbig-rkwalify.sh - Combine all the code into 1 file.
|
|
30
|
+
* inline-require (node-js tool to incline all require code into 1 file)
|
|
27
31
|
|
|
28
32
|
* RELEASING:
|
|
29
33
|
* chkcopyrights.sh - Check copyright lines in files.
|
data/devbin/mkbig-rkwalify.sh
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
unset RUBYLIB
|
|
4
|
-
ruby ./
|
|
5
|
-
chmod a+x ./contrib/kwalify
|
|
4
|
+
ruby ./devbin/inline-require -I ./lib ./bin/kwalify.rb > ./bin/kwalify
|
|
6
5
|
cp ./lib/kwalify/kwalify.schema.yaml ./bin
|
|
7
|
-
cp ./contrib/kwalify ./bin
|
data/devbin/mktag
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
HASHTAG="
|
|
2
|
-
git tag -a v1.4.0
|
|
1
|
+
HASHTAG="990cb946d1a32d99a9ffc034fb83f1d60a2267f0"
|
|
2
|
+
git tag -a v1.4.0 "${HASHTAG}" -m "Release version 1.4.0"
|
|
3
3
|
git push origin --tags
|
data/devbin/rubycheck.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function run1chk() {
|
|
2
|
+
CMD="ruby -d -v -i.:lib:test"
|
|
3
|
+
if [ "X$2X" == "X-nX" ] ; then
|
|
4
|
+
echo "$1: $(${CMD} $1 2>&1 | wc -l)"
|
|
5
|
+
else
|
|
6
|
+
${CMD} $1 2>&1
|
|
7
|
+
fi
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
# 7
|
|
11
|
+
#run1chk test/test-hashlike.rb $1
|
|
12
|
+
|
|
13
|
+
# 7
|
|
14
|
+
run1chk test/test-action.rb $1
|
|
15
|
+
exit
|
|
16
|
+
# 7
|
|
17
|
+
run1chk test/test-main.rb $1
|
|
18
|
+
# 7
|
|
19
|
+
run1chk test/test-parser-yaml.rb $1
|
|
20
|
+
# 7
|
|
21
|
+
run1chk test/test-util.rb $1
|
|
22
|
+
|
|
23
|
+
# 8
|
|
24
|
+
run1chk test/test-databinding.rb $1
|
|
25
|
+
# 8
|
|
26
|
+
run1chk test/test_logger.rb $1
|
|
27
|
+
# 8
|
|
28
|
+
run1chk test/test-metavalidator.rb $1
|
|
29
|
+
# 8
|
|
30
|
+
run1chk test/test-rule.rb $1
|
|
31
|
+
# 8
|
|
32
|
+
run1chk test/test-validator.rb $1
|
|
33
|
+
# 8
|
|
34
|
+
run1chk test/test-yaml-parser.rb $1
|
|
35
|
+
|
|
36
|
+
# 504
|
|
37
|
+
run1chk test/test.rb $1
|
|
38
|
+
# 852
|
|
39
|
+
run1chk test/test-users-guide.rb $1
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
set +x
|
|
2
|
+
|
|
3
|
+
${HOME}/Projects/rkwalify/devbin/smoke-tests.sh 2>&1 \
|
|
4
|
+
| sed -e "s,0x[0-9a-f]*,HEX," > /tmp/$$_RST
|
|
5
|
+
|
|
6
|
+
sed -e "s,0x[0-9a-f]*,HEX," \
|
|
7
|
+
${HOME}/Projects/rkwalify/devbin/smoke-tests.golden > /tmp/$$_GOLDEN
|
|
8
|
+
|
|
9
|
+
if [ "X$1X" == "XgoldenX" ] ; then
|
|
10
|
+
cp /tmp/$$_RST ${HOME}/Projects/rkwalify/devbin/smoke-tests.golden
|
|
11
|
+
else
|
|
12
|
+
diff /tmp/$$_GOLDEN /tmp/$$_RST
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
rm -f /tmp/$$_RST /tmp/$$_GOLDEN
|
|
16
|
+
|
|
17
|
+
#EX: 00007563d1482df8
|