psych 4.0.0 → 5.1.2

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +24 -0
  3. data/README.md +6 -5
  4. data/ext/psych/depend +13 -1
  5. data/ext/psych/extconf.rb +40 -30
  6. data/ext/psych/psych_parser.c +19 -33
  7. data/lib/psych/class_loader.rb +5 -5
  8. data/lib/psych/core_ext.rb +1 -1
  9. data/lib/psych/exception.rb +16 -2
  10. data/lib/psych/handlers/document_stream.rb +1 -1
  11. data/lib/psych/handlers/recorder.rb +1 -1
  12. data/lib/psych/json/stream.rb +2 -2
  13. data/lib/psych/json/tree_builder.rb +1 -1
  14. data/lib/psych/nodes/node.rb +4 -4
  15. data/lib/psych/nodes.rb +7 -7
  16. data/lib/psych/parser.rb +13 -0
  17. data/lib/psych/scalar_scanner.rb +22 -16
  18. data/lib/psych/syntax_error.rb +1 -1
  19. data/lib/psych/tree_builder.rb +3 -3
  20. data/lib/psych/versions.rb +2 -2
  21. data/lib/psych/visitors/json_tree.rb +1 -1
  22. data/lib/psych/visitors/to_ruby.rb +11 -9
  23. data/lib/psych/visitors/yaml_tree.rb +65 -18
  24. data/lib/psych/visitors.rb +6 -6
  25. data/lib/psych.rb +135 -48
  26. metadata +22 -25
  27. data/.gitignore +0 -16
  28. data/Gemfile +0 -9
  29. data/Mavenfile +0 -7
  30. data/Rakefile +0 -41
  31. data/bin/console +0 -7
  32. data/bin/setup +0 -6
  33. data/ext/psych/yaml/LICENSE +0 -19
  34. data/ext/psych/yaml/api.c +0 -1393
  35. data/ext/psych/yaml/config.h +0 -80
  36. data/ext/psych/yaml/dumper.c +0 -394
  37. data/ext/psych/yaml/emitter.c +0 -2358
  38. data/ext/psych/yaml/loader.c +0 -544
  39. data/ext/psych/yaml/parser.c +0 -1375
  40. data/ext/psych/yaml/reader.c +0 -469
  41. data/ext/psych/yaml/scanner.c +0 -3598
  42. data/ext/psych/yaml/writer.c +0 -141
  43. data/ext/psych/yaml/yaml.h +0 -1985
  44. data/ext/psych/yaml/yaml_private.h +0 -688
  45. data/psych.gemspec +0 -67
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require 'psych/tree_builder'
3
- require 'psych/scalar_scanner'
4
- require 'psych/class_loader'
2
+ require_relative '../tree_builder'
3
+ require_relative '../scalar_scanner'
4
+ require_relative '../class_loader'
5
5
 
6
6
  module Psych
7
7
  module Visitors
@@ -15,30 +15,29 @@ module Psych
15
15
  class YAMLTree < Psych::Visitors::Visitor
16
16
  class Registrar # :nodoc:
17
17
  def initialize
18
- @obj_to_id = {}
19
- @obj_to_node = {}
18
+ @obj_to_id = {}.compare_by_identity
19
+ @obj_to_node = {}.compare_by_identity
20
20
  @targets = []
21
21
  @counter = 0
22
22
  end
23
23
 
24
24
  def register target, node
25
- return unless target.respond_to? :object_id
26
25
  @targets << target
27
- @obj_to_node[target.object_id] = node
26
+ @obj_to_node[target] = node
28
27
  end
29
28
 
30
29
  def key? target
31
- @obj_to_node.key? target.object_id
30
+ @obj_to_node.key? target
32
31
  rescue NoMethodError
33
32
  false
34
33
  end
35
34
 
36
35
  def id_for target
37
- @obj_to_id[target.object_id] ||= (@counter += 1)
36
+ @obj_to_id[target] ||= (@counter += 1)
38
37
  end
39
38
 
40
39
  def node_for target
41
- @obj_to_node[target.object_id]
40
+ @obj_to_node[target]
42
41
  end
