psych 5.1.0.pre1-java → 5.1.1-java
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/CONTRIBUTING.md +24 -0
- data/ext/java/org/jruby/ext/psych/PsychParser.java +104 -46
- data/lib/psych/versions.rb +2 -2
- data/lib/psych.jar +0 -0
- data/lib/psych.rb +23 -19
- metadata +6 -12
- data/.gitignore +0 -16
- data/Gemfile +0 -9
- data/Mavenfile +0 -7
- data/Rakefile +0 -41
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/psych.gemspec +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3ecd8fde6ca54e687dc27ddad89dee04ffaf1e751432b15197e9bc36bd3880d
|
4
|
+
data.tar.gz: 18d653fe1080e1aa8b3d882e5a2927526c112eece374d2d231e1295b672e3b3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28aa613c31c1f3dcefd42687af26e49981a08162545b673c7f5ba6cbc6aa59cf0b7851100fd37ff6492cb99ed54e20c9040321c8a2c8cff6be8aa335bc5c4f16
|
7
|
+
data.tar.gz: 9ea353b134a59478df9cf327840601d4fbff544fe1cf4f2bde68cf12d8ee82ef9291e179e170b9e48c4f5369e50c7519e4611fe5446ab57996a2c39578dc2166
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
## How to contribute to Psych
|
2
|
+
|
3
|
+
Full details [here](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute)
|
4
|
+
|
5
|
+
#### **Did you find a bug?**
|
6
|
+
|
7
|
+
* **Do not open an issue if the bug is a security vulnerability
|
8
|
+
in Psych**, instead refer to our [security policy](https://www.ruby-lang.org/en/security/) and email [here](security@ruby-lang.org).
|
9
|
+
|
10
|
+
* **Ensure the bug was not already reported** by searching on ruby-core, the ruby github repo and on Psych's github repo. More info [here](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport)
|
11
|
+
|
12
|
+
* If you're unable to find an open issue addressing the problem, [open a new one](https://bugs.ruby-lang.org/). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
|
13
|
+
|
14
|
+
#### **Did you write a patch that fixes a bug?**
|
15
|
+
|
16
|
+
* Open a new GitHub pull request with the patch for small fixes. Anything larger look [here](https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute); submit a Feature.
|
17
|
+
|
18
|
+
* Ensure you clearly describe the problem and solution. Include the relevant ticket/issue number if applicable.
|
19
|
+
|
20
|
+
Psych is a volunteer effort. We encourage you to pitch in and [join the team](https://github.com/ruby/psych/contributors)!
|
21
|
+
|
22
|
+
Thanks! :heart: :heart: :heart:
|
23
|
+
|
24
|
+
The Psych Team
|
@@ -34,17 +34,22 @@ import org.jcodings.specific.UTF8Encoding;
|
|
34
34
|
import org.jcodings.unicode.UnicodeEncoding;
|
35
35
|
import org.jruby.Ruby;
|
36
36
|
import org.jruby.RubyArray;
|
37
|
+
import org.jruby.RubyBoolean;
|
37
38
|
import org.jruby.RubyClass;
|
38
39
|
import org.jruby.RubyEncoding;
|
40
|
+
import org.jruby.RubyException;
|
39
41
|
import org.jruby.RubyFixnum;
|
40
42
|
import org.jruby.RubyIO;
|
41
43
|
import org.jruby.RubyKernel;
|
42
44
|
import org.jruby.RubyModule;
|
45
|
+
import org.jruby.RubyNumeric;
|
43
46
|
import org.jruby.RubyObject;
|
44
47
|
import org.jruby.RubyString;
|
45
48
|
import org.jruby.anno.JRubyMethod;
|
49
|
+
import org.jruby.javasupport.JavaUtil;
|
46
50
|
import org.jruby.runtime.Block;
|
47
51
|
import org.jruby.runtime.Helpers;
|
52
|
+
import org.jruby.runtime.JavaSites;
|
48
53
|
import org.jruby.runtime.ThreadContext;
|
49
54
|
import org.jruby.runtime.builtin.IRubyObject;
|
50
55
|
import org.jruby.runtime.callsite.CachingCallSite;
|
@@ -95,42 +100,40 @@ import static org.jruby.runtime.Helpers.invoke;
|
|
95
100
|
public class PsychParser extends RubyObject {
|
96
101
|
|
97
102
|
public static final String JRUBY_CALL_SITES = "_jruby_call_sites";
|
103
|
+
public static final String ENCODING_ANY = "ANY";
|
104
|
+
public static final String ENCODING_UTF8 = "UTF8";
|
105
|
+
public static final String ENCODING_UTF16LE = "UTF16LE";
|
106
|
+
public static final String ENCODING_UTF16BE = "UTF16BE";
|
107
|
+
public static final String CODE_POINT_LIMIT = "code_point_limit";
|
98
108
|
|
99
109
|
public static void initPsychParser(Ruby runtime, RubyModule psych) {
|
100
110
|
RubyClass psychParser = runtime.defineClassUnder("Parser", runtime.getObject(), PsychParser::new, psych);
|
101
111
|
|
102
|
-
|
103
|
-
Arrays.stream(Call.values())
|
104
|
-
.map((call) -> new FunctionalCachingCallSite(call.name()))
|
105
|
-
.toArray(CachingCallSite[]::new);
|
106
|
-
psychParser.setInternalVariable(JRUBY_CALL_SITES, sites);
|
112
|
+
psychParser.setInternalVariable(JRUBY_CALL_SITES, new CallSites());
|
107
113
|
|
108
114
|
runtime.getLoadService().require("psych/syntax_error");
|
109
|
-
psychParser.defineConstant(
|
110
|
-
psychParser.defineConstant(
|
111
|
-
psychParser.defineConstant(
|
112
|
-
psychParser.defineConstant(
|
115
|
+
psychParser.defineConstant(ENCODING_ANY, runtime.newFixnum(YAML_ANY_ENCODING.ordinal()));
|
116
|
+
psychParser.defineConstant(ENCODING_UTF8, runtime.newFixnum(YAML_UTF8_ENCODING.ordinal()));
|
117
|
+
psychParser.defineConstant(ENCODING_UTF16LE, runtime.newFixnum(YAML_UTF16LE_ENCODING.ordinal()));
|
118
|
+
psychParser.defineConstant(ENCODING_UTF16BE, runtime.newFixnum(YAML_UTF16BE_ENCODING.ordinal()));
|
113
119
|
|
114
120
|
psychParser.defineAnnotatedMethods(PsychParser.class);
|
121
|
+
|
122
|
+
// defaults for SnakeYAML load settings
|
123
|
+
LoadSettings defaults = LoadSettings.builder().build();
|
124
|
+
psychParser.setInternalVariable(CODE_POINT_LIMIT, runtime.newFixnum(defaults.getCodePointLimit()));
|
115
125
|
}
|
116
126
|
|
117
127
|
public PsychParser(Ruby runtime, RubyClass klass) {
|
118
128
|
super(runtime, klass);
|
119
129
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
this.
|
127
|
-
this.scalar = sites[Call.scalar.ordinal()];
|
128
|
-
this.start_sequence = sites[Call.start_sequence.ordinal()];
|
129
|
-
this.end_sequence = sites[Call.end_sequence.ordinal()];
|
130
|
-
this.start_mapping = sites[Call.start_mapping.ordinal()];
|
131
|
-
this.end_mapping = sites[Call.end_mapping.ordinal()];
|
132
|
-
this.end_stream = sites[Call.end_stream.ordinal()];
|
133
|
-
this.loadSettingsBuilder = LoadSettings.builder().setSchema(new CoreSchema());
|
130
|
+
this.sites = (CallSites) klass.getInternalVariable(JRUBY_CALL_SITES);
|
131
|
+
|
132
|
+
// prepare settings builder and apply global defaults
|
133
|
+
LoadSettingsBuilder lsb = LoadSettings.builder();
|
134
|
+
lsb.setSchema(new CoreSchema());
|
135
|
+
lsb.setCodePointLimit(((IRubyObject) klass.getInternalVariable(CODE_POINT_LIMIT)).convertToInteger().getIntValue());
|
136
|
+
this.loadSettingsBuilder = lsb;
|
134
137
|
}
|
135
138
|
|
136
139
|
private IRubyObject stringOrNilForAnchor(ThreadContext context, Optional<Anchor> value) {
|
@@ -237,8 +240,9 @@ public class PsychParser extends RubyObject {
|
|
237
240
|
LoadSettings loadSettings = loadSettingsBuilder.build();
|
238
241
|
parser = new ParserImpl(loadSettings, new ScannerImpl(loadSettings, readerFor(context, yaml, loadSettings)));
|
239
242
|
|
240
|
-
|
241
|
-
|
243
|
+
JavaSites.CheckedSites pathSites = sites.path;
|
244
|
+
if (path.isNil() && pathSites.respond_to_X.respondsTo(context, yaml, yaml)) {
|
245
|
+
path = pathSites.site.call(context, this, yaml);
|
242
246
|
}
|
243
247
|
|
244
248
|
while (parser.hasNext()) {
|
@@ -252,11 +256,11 @@ public class PsychParser extends RubyObject {
|
|
252
256
|
IRubyObject end_line = runtime.newFixnum(end.getLine());
|
253
257
|
IRubyObject end_column = runtime.newFixnum(end.getColumn());
|
254
258
|
|
255
|
-
event_location.call(context, this, handler, start_line, start_column, end_line, end_column);
|
259
|
+
sites.event_location.call(context, this, handler, start_line, start_column, end_line, end_column);
|
256
260
|
|
257
261
|
switch (event.getEventId()) {
|
258
262
|
case StreamStart:
|
259
|
-
start_stream.call(context, this, handler, runtime.newFixnum(YAML_ANY_ENCODING.ordinal()));
|
263
|
+
sites.start_stream.call(context, this, handler, runtime.newFixnum(YAML_ANY_ENCODING.ordinal()));
|
260
264
|
break;
|
261
265
|
case DocumentStart:
|
262
266
|
handleDocumentStart(context, (DocumentStartEvent) event, handler);
|
@@ -264,12 +268,12 @@ public class PsychParser extends RubyObject {
|
|
264
268
|
case DocumentEnd:
|
265
269
|
IRubyObject notExplicit = runtime.newBoolean(!((DocumentEndEvent) event).isExplicit());
|
266
270
|
|
267
|
-
end_document.call(context, this, handler, notExplicit);
|
271
|
+
sites.end_document.call(context, this, handler, notExplicit);
|
268
272
|
break;
|
269
273
|
case Alias:
|
270
274
|
IRubyObject alias = stringOrNilForAnchor(context, ((AliasEvent) event).getAnchor());
|
271
275
|
|
272
|
-
|
276
|
+
sites.alias.call(context, this, handler, alias);
|
273
277
|
break;
|
274
278
|
case Scalar:
|
275
279
|
handleScalar(context, (ScalarEvent) event, handler);
|
@@ -278,16 +282,16 @@ public class PsychParser extends RubyObject {
|
|
278
282
|
handleSequenceStart(context, (SequenceStartEvent) event, handler);
|
279
283
|
break;
|
280
284
|
case SequenceEnd:
|
281
|
-
end_sequence.call(context, this, handler);
|
285
|
+
sites.end_sequence.call(context, this, handler);
|
282
286
|
break;
|
283
287
|
case MappingStart:
|
284
288
|
handleMappingStart(context, (MappingStartEvent) event, handler);
|
285
289
|
break;
|
286
290
|
case MappingEnd:
|
287
|
-
end_mapping.call(context, this, handler);
|
291
|
+
sites.end_mapping.call(context, this, handler);
|
288
292
|
break;
|
289
293
|
case StreamEnd:
|
290
|
-
end_stream.call(context, this, handler);
|
294
|
+
sites.end_stream.call(context, this, handler);
|
291
295
|
break;
|
292
296
|
}
|
293
297
|
}
|
@@ -350,17 +354,18 @@ public class PsychParser extends RubyObject {
|
|
350
354
|
|
351
355
|
IRubyObject notExplicit = runtime.newBoolean(!dse.isExplicit());
|
352
356
|
|
353
|
-
start_document.call(context, this, handler, version, tags, notExplicit);
|
357
|
+
sites.start_document.call(context, this, handler, version, tags, notExplicit);
|
354
358
|
}
|
355
359
|
|
356
360
|
private void handleMappingStart(ThreadContext context, MappingStartEvent mse, IRubyObject handler) {
|
357
361
|
Ruby runtime = context.runtime;
|
362
|
+
|
358
363
|
IRubyObject anchor = stringOrNilForAnchor(context, mse.getAnchor());
|
359
364
|
IRubyObject tag = stringOrNilFor(context, mse.getTag());
|
360
365
|
IRubyObject implicit = runtime.newBoolean(mse.isImplicit());
|
361
366
|
IRubyObject style = runtime.newFixnum(translateFlowStyle(mse.getFlowStyle()));
|
362
367
|
|
363
|
-
start_mapping.call(context, this, handler, anchor, tag, implicit, style);
|
368
|
+
sites.start_mapping.call(context, this, handler, anchor, tag, implicit, style);
|
364
369
|
}
|
365
370
|
|
366
371
|
private void handleScalar(ThreadContext context, ScalarEvent se, IRubyObject handler) {
|
@@ -374,28 +379,30 @@ public class PsychParser extends RubyObject {
|
|
374
379
|
IRubyObject style = runtime.newFixnum(translateStyle(se.getScalarStyle()));
|
375
380
|
IRubyObject val = stringFor(context, se.getValue());
|
376
381
|
|
377
|
-
scalar.call(context, this, handler, val, anchor, tag, plain_implicit,
|
382
|
+
sites.scalar.call(context, this, handler, val, anchor, tag, plain_implicit,
|
378
383
|
quoted_implicit, style);
|
379
384
|
}
|
380
385
|
|
381
386
|
private void handleSequenceStart(ThreadContext context, SequenceStartEvent sse, IRubyObject handler) {
|
382
387
|
Ruby runtime = context.runtime;
|
388
|
+
|
383
389
|
IRubyObject anchor = stringOrNilForAnchor(context, sse.getAnchor());
|
384
390
|
IRubyObject tag = stringOrNilFor(context, sse.getTag());
|
385
391
|
IRubyObject implicit = runtime.newBoolean(sse.isImplicit());
|
386
392
|
IRubyObject style = runtime.newFixnum(translateFlowStyle(sse.getFlowStyle()));
|
387
393
|
|
388
|
-
start_sequence.call(context, this, handler, anchor, tag, implicit, style);
|
394
|
+
sites.start_sequence.call(context, this, handler, anchor, tag, implicit, style);
|
389
395
|
}
|
390
396
|
|
391
397
|
private static void raiseParserException(ThreadContext context, ReaderException re, IRubyObject rbPath) {
|
392
398
|
Ruby runtime = context.runtime;
|
399
|
+
|
393
400
|
RubyClass se;
|
394
|
-
|
401
|
+
RubyException exception;
|
395
402
|
|
396
403
|
se = (RubyClass) runtime.getModule("Psych").getConstant("SyntaxError");
|
397
404
|
|
398
|
-
exception = se.newInstance(context,
|
405
|
+
exception = (RubyException) se.newInstance(context,
|
399
406
|
new IRubyObject[] {
|
400
407
|
rbPath,
|
401
408
|
RubyFixnum.zero(runtime),
|
@@ -406,20 +413,23 @@ public class PsychParser extends RubyObject {
|
|
406
413
|
},
|
407
414
|
Block.NULL_BLOCK);
|
408
415
|
|
416
|
+
exception.setCause(JavaUtil.convertJavaToUsableRubyObject(runtime, re));
|
417
|
+
|
409
418
|
RubyKernel.raise(context, runtime.getKernel(), new IRubyObject[] { exception }, Block.NULL_BLOCK);
|
410
419
|
}
|
411
420
|
|
412
421
|
private static void raiseParserException(ThreadContext context, MarkedYamlEngineException mye, IRubyObject rbPath) {
|
413
422
|
Ruby runtime = context.runtime;
|
423
|
+
|
414
424
|
Mark mark;
|
415
425
|
RubyClass se;
|
416
|
-
|
426
|
+
RubyException exception;
|
417
427
|
|
418
428
|
se = (RubyClass)runtime.getModule("Psych").getConstant("SyntaxError");
|
419
429
|
|
420
430
|
mark = mye.getProblemMark().get();
|
421
431
|
|
422
|
-
exception = se.newInstance(context,
|
432
|
+
exception = (RubyException) se.newInstance(context,
|
423
433
|
new IRubyObject[] {
|
424
434
|
rbPath,
|
425
435
|
runtime.newFixnum(mark.getLine() + 1),
|
@@ -430,19 +440,22 @@ public class PsychParser extends RubyObject {
|
|
430
440
|
},
|
431
441
|
Block.NULL_BLOCK);
|
432
442
|
|
443
|
+
exception.setCause(JavaUtil.convertJavaToUsableRubyObject(runtime, mye));
|
444
|
+
|
433
445
|
RubyKernel.raise(context, runtime.getKernel(), new IRubyObject[] { exception }, Block.NULL_BLOCK);
|
434
446
|
}
|
435
447
|
|
436
448
|
private static void raiseParserException(ThreadContext context, MalformedInputException mie, IRubyObject rbPath) {
|
437
449
|
Ruby runtime = context.runtime;
|
450
|
+
|
438
451
|
RubyClass se;
|
439
|
-
|
452
|
+
RubyException exception;
|
440
453
|
|
441
454
|
se = (RubyClass)runtime.getModule("Psych").getConstant("SyntaxError");
|
442
455
|
|
443
456
|
mie.getInputLength();
|
444
457
|
|
445
|
-
exception = se.newInstance(context,
|
458
|
+
exception = (RubyException) se.newInstance(context,
|
446
459
|
arrayOf(
|
447
460
|
rbPath,
|
448
461
|
RubyFixnum.minus_one(runtime),
|
@@ -453,6 +466,8 @@ public class PsychParser extends RubyObject {
|
|
453
466
|
),
|
454
467
|
Block.NULL_BLOCK);
|
455
468
|
|
469
|
+
exception.setCause(JavaUtil.convertJavaToUsableRubyObject(runtime, mie));
|
470
|
+
|
456
471
|
RubyKernel.raise(context, runtime.getKernel(), new IRubyObject[] { exception }, Block.NULL_BLOCK);
|
457
472
|
}
|
458
473
|
|
@@ -514,6 +529,38 @@ public class PsychParser extends RubyObject {
|
|
514
529
|
);
|
515
530
|
}
|
516
531
|
|
532
|
+
@JRubyMethod(name = "code_point_limit=")
|
533
|
+
public IRubyObject code_point_limit_set(IRubyObject limit) {
|
534
|
+
loadSettingsBuilder.setCodePointLimit(limit.convertToInteger().getIntValue());
|
535
|
+
|
536
|
+
return limit;
|
537
|
+
}
|
538
|
+
|
539
|
+
@JRubyMethod(name = CODE_POINT_LIMIT)
|
540
|
+
public IRubyObject code_point_limit(ThreadContext context) {
|
541
|
+
return context.runtime.newFixnum(buildSettings().getCodePointLimit());
|
542
|
+
}
|
543
|
+
|
544
|
+
// class-level accessors for default values
|
545
|
+
|
546
|
+
@JRubyMethod(name = "code_point_limit=", meta = true)
|
547
|
+
public static IRubyObject code_point_limit_set(ThreadContext context, IRubyObject self, IRubyObject limit) {
|
548
|
+
int codePointLimit = RubyNumeric.num2int(limit);
|
549
|
+
|
550
|
+
if (codePointLimit <= 0) {
|
551
|
+
throw context.runtime.newRangeError("code_point_limit must be positive");
|
552
|
+
}
|
553
|
+
|
554
|
+
self.getInternalVariables().setInternalVariable(CODE_POINT_LIMIT, limit);
|
555
|
+
|
556
|
+
return limit;
|
557
|
+
}
|
558
|
+
|
559
|
+
@JRubyMethod(name = CODE_POINT_LIMIT, meta = true)
|
560
|
+
public static IRubyObject code_point_limit(ThreadContext context, IRubyObject self) {
|
561
|
+
return (IRubyObject) self.getInternalVariables().getInternalVariable(CODE_POINT_LIMIT);
|
562
|
+
}
|
563
|
+
|
517
564
|
private LoadSettings buildSettings() {
|
518
565
|
return loadSettingsBuilder.build();
|
519
566
|
}
|
@@ -521,10 +568,21 @@ public class PsychParser extends RubyObject {
|
|
521
568
|
private Parser parser;
|
522
569
|
private Event event;
|
523
570
|
private final LoadSettingsBuilder loadSettingsBuilder;
|
524
|
-
|
525
|
-
|
526
|
-
|
571
|
+
private final CallSites sites;
|
572
|
+
|
573
|
+
private static class CallSites {
|
574
|
+
private final JavaSites.CheckedSites path = new JavaSites.CheckedSites("path");
|
575
|
+
private final CachingCallSite event_location = new FunctionalCachingCallSite("event_location");
|
576
|
+
private final CachingCallSite start_stream = new FunctionalCachingCallSite("start_stream");
|
577
|
+
private final CachingCallSite start_document = new FunctionalCachingCallSite("start_document");
|
578
|
+
private final CachingCallSite end_document = new FunctionalCachingCallSite("end_document");
|
579
|
+
private final CachingCallSite alias = new FunctionalCachingCallSite("alias");
|
580
|
+
private final CachingCallSite scalar = new FunctionalCachingCallSite("scalar");
|
581
|
+
private final CachingCallSite start_sequence = new FunctionalCachingCallSite("start_sequence");
|
582
|
+
private final CachingCallSite end_sequence = new FunctionalCachingCallSite("end_sequence");
|
583
|
+
private final CachingCallSite start_mapping = new FunctionalCachingCallSite("start_mapping");
|
584
|
+
private final CachingCallSite end_mapping = new FunctionalCachingCallSite("end_mapping");
|
585
|
+
private final CachingCallSite end_stream = new FunctionalCachingCallSite("end_stream");
|
527
586
|
}
|
528
587
|
|
529
|
-
private final CachingCallSite path, event_location, start_stream, start_document, end_document, alias, scalar, start_sequence, end_sequence, start_mapping, end_mapping, end_stream;
|
530
588
|
}
|
data/lib/psych/versions.rb
CHANGED
data/lib/psych.jar
CHANGED
Binary file
|
data/lib/psych.rb
CHANGED
@@ -694,26 +694,8 @@ module Psych
|
|
694
694
|
dump_tags[klass] = tag
|
695
695
|
end
|
696
696
|
|
697
|
-
# Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
|
698
|
-
def self.warn_with_uplevel(message, uplevel: 1)
|
699
|
-
at = parse_caller(caller[uplevel]).join(':')
|
700
|
-
warn "#{at}: #{message}"
|
701
|
-
end
|
702
|
-
|
703
|
-
def self.parse_caller(at)
|
704
|
-
if /^(.+?):(\d+)(?::in `.*')?/ =~ at
|
705
|
-
file = $1
|
706
|
-
line = $2.to_i
|
707
|
-
[file, line]
|
708
|
-
end
|
709
|
-
end
|
710
|
-
private_class_method :warn_with_uplevel, :parse_caller
|
711
|
-
|
712
697
|
class << self
|
713
698
|
if defined?(Ractor)
|
714
|
-
require 'forwardable'
|
715
|
-
extend Forwardable
|
716
|
-
|
717
699
|
class Config
|
718
700
|
attr_accessor :load_tags, :dump_tags, :domain_types
|
719
701
|
def initialize
|
@@ -727,7 +709,29 @@ module Psych
|
|
727
709
|
Ractor.current[:PsychConfig] ||= Config.new
|
728
710
|
end
|
729
711
|
|
730
|
-
|
712
|
+
def load_tags
|
713
|
+
config.load_tags
|
714
|
+
end
|
715
|
+
|
716
|
+
def dump_tags
|
717
|
+
config.dump_tags
|
718
|
+
end
|
719
|
+
|
720
|
+
def domain_types
|
721
|
+
config.domain_types
|
722
|
+
end
|
723
|
+
|
724
|
+
def load_tags=(value)
|
725
|
+
config.load_tags = value
|
726
|
+
end
|
727
|
+
|
728
|
+
def dump_tags=(value)
|
729
|
+
config.dump_tags = value
|
730
|
+
end
|
731
|
+
|
732
|
+
def domain_types=(value)
|
733
|
+
config.domain_types = value
|
734
|
+
end
|
731
735
|
else
|
732
736
|
attr_accessor :load_tags
|
733
737
|
attr_accessor :dump_tags
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: psych
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-10-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,14 +39,9 @@ extensions: []
|
|
39
39
|
extra_rdoc_files:
|
40
40
|
- README.md
|
41
41
|
files:
|
42
|
-
-
|
43
|
-
- Gemfile
|
42
|
+
- CONTRIBUTING.md
|
44
43
|
- LICENSE
|
45
|
-
- Mavenfile
|
46
44
|
- README.md
|
47
|
-
- Rakefile
|
48
|
-
- bin/console
|
49
|
-
- bin/setup
|
50
45
|
- ext/java/org/jruby/ext/psych/PsychEmitter.java
|
51
46
|
- ext/java/org/jruby/ext/psych/PsychLibrary.java
|
52
47
|
- ext/java/org/jruby/ext/psych/PsychParser.java
|
@@ -102,7 +97,6 @@ files:
|
|
102
97
|
- lib/psych/visitors/yaml_tree.rb
|
103
98
|
- lib/psych/y.rb
|
104
99
|
- lib/psych_jars.rb
|
105
|
-
- psych.gemspec
|
106
100
|
homepage: https://github.com/ruby/psych
|
107
101
|
licenses:
|
108
102
|
- MIT
|
@@ -118,15 +112,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
112
|
requirements:
|
119
113
|
- - ">="
|
120
114
|
- !ruby/object:Gem::Version
|
121
|
-
version: 2.
|
115
|
+
version: 2.5.0
|
122
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
117
|
requirements:
|
124
118
|
- - ">="
|
125
119
|
- !ruby/object:Gem::Version
|
126
120
|
version: '0'
|
127
121
|
requirements:
|
128
|
-
- jar org.snakeyaml:snakeyaml-engine, 2.
|
129
|
-
rubygems_version: 3.3.
|
122
|
+
- jar org.snakeyaml:snakeyaml-engine, 2.7
|
123
|
+
rubygems_version: 3.3.26
|
130
124
|
signing_key:
|
131
125
|
specification_version: 4
|
132
126
|
summary: Psych is a YAML parser and emitter
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Mavenfile
DELETED
data/Rakefile
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require "bundler"
|
2
|
-
Bundler::GemHelper.install_tasks
|
3
|
-
|
4
|
-
require "rake/testtask"
|
5
|
-
Rake::TestTask.new(:test) do |t|
|
6
|
-
t.libs << "test/lib" << "test"
|
7
|
-
t.ruby_opts << "-rhelper"
|
8
|
-
t.test_files = FileList['test/**/test_*.rb']
|
9
|
-
t.verbose = true
|
10
|
-
t.warning = true
|
11
|
-
end
|
12
|
-
|
13
|
-
if RUBY_PLATFORM =~ /java/
|
14
|
-
require 'rake/javaextensiontask'
|
15
|
-
Rake::JavaExtensionTask.new("psych") do |ext|
|
16
|
-
require 'maven/ruby/maven'
|
17
|
-
# force load of versions to overwrite constants with values from repo.
|
18
|
-
load './lib/psych/versions.rb'
|
19
|
-
# uses Mavenfile to write classpath into pkg/classpath
|
20
|
-
# and tell maven via system properties the snakeyaml version
|
21
|
-
# this is basically the same as running from the commandline:
|
22
|
-
# rmvn dependency:build-classpath -Dsnakeyaml.version='use version from Psych::DEFAULT_SNAKEYAML_VERSION here'
|
23
|
-
Maven::Ruby::Maven.new.exec('dependency:build-classpath', "-Dsnakeyaml.version=#{Psych::DEFAULT_SNAKEYAML_VERSION}", '-Dverbose=true')
|
24
|
-
ext.source_version = '1.8'
|
25
|
-
ext.target_version = '1.8'
|
26
|
-
ext.classpath = File.read('pkg/classpath')
|
27
|
-
ext.ext_dir = 'ext/java'
|
28
|
-
end
|
29
|
-
else
|
30
|
-
require 'rake/extensiontask'
|
31
|
-
Rake::ExtensionTask.new("psych")
|
32
|
-
end
|
33
|
-
|
34
|
-
task :sync_tool do
|
35
|
-
require 'fileutils'
|
36
|
-
FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
|
37
|
-
FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
|
38
|
-
FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
|
39
|
-
end
|
40
|
-
|
41
|
-
task :default => [:compile, :test]
|
data/bin/console
DELETED
data/bin/setup
DELETED
data/psych.gemspec
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
version_module = Module.new do
|
5
|
-
version_rb = File.join(__dir__, "lib/psych/versions.rb")
|
6
|
-
module_eval(File.read(version_rb), version_rb)
|
7
|
-
end
|
8
|
-
|
9
|
-
Gem::Specification.new do |s|
|
10
|
-
s.name = "psych"
|
11
|
-
s.version = version_module::Psych::VERSION
|
12
|
-
s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
|
13
|
-
s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
|
14
|
-
s.summary = "Psych is a YAML parser and emitter"
|
15
|
-
s.description = <<-DESCRIPTION
|
16
|
-
Psych is a YAML parser and emitter. Psych leverages libyaml[https://pyyaml.org/wiki/LibYAML]
|
17
|
-
for its YAML parsing and emitting capabilities. In addition to wrapping libyaml,
|
18
|
-
Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.
|
19
|
-
DESCRIPTION
|
20
|
-
s.homepage = "https://github.com/ruby/psych"
|
21
|
-
s.licenses = ["MIT"]
|
22
|
-
s.require_paths = ["lib"]
|
23
|
-
|
24
|
-
# for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
-
s.files = [
|
26
|
-
".gitignore", "Gemfile", "LICENSE", "Mavenfile", "README.md", "Rakefile", "bin/console",
|
27
|
-
"bin/setup", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h",
|
28
|
-
"ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h",
|
29
|
-
"ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h",
|
30
|
-
"lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/exception.rb",
|
31
|
-
"lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb",
|
32
|
-
"lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb",
|
33
|
-
"lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb",
|
34
|
-
"lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb",
|
35
|
-
"lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb",
|
36
|
-
"lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb",
|
37
|
-
"lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb","lib/psych/visitors/depth_first.rb",
|
38
|
-
"lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb",
|
39
|
-
"lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "psych.gemspec"
|
40
|
-
]
|
41
|
-
|
42
|
-
s.rdoc_options = ["--main", "README.md"]
|
43
|
-
s.extra_rdoc_files = ["README.md"]
|
44
|
-
|
45
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
46
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0")
|
47
|
-
|
48
|
-
if RUBY_ENGINE == 'jruby'
|
49
|
-
s.platform = 'java'
|
50
|
-
s.files.concat [
|
51
|
-
"ext/java/org/jruby/ext/psych/PsychEmitter.java",
|
52
|
-
"ext/java/org/jruby/ext/psych/PsychLibrary.java",
|
53
|
-
"ext/java/org/jruby/ext/psych/PsychParser.java",
|
54
|
-
"ext/java/org/jruby/ext/psych/PsychToRuby.java",
|
55
|
-
"lib/psych_jars.rb",
|
56
|
-
"lib/psych.jar"
|
57
|
-
]
|
58
|
-
s.requirements = "jar org.snakeyaml:snakeyaml-engine, #{version_module::Psych::DEFAULT_SNAKEYAML_VERSION}"
|
59
|
-
s.add_dependency 'jar-dependencies', '>= 0.1.7'
|
60
|
-
else
|
61
|
-
s.extensions = ["ext/psych/extconf.rb"]
|
62
|
-
s.add_dependency 'stringio'
|
63
|
-
end
|
64
|
-
|
65
|
-
s.metadata['msys2_mingw_dependencies'] = 'libyaml'
|
66
|
-
|
67
|
-
end
|