43
42
  end
44
43
 
@@ -192,12 +191,13 @@ module Psych
192
191
  register o, @emitter.scalar(o.inspect, nil, '!ruby/regexp', false, false, Nodes::Scalar::ANY)
193
192
  end
194
193
 
194
+ def visit_Date o
195
+ register o, visit_Integer(o.gregorian)
196
+ end
197
+
195
198
  def visit_DateTime o
196
- formatted = if o.offset.zero?
197
- o.strftime("%Y-%m-%d %H:%M:%S.%9N Z".freeze)
198
- else
199
- o.strftime("%Y-%m-%d %H:%M:%S.%9N %:z".freeze)
200
- end
199
+ t = o.italy
200
+ formatted = format_time t, t.offset.zero?
201
201
  tag = '!ruby/object:DateTime'
202
202
  register o, @emitter.scalar(formatted, nil, tag, false, false, Nodes::Scalar::ANY)
203
203
  end
@@ -235,7 +235,6 @@ module Psych
235
235
  end
236
236
  alias :visit_TrueClass :visit_Integer
237
237
  alias :visit_FalseClass :visit_Integer
238
- alias :visit_Date :visit_Integer
239
238
 
240
239
  def visit_Float o
241
240
  if o.nan?
@@ -272,6 +271,8 @@ module Psych
272
271
  tag = 'tag:yaml.org,2002:str'
273
272
  plain = false
274
273
  quote = false
274
+ elsif o == 'y' || o == 'n'
275
+ style = Nodes::Scalar::DOUBLE_QUOTED
275
276
  elsif @line_width && o.length > @line_width
276
277
  style = Nodes::Scalar::FOLDED
277
278
  elsif o =~ /^[^[:word:]][^"]*$/
@@ -480,8 +481,8 @@ module Psych
480
481
  @emitter.end_mapping
481
482
  end
482
483
 
483
- def format_time time
484
- if time.utc?
484
+ def format_time time, utc = time.utc?
485
+ if utc
485
486
  time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
486
487
  else
487
488
  time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
@@ -535,5 +536,51 @@ module Psych
535
536
  end
536
537
  end
537
538
  end
539
+
540
+ class RestrictedYAMLTree < YAMLTree
541
+ DEFAULT_PERMITTED_CLASSES = {
542
+ TrueClass => true,
543
+ FalseClass => true,
544
+ NilClass => true,
545
+ Integer => true,
546
+ Float => true,
547
+ String => true,
548
+ Array => true,
549
+ Hash => true,
550
+ }.compare_by_identity.freeze
551
+
552
+ def initialize emitter, ss, options
553
+ super
554
+ @permitted_classes = DEFAULT_PERMITTED_CLASSES.dup
555
+ Array(options[:permitted_classes]).each do |klass|
556
+ @permitted_classes[klass] = true
557
+ end
558
+ @permitted_symbols = {}.compare_by_identity
559
+ Array(options[:permitted_symbols]).each do |symbol|
560
+ @permitted_symbols[symbol] = true
561
+ end
562
+ @aliases = options.fetch(:aliases, false)
563
+ end
564
+
565
+ def accept target
566
+ if !@aliases && @st.key?(target)
567
+ raise BadAlias, "Tried to dump an aliased object"
568
+ end
569
+
570
+ unless Symbol === target || @permitted_classes[target.class]
571
+ raise DisallowedClass.new('dump', target.class.name || target.class.inspect)
572
+ end
573
+
574
+ super
575
+ end
576
+
577
+ def visit_Symbol sym
578
+ unless @permitted_classes[Symbol] || @permitted_symbols[sym]
579
+ raise DisallowedClass.new('dump', "Symbol(#{sym.inspect})")
580
+ end
581
+
582
+ super
583
+ end
584
+ end
538
585
  end
539
586
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
- require 'psych/visitors/visitor'
3
- require 'psych/visitors/to_ruby'
4
- require 'psych/visitors/emitter'
5
- require 'psych/visitors/yaml_tree'
6
- require 'psych/visitors/json_tree'
7
- require 'psych/visitors/depth_first'
2
+ require_relative 'visitors/visitor'
3
+ require_relative 'visitors/to_ruby'
4
+ require_relative 'visitors/emitter'
5
+ require_relative 'visitors/yaml_tree'
6
+ require_relative 'visitors/json_tree'
7
+ require_relative 'visitors/depth_first'
data/lib/psych.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
- require 'psych/versions'
2
+ require_relative 'psych/versions'
3
3
  case RUBY_ENGINE
4
4
  when 'jruby'
5
- require 'psych_jars'
5
+ require_relative 'psych_jars'
6
6
  if JRuby::Util.respond_to?(:load_ext)
7
7
  JRuby::Util.load_ext('org.jruby.ext.psych.PsychLibrary')
8
8
  else
@@ -12,28 +12,28 @@ when 'jruby'
12
12
  else
13
13
  require 'psych.so'
14
14
  end
15
- require 'psych/nodes'
16
- require 'psych/streaming'
17
- require 'psych/visitors'
18
- require 'psych/handler'
19
- require 'psych/tree_builder'
20
- require 'psych/parser'
21
- require 'psych/omap'
22
- require 'psych/set'
23
- require 'psych/coder'
24
- require 'psych/core_ext'
25
- require 'psych/stream'
26
- require 'psych/json/tree_builder'
27
- require 'psych/json/stream'
28
- require 'psych/handlers/document_stream'
29
- require 'psych/class_loader'
15
+ require_relative 'psych/nodes'
16
+ require_relative 'psych/streaming'
17
+ require_relative 'psych/visitors'
18
+ require_relative 'psych/handler'
19
+ require_relative 'psych/tree_builder'
20
+ require_relative 'psych/parser'
21
+ require_relative 'psych/omap'
22
+ require_relative 'psych/set'
23
+ require_relative 'psych/coder'
24
+ require_relative 'psych/core_ext'
25
+ require_relative 'psych/stream'
26
+ require_relative 'psych/json/tree_builder'
27
+ require_relative 'psych/json/stream'
28
+ require_relative 'psych/handlers/document_stream'
29
+ require_relative 'psych/class_loader'
30
30
 
31
31
  ###
32
32
  # = Overview
33
33
  #
34
34
  # Psych is a YAML parser and emitter.
35
35
  # Psych leverages libyaml [Home page: https://pyyaml.org/wiki/LibYAML]
36
- # or [HG repo: https://bitbucket.org/xi/libyaml] for its YAML parsing
36
+ # or [git repo: https://github.com/yaml/libyaml] for its YAML parsing
37
37
  # and emitting capabilities. In addition to wrapping libyaml, Psych also
38
38
  # knows how to serialize and de-serialize most Ruby objects to and from
39
39
  # the YAML format.
@@ -268,12 +268,11 @@ module Psych
268
268
  # YAML documents that are supplied via user input. Instead, please use the
269
269
  # load method or the safe_load method.
270
270
  #
271
- def self.unsafe_load yaml, filename: nil, fallback: false, symbolize_names: false, freeze: false
271
+ def self.unsafe_load yaml, filename: nil, fallback: false, symbolize_names: false, freeze: false, strict_integer: false
272
272
  result = parse(yaml, filename: filename)
273
273
  return fallback unless result
274
- result.to_ruby(symbolize_names: symbolize_names, freeze: freeze)
274
+ result.to_ruby(symbolize_names: symbolize_names, freeze: freeze, strict_integer: strict_integer)
275
275
  end
276
- class << self; alias :load :unsafe_load; end
277
276
 
278
277
  ###
279
278
  # Safely load the yaml string in +yaml+. By default, only the following
@@ -282,7 +281,8 @@ module Psych
282
281
  # * TrueClass
283
282
  # * FalseClass
284
283
  # * NilClass
285
- # * Numeric
284
+ # * Integer
285
+ # * Float
286
286
  # * String
287
287
  # * Array
288
288
  # * Hash
@@ -307,7 +307,7 @@ module Psych
307
307
  # A Psych::DisallowedClass exception will be raised if the yaml contains a
308
308
  # class that isn't in the +permitted_classes+ list.
309
309
  #
310
- # A Psych::BadAlias exception will be raised if the yaml contains aliases
310
+ # A Psych::AliasesNotEnabled exception will be raised if the yaml contains aliases
311
311
  # but the +aliases+ keyword argument is set to false.
312
312
  #
313
313
  # +filename+ will be used in the exception message if any exception is raised
@@ -319,13 +319,13 @@ module Psych
319
319
  # Psych.safe_load("---\n foo: bar") # => {"foo"=>"bar"}
320
320
  # Psych.safe_load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
321
321
  #
322
- def self.safe_load yaml, permitted_classes: [], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false, freeze: false
322
+ def self.safe_load yaml, permitted_classes: [], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false, freeze: false, strict_integer: false
323
323
  result = parse(yaml, filename: filename)
324
324
  return fallback unless result
325
325
 
326
326
  class_loader = ClassLoader::Restricted.new(permitted_classes.map(&:to_s),
327
327
  permitted_symbols.map(&:to_s))
328
- scanner = ScalarScanner.new class_loader
328
+ scanner = ScalarScanner.new class_loader, strict_integer: strict_integer
329
329
  visitor = if aliases
330
330
  Visitors::ToRuby.new scanner, class_loader, symbolize_names: symbolize_names, freeze: freeze
331
331
  else
@@ -365,14 +365,15 @@ module Psych
365
365
  # Raises a TypeError when `yaml` parameter is NilClass. This method is
366
366
  # similar to `safe_load` except that `Symbol` objects are allowed by default.
367
367
  #
368
- def self.load yaml, permitted_classes: [Symbol], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false, freeze: false
368
+ def self.load yaml, permitted_classes: [Symbol], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false, freeze: false, strict_integer: false
369
369
  safe_load yaml, permitted_classes: permitted_classes,
370
370
  permitted_symbols: permitted_symbols,
371
371
  aliases: aliases,
372
372
  filename: filename,
373
373
  fallback: fallback,
374
374
  symbolize_names: symbolize_names,
375
- freeze: freeze
375
+ freeze: freeze,
376
+ strict_integer: strict_integer
376
377
  end
377
378
 
378
379
  ###
@@ -512,6 +513,79 @@ module Psych
512
513
  visitor.tree.yaml io, options
513
514
  end
514
515
 
516
+ ###
517
+ # call-seq:
518
+ # Psych.safe_dump(o) -> string of yaml
519
+ # Psych.safe_dump(o, options) -> string of yaml
520
+ # Psych.safe_dump(o, io) -> io object passed in
521
+ # Psych.safe_dump(o, io, options) -> io object passed in
522
+ #
523
+ # Safely dump Ruby object +o+ to a YAML string. Optional +options+ may be passed in
524
+ # to control the output format. If an IO object is passed in, the YAML will
525
+ # be dumped to that IO object. By default, only the following
526
+ # classes are allowed to be serialized:
527
+ #
528
+ # * TrueClass
529
+ # * FalseClass
530
+ # * NilClass
531
+ # * Integer
532
+ # * Float
533
+ # * String
534
+ # * Array
535
+ # * Hash
536
+ #
537
+ # Arbitrary classes can be allowed by adding those classes to the +permitted_classes+
538
+ # keyword argument. They are additive. For example, to allow Date serialization:
539
+ #
540
+ # Psych.safe_dump(yaml, permitted_classes: [Date])
541
+ #
542
+ # Now the Date class can be dumped in addition to the classes listed above.
543
+ #
544
+ # A Psych::DisallowedClass exception will be raised if the object contains a
545
+ # class that isn't in the +permitted_classes+ list.
546
+ #
547
+ # Currently supported options are:
548
+ #
549
+ # [<tt>:indentation</tt>] Number of space characters used to indent.
550
+ # Acceptable value should be in <tt>0..9</tt> range,
551
+ # otherwise option is ignored.
552
+ #
553
+ # Default: <tt>2</tt>.
554
+ # [<tt>:line_width</tt>] Max character to wrap line at.
555
+ #
556
+ # Default: <tt>0</tt> (meaning "wrap at 81").
557
+ # [<tt>:canonical</tt>] Write "canonical" YAML form (very verbose, yet
558
+ # strictly formal).
559
+ #
560
+ # Default: <tt>false</tt>.
561
+ # [<tt>:header</tt>] Write <tt>%YAML [version]</tt> at the beginning of document.
562
+ #
563
+ # Default: <tt>false</tt>.
564
+ #
565
+ # Example:
566
+ #
567
+ # # Dump an array, get back a YAML string
568
+ # Psych.safe_dump(['a', 'b']) # => "---\n- a\n- b\n"
569
+ #
570
+ # # Dump an array to an IO object
571
+ # Psych.safe_dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
572
+ #
573
+ # # Dump an array with indentation set
574
+ # Psych.safe_dump(['a', ['b']], indentation: 3) # => "---\n- a\n- - b\n"
575
+ #
576
+ # # Dump an array to an IO with indentation set
577
+ # Psych.safe_dump(['a', ['b']], StringIO.new, indentation: 3)
578
+ def self.safe_dump o, io = nil, options = {}
579
+ if Hash === io
580
+ options = io
581
+ io = nil
582
+ end
583
+
584
+ visitor = Psych::Visitors::RestrictedYAMLTree.create options
585
+ visitor << o
586
+ visitor.tree.yaml io, options
587
+ end
588
+
515
589
  ###
516
590
  # Dump a list of objects as separate documents to a document stream.
517
591
  #
@@ -575,7 +649,6 @@ module Psych
575
649
  self.unsafe_load f, filename: filename, **kwargs
576
650
  }
577
651
  end
578
- class << self; alias :load_file :unsafe_load_file; end
579
652
 
580
653
  ###
581
654
  # Safely loads the document contained in +filename+. Returns the yaml contained in
@@ -587,7 +660,17 @@ module Psych
587
660
  self.safe_load f, filename: filename, **kwargs
588
661
  }
589
662
  end
590
- class << self; alias load_file safe_load_file end
663
+
664
+ ###
665
+ # Loads the document contained in +filename+. Returns the yaml contained in
666
+ # +filename+ as a Ruby object, or if the file is empty, it returns
667
+ # the specified +fallback+ return value, which defaults to +false+.
668
+ # See load for options.
669
+ def self.load_file filename, **kwargs
670
+ File.open(filename, 'r:bom|utf-8') { |f|
671
+ self.load f, filename: filename, **kwargs
672
+ }
673
+ end
591
674
 
592
675
  # :stopdoc:
593
676
  def self.add_domain_type domain, type_tag, &block
@@ -611,26 +694,8 @@ module Psych
611
694
  dump_tags[klass] = tag
612
695
  end
613
696
 
614
- # Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
615
- def self.warn_with_uplevel(message, uplevel: 1)
616
- at = parse_caller(caller[uplevel]).join(':')
617
- warn "#{at}: #{message}"
618
- end
619
-
620
- def self.parse_caller(at)
621
- if /^(.+?):(\d+)(?::in `.*')?/ =~ at
622
- file = $1
623
- line = $2.to_i
624
- [file, line]
625
- end
626
- end
627
- private_class_method :warn_with_uplevel, :parse_caller
628
-
629
697
  class << self
630
698
  if defined?(Ractor)
631
- require 'forwardable'
632
- extend Forwardable
633
-
634
699
  class Config
635
700
  attr_accessor :load_tags, :dump_tags, :domain_types
636
701
  def initialize
@@ -644,7 +709,29 @@ module Psych
644
709
  Ractor.current[:PsychConfig] ||= Config.new
645
710
  end
646
711
 
647
- def_delegators :config, :load_tags, :dump_tags, :domain_types, :load_tags=, :dump_tags=, :domain_types=
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
648
735
  else
649
736
  attr_accessor :load_tags
650
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: 4.0.0
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -10,8 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-05-13 00:00:00.000000000 Z
14
- dependencies: []
13
+ date: 2023-12-19 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: stringio
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
15
29
  description: |
16
30
  Psych is a YAML parser and emitter. Psych leverages libyaml[https://pyyaml.org/wiki/LibYAML]
17
31
  for its YAML parsing and emitting capabilities. In addition to wrapping libyaml,
@@ -26,14 +40,9 @@ extensions:
26
40
  extra_rdoc_files:
27
41
  - README.md
28
42
  files:
29
- - ".gitignore"
30
- - Gemfile
43
+ - CONTRIBUTING.md
31
44
  - LICENSE
32
- - Mavenfile
33
45
  - README.md
34
- - Rakefile
35
- - bin/console
36
- - bin/setup
37
46
  - ext/psych/depend
38
47
  - ext/psych/extconf.rb
39
48
  - ext/psych/psych.c
@@ -46,18 +55,6 @@ files:
46
55
  - ext/psych/psych_to_ruby.h
47
56
  - ext/psych/psych_yaml_tree.c
48
57
  - ext/psych/psych_yaml_tree.h
49
- - ext/psych/yaml/LICENSE
50
- - ext/psych/yaml/api.c
51
- - ext/psych/yaml/config.h
52
- - ext/psych/yaml/dumper.c
53
- - ext/psych/yaml/emitter.c
54
- - ext/psych/yaml/loader.c
55
- - ext/psych/yaml/parser.c
56
- - ext/psych/yaml/reader.c
57
- - ext/psych/yaml/scanner.c
58
- - ext/psych/yaml/writer.c
59
- - ext/psych/yaml/yaml.h
60
- - ext/psych/yaml/yaml_private.h
61
58
  - lib/psych.rb
62
59
  - lib/psych/class_loader.rb
63
60
  - lib/psych/coder.rb
@@ -95,11 +92,11 @@ files:
95
92
  - lib/psych/visitors/visitor.rb
96
93
  - lib/psych/visitors/yaml_tree.rb
97
94
  - lib/psych/y.rb
98
- - psych.gemspec
99
95
  homepage: https://github.com/ruby/psych
100
96
  licenses:
101
97
  - MIT
102
- metadata: {}
98
+ metadata:
99
+ msys2_mingw_dependencies: libyaml
103
100
  post_install_message:
104
101
  rdoc_options:
105
102
  - "--main"
@@ -110,14 +107,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
107
  requirements:
111
108
  - - ">="
112
109
  - !ruby/object:Gem::Version
113
- version: 2.4.0
110
+ version: 2.5.0
114
111
  required_rubygems_version: !ruby/object:Gem::Requirement
115
112
  requirements:
116
113
  - - ">="
117
114
  - !ruby/object:Gem::Version
118
115
  version: '0'
119
116
  requirements: []
120
- rubygems_version: 3.3.0.dev
117
+ rubygems_version: 3.5.1
121
118
  signing_key:
122
119
  specification_version: 4
123
120
  summary: Psych is a YAML parser and emitter
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- *.swp
2
- *.bundle
3
- *.so
4
- *.jar
5
- *.class
6
- .mvn
7
- /.bundle/
8
- /.yardoc
9
- /Gemfile.lock
10
- /_yardoc/
11
- /coverage/
12
- /doc/
13
- /pkg/
14
- /spec/reports/
15
- /tmp/
16
- /vendor
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :development do
6
- gem 'rake-compiler', ">= 0.4.1"
7
- gem 'test-unit'
8
- gem 'ruby-maven', :platforms => :jruby
9
- end
data/Mavenfile DELETED
@@ -1,7 +0,0 @@
1
- #-*- mode: ruby -*-
2
-
3
- jar 'org.yaml:snakeyaml:${snakeyaml.version}'
4
-
5
- plugin :dependency, '2.8', :outputFile => 'pkg/classpath'
6
-
7
- # vim: syntax=Ruby
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.7'
25
- ext.target_version = '1.7'
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/test/unit/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
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "psych"
5
-
6
- require "irb"
7
- IRB.start
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
@@ -1,19 +0,0 @@
1
- Copyright (c) 2006 Kirill Simonov
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
6
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
- of the Software, and to permit persons to whom the Software is furnished to do
8
- so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.