psychgus 1.3.4 → 1.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91a1bbacfcd8d1a658b07bfad787182c7a789b0d0b2fb3ab51a30b9954572484
4
- data.tar.gz: 6afd3dba752a30d76bd694d3d5866765522605757c5826f3c366c51d7a19cc0f
3
+ metadata.gz: aa00bfe0768a30b9679056fe748769e53827b254d8899bcaacc032fc236e5791
4
+ data.tar.gz: 46a834b2f517190e9c6b28e6f87964a186c69b7b2bdaf45465d59f2ac1f06603
5
5
  SHA512:
6
- metadata.gz: d01c30c222b5da77b34a3c4fd0f97f6d1685fea13a9a4addb4fd91ff178733326aabc57ae72a1e8d4511b11a021210ba4aeb9eec7498b81f23310a7dfa307fd8
7
- data.tar.gz: 0d4deeab277e4894124f8fec33f8e1064a5f95c1bd684dd2f09d612427094c3540452608068cd6076080df8545c395d2b9ab55e04437188f164b416bba8568d4
6
+ metadata.gz: 3bcbf539c47cfb64273682b0d1fa76c3745e523e0a792f2a9dec92e1df80352c6c987762edcebd9fc21bccc36450619b42572f5e37fe66e5002ffad2e2e15eb6
7
+ data.tar.gz: 338ffe5daaafb1ddc79fac1f939058928d839f64f96bd3c8198bbda7f8426da0fea04ab6fead6b114628d64466901499c844bdc14fa55d8795f05d34b89d11ec
data/.yardopts CHANGED
@@ -2,3 +2,4 @@
2
2
  --protected
3
3
  --readme 'README.md'
4
4
  --template-path 'yard/templates'
5
+ --title 'Psychgus'
data/CHANGELOG.md CHANGED
@@ -5,8 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  Format is based on [Keep a Changelog v1.0.0](https://keepachangelog.com/en/1.0.0),
6
6
  and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [[Unreleased]](https://github.com/esotericpig/psychgus/compare/v1.3.4...HEAD)
9
- -
8
+ ## [[Unreleased]](https://github.com/esotericpig/psychgus/compare/v1.3.5...HEAD)
9
+
10
+
11
+ ## [v1.3.5] - 2024-09-06
12
+ ### Fixed
13
+ - Fixed to_yaml() to work with older-style gems.
14
+ - Example Gem: moneta
15
+ - Fixed deref aliases to work with Psych v5.1.2.
16
+
17
+ ### Changed
18
+ - Updated min Ruby to v2.2.
19
+ - Updated Gems.
10
20
 
11
21
 
12
22
  ## [v1.3.4] - 2021-06-20
data/Gemfile CHANGED
@@ -1,7 +1,22 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
-
5
4
  source 'https://rubygems.org'
6
5
 
6
+ group(:development) do
7
+ # Build.
8
+ gem 'bundler' ,'~> 2.5'
9
+ gem 'rake' ,'~> 13.2'
10
+
11
+ # Doc.
12
+ gem 'rdoc' ,'~> 6.7' # RDoc for YARD (*.rb).
13
+ gem 'redcarpet' ,'~> 3.6' # Markdown for YARD (*.md).
14
+ gem 'yard' ,'~> 0.9' # Doc.
15
+ gem 'yard_ghurt','~> 1.2' # YARD GitHub rake tasks.
16
+ end
17
+
18
+ group(:test) do
19
+ gem 'minitest' ,'~> 5.25'
20
+ end
21
+
7
22
  gemspec
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Psychgus
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/psychgus.svg)](https://badge.fury.io/rb/psychgus)
4
+ [![CI Status](https://github.com/esotericpig/psychgus/actions/workflows/ci.yml/badge.svg)](https://github.com/esotericpig/psychgus/actions/workflows/ci.yml)
4
5
  [![Doc Coverage](http://inch-ci.org/github/esotericpig/psychgus.svg?branch=master)](https://inch-ci.org/github/esotericpig/psychgus)
5
6
 
6
7
  [![Documentation](https://img.shields.io/badge/doc-yard-%23A0522D.svg)](https://esotericpig.github.io/docs/psychgus/yardoc/index.html)
@@ -39,7 +40,7 @@ Psych Gus:
39
40
  Skills: [The Blueberry, The Super Sniffer, Positive Work Attitude]
40
41
  ```
41
42
 
42
- Thank you to the people that worked and continue to work hard on the Psych project.
43
+ Thank you to the people that work hard on the Psych project.
43
44
 
44
45
  The Psychgus name comes from the well-styled character Gus from the TV show Psych.
45
46
 
@@ -58,7 +59,7 @@ The Psychgus name comes from the well-styled character Gus from the TV show Psyc
58
59
  - [Generating Doc](#generating-doc)
59
60
  - [License](#license)
60
61
 
61
- ## [Setup](#contents)
62
+ ## [//](#contents) Setup
62
63
 
63
64
  Pick your poison...
64
65
 
@@ -70,7 +71,7 @@ In your *Gemspec* (*<project>.gemspec*):
70
71
 
71
72
  ```Ruby
72
73
  # Pick one...
73
- spec.add_runtime_dependency 'psychgus', '~> X.X.X'
74
+ spec.add_dependency 'psychgus', '~> X.X.X'
74
75
  spec.add_development_dependency 'psychgus', '~> X.X.X'
75
76
  ```
76
77
 
@@ -92,7 +93,7 @@ $ bundle install
92
93
  $ bundle exec rake install:local
93
94
  ```
94
95
 
95
- ## [Using](#contents)
96
+ ## [//](#contents) Using
96
97
 
97
98
  Documentation (YARDoc) is available on my [GitHub Page](https://esotericpig.github.io/docs/psychgus/yardoc/index.html) and on [RubyDoc.info](https://www.rubydoc.info/gems/psychgus).
98
99
 
@@ -110,7 +111,7 @@ Instead of making your own styler, you can also use one of the [pre-defined styl
110
111
  | [Advanced Usage](#advanced-usage)
111
112
  | [Common Stylers](#common-stylers)
112
113
 
113
- ### [Simple Example](#using)
114
+ ### [//](#using) Simple Example
114
115
 
115
116
  ```Ruby
116
117
  require 'psychgus'
@@ -156,7 +157,7 @@ puts Coffee.new.to_yaml
156
157
  # style: [Cappuccino, Espresso, Latte, Mocha]
157
158
  ```
158
159
 
159
- ### [Hash Example](#using)
160
+ ### [//](#using) Hash Example
160
161
 
161
162
  ```Ruby
162
163
  require 'psychgus'
@@ -251,7 +252,7 @@ puts burgers.to_yaml({:indent => 3,:stylers => BurgerStyler.new,:deref_aliases =
251
252
  # Bun: Kaiser
252
253
  ```
253
254
 
254
- ### [Class Example](#using)
255
+ ### [//](#using) Class Example
255
256
 
256
257
  ```Ruby
257
258
  require 'psychgus'
@@ -422,7 +423,7 @@ puts burgers.to_yaml({:indent => 3,:deref_aliases => true})
422
423
  # Sauce: 'Honey BBQ'
423
424
  ```
424
425
 
425
- ### [Advanced Usage](#using)
426
+ ### [//](#using) Advanced Usage
426
427
 
427
428
  ```Ruby
428
429
  require 'psychgus'
@@ -513,7 +514,7 @@ puts parser.handler.root.to_ruby
513
514
  puts
514
515
  ```
515
516
 
516
- ### [Common Stylers](#using)
517
+ ### [//](#using) Common Stylers
517
518
 
518
519
  A collection of commonly-used [Stylers](https://esotericpig.github.io/docs/psychgus/yardoc/Psychgus/Stylers.html) and [Stylables](https://esotericpig.github.io/docs/psychgus/yardoc/Psychgus/Stylables.html) are included with Psychgus.
519
520
 
@@ -526,7 +527,7 @@ A collection of commonly-used [Stylers](https://esotericpig.github.io/docs/psych
526
527
  | [NoTagStyler](https://esotericpig.github.io/docs/psychgus/yardoc/Psychgus/Stylers/NoTagStyler.html) | Tag remover for classes |
527
528
  | [SeqFlowStyler](https://esotericpig.github.io/docs/psychgus/yardoc/Psychgus/Stylers/SeqFlowStyler.html) | FLOW style changer for Sequences only |
528
529
 
529
- #### [Stylers Example](#common-stylers)
530
+ #### [//](#common-stylers) Stylers Example
530
531
 
531
532
  ```Ruby
532
533
  require 'psychgus'
@@ -570,7 +571,7 @@ puts EggCarton.new.to_yaml
570
571
  # - green
571
572
  ```
572
573
 
573
- ## [Hacking](#contents)
574
+ ## [//](#contents) Hacking
574
575
 
575
576
  ```
576
577
  $ git clone 'https://github.com/esotericpig/psychgus.git'
@@ -579,17 +580,13 @@ $ bundle install
579
580
  $ bundle exec rake -T
580
581
  ```
581
582
 
582
- ### [Testing](#hacking)
583
+ ### [//](#hacking) Testing
583
584
 
584
- Run tests, excluding tests that create temp files:
585
+ Run tests:
585
586
 
586
587
  `$ bundle exec rake test`
587
588
 
588
- Run all tests:
589
-
590
- `$ bundle exec rake test_all`
591
-
592
- ### [Generating Doc](#hacking)
589
+ ### [//](#hacking) Generating Doc
593
590
 
594
591
  Generate doc:
595
592
 
@@ -599,12 +596,12 @@ Clean & generate pristine doc:
599
596
 
600
597
  `$ bundle exec rake clobber doc`
601
598
 
602
- ## [License](#contents)
599
+ ## [//](#contents) License
603
600
 
604
601
  [GNU LGPL v3+](LICENSE.txt)
605
602
 
606
603
  > Psychgus (<https://github.com/esotericpig/psychgus>)
607
- > Copyright (c) 2017-2021 Jonathan Bradley Whited
604
+ > Copyright (c) 2017-2024 Bradley Whited
608
605
  >
609
606
  > Psychgus is free software: you can redistribute it and/or modify
610
607
  > it under the terms of the GNU Lesser General Public License as published by
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
-
5
4
  require 'bundler/gem_tasks'
6
5
 
7
6
  require 'yard'
@@ -12,14 +11,12 @@ require 'psychgus/version'
12
11
  require 'rake/clean'
13
12
  require 'rake/testtask'
14
13
 
15
-
16
14
  task default: [:test]
17
15
 
18
16
  CLEAN.exclude('.git/','stock/')
19
17
  CLOBBER.include('doc/')
20
18
 
21
-
22
- # Execute "rake clobber doc" for pristine docs
19
+ # Execute "rake clobber doc" for pristine docs.
23
20
  desc 'Generate documentation (YARDoc)'
24
21
  task doc: %i[yard yard_gfm_fix]
25
22
 
@@ -29,24 +26,13 @@ Rake::TestTask.new do |task|
29
26
  task.libs = ['lib','test']
30
27
  task.pattern = File.join('test','**','*_test.rb')
31
28
  task.description += " ('#{task.pattern}')"
32
- #task.options = '--verbose' # Execute "rake test TESTOPT=-v" instead
29
+ #task.options = '--verbose' # Execute "rake test TESTOPT=-v" instead.
33
30
  task.verbose = true
34
31
  task.warning = true
35
32
  end
36
33
 
37
- desc 'Run all tests (including writing to temp files, etc.)'
38
- task :test_all do |task|
39
- ENV['PSYCHGUS_TEST'] = 'all'
40
-
41
- test_task = Rake::Task[:test]
42
-
43
- test_task.reenable
44
- test_task.invoke
45
- end
46
-
47
34
  YARD::Rake::YardocTask.new do |task|
48
35
  task.files = [File.join('lib','**','*.rb')]
49
- task.options += ['--title',"Psychgus v#{Psychgus::VERSION} Doc"]
50
36
  end
51
37
 
52
38
  YardGhurt::GFMFixTask.new do |task|
@@ -61,10 +47,7 @@ YardGhurt::GFMFixTask.new do |task|
61
47
  # Delete this file as it's never used (index.html is an exact copy)
62
48
  YardGhurt.rm_exist(File.join(t2.doc_dir,'file.README.html'))
63
49
 
64
- # Root dir of my GitHub Page for CSS/JS
65
- ghp_root = YardGhurt.to_bool(args.dev) ? '../../esotericpig.github.io' : '../../..'
66
-
67
- t2.css_styles << %Q(<link rel="stylesheet" type="text/css" href="#{ghp_root}/css/prism.css" />)
68
- t2.js_scripts << %Q(<script src="#{ghp_root}/js/prism.js"></script>)
50
+ t2.css_styles << '<link rel="stylesheet" type="text/css" href="/css/prism.css" />'
51
+ t2.js_scripts << '<script src="/js/prism.js"></script>)'
69
52
  end
70
53
  end
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2017-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2017 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  module Psychgus
13
12
  ###
14
13
  # This is the OOP way to style your classes/modules/etc.
@@ -78,9 +77,6 @@ module Psychgus
78
77
  #
79
78
  # "The Blueberry" is the name of Gus's car from the TV show Psych.
80
79
  #
81
- # @author Jonathan Bradley Whited
82
- # @since 1.0.0
83
- #
84
80
  # @see Ext::YAMLTreeExt
85
81
  # @see Ext::YAMLTreeExt#accept
86
82
  ###
@@ -3,20 +3,16 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  module Psychgus
13
12
  module Ext
14
13
  ###
15
14
  # Core extensions to Object.
16
15
  #
17
- # @author Jonathan Bradley Whited
18
- # @since 1.0.0
19
- #
20
16
  # @see https://github.com/ruby/psych/blob/master/lib/psych/core_ext.rb
21
17
  ###
22
18
  module ObjectExt
@@ -55,7 +51,10 @@ module Psychgus
55
51
  # @return [String] the YAML generated from this Object
56
52
  #
57
53
  # @see Psychgus.dump
58
- def to_yaml(**options)
54
+ def to_yaml(options={})
55
+ # NOTE: This method signature must use old-style `options={}` instead of `**options`!
56
+ # Because some Gems, like `Moneta`, depend on this.
57
+
59
58
  # Do not use Psych.dump() if no Stylers, because a class might be a Blueberry
60
59
  return Psychgus.dump(self,**options)
61
60
  end
@@ -3,21 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psych'
13
12
 
14
13
  module Psychgus
15
14
  module Ext
16
15
  ###
17
16
  # Extensions to Psych::Nodes::Node.
18
- #
19
- # @author Jonathan Bradley Whited
20
- # @since 1.0.0
21
17
  ###
22
18
  module NodeExt
23
19
  # Check if this Node is of a certain type (Alias, Mapping, Scalar, Sequence, etc.).
@@ -3,38 +3,44 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psych'
12
+ require 'rubygems/version'
13
13
 
14
14
  require 'psychgus/styled_tree_builder'
15
15
 
16
16
  module Psychgus
17
17
  module Ext
18
+ PSYCHGUS_PSYCH_VERSION = Gem::Version.create(Psych::VERSION)
19
+ PSYCHGUS_PSYCH_VERSION_5_1_2 = Gem::Version.create('5.1.2')
20
+
18
21
  ###
19
22
  # Extensions to Psych::Visitors::YAMLTree::Registrar.
20
- #
21
- # @author Jonathan Bradley Whited
22
- # @since 1.0.0
23
23
  ###
24
24
  module RegistrarExt
25
25
  # Remove +target+ from this Registrar to prevent it becoming an alias.
26
26
  #
27
27
  # @param target [Object] the Object to remove from this Registrar
28
- def remove_alias(target)
29
- @obj_to_node.delete(target.object_id)
28
+ def psychgus_unregister(target)
29
+ if PSYCHGUS_PSYCH_VERSION < PSYCHGUS_PSYCH_VERSION_5_1_2
30
+ return unless key?(target) && target.respond_to?(:object_id)
31
+
32
+ @obj_to_node.delete(target.object_id)
33
+ else # 5.1.2+
34
+ return unless key?(target)
35
+
36
+ @targets.delete(target)
37
+ @obj_to_node.delete(target)
38
+ end
30
39
  end
31
40
  end
32
41
 
33
42
  ###
34
43
  # Extensions to Psych::Visitors::YAMLTree.
35
- #
36
- # @author Jonathan Bradley Whited
37
- # @since 1.0.0
38
44
  ###
39
45
  module YAMLTreeExt
40
46
  # Accepts a new Object to convert to YAML.
@@ -72,9 +78,7 @@ module Psychgus
72
78
  end
73
79
 
74
80
  # Dereference aliases?
75
- if @emitter.deref_aliases?
76
- @st.remove_alias(target) if target.respond_to?(:object_id) && @st.key?(target)
77
- end
81
+ @st.psychgus_unregister(target) if @emitter.deref_aliases?
78
82
  end
79
83
 
80
84
  result = super(target)
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus/styler'
13
12
  require 'psychgus/super_sniffer'
14
13
 
@@ -19,9 +18,6 @@ module Psychgus
19
18
  # A collection of commonly-used {Styler} mixins
20
19
  # that can be included in a class instead of {Styler}.
21
20
  #
22
- # @author Jonathan Bradley Whited
23
- # @since 1.2.0
24
- #
25
21
  # @see Stylers
26
22
  # @see Styler
27
23
  ###
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psych'
13
12
 
14
13
  require 'psychgus/styled_tree_builder'
@@ -17,9 +16,6 @@ module Psychgus
17
16
  ###
18
17
  # Use this wherever Psych::Handlers::DocumentStream would have been used, to enable styling.
19
18
  #
20
- # @author Jonathan Bradley Whited
21
- # @since 1.0.0
22
- #
23
19
  # @see Psychgus.parse_stream Psychgus.parse_stream
24
20
  # @see Psych::Handlers::DocumentStream
25
21
  ###
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psych'
13
12
 
14
13
  require 'psychgus/styler'
@@ -18,9 +17,6 @@ module Psychgus
18
17
  ###
19
18
  # Use this wherever Psych::TreeBuilder would have been used, to enable styling.
20
19
  #
21
- # @author Jonathan Bradley Whited
22
- # @since 1.0.0
23
- #
24
20
  # @see Psychgus.parser Psychgus.parser
25
21
  # @see Psychgus.dump_stream Psychgus.dump_stream
26
22
  # @see Psych::TreeBuilder
@@ -3,21 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus/super_sniffer'
13
12
 
14
13
  module Psychgus
15
14
  module Styler
16
15
  ###
17
16
  # An empty {Styler} as a class.
18
- #
19
- # @author Jonathan Bradley Whited
20
- # @since 1.0.0
21
17
  ###
22
18
  class Empty
23
19
  include Styler
@@ -53,9 +49,6 @@ module Psychgus
53
49
  # # Roast: [Light, Medium, Dark, Extra Dark]
54
50
  # # Style: [Cappuccino, Espresso, Latte, Mocha]
55
51
  #
56
- # @author Jonathan Bradley Whited
57
- # @since 1.0.0
58
- #
59
52
  # @see Psychgus
60
53
  # @see Ext::ObjectExt#to_yaml
61
54
  # @see Blueberry
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus/stylables'
13
12
 
14
13
  module Psychgus
@@ -63,9 +62,6 @@ module Psychgus
63
62
  # # (7:1):Blue - <seq:(6:3)>
64
63
  # # (7:2):Green - <seq:(6:3)>
65
64
  #
66
- # @author Jonathan Bradley Whited
67
- # @since 1.2.0
68
- #
69
65
  # @see Stylables
70
66
  # @see Styler
71
67
  ###
@@ -3,15 +3,13 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'delegate'
13
12
 
14
-
15
13
  module Psychgus
16
14
  class SuperSniffer
17
15
  ###
@@ -31,9 +29,6 @@ module Psychgus
31
29
  # # of Psychgus or that is not exposed by Parent
32
30
  # end
33
31
  #
34
- # @author Jonathan Bradley Whited
35
- # @since 1.0.0
36
- #
37
32
  # @see SuperSniffer
38
33
  # @see SuperSniffer#start_parent SuperSniffer#start_parent
39
34
  # @see SuperSniffer#end_parent SuperSniffer#end_parent
@@ -82,8 +77,6 @@ module Psychgus
82
77
  # Check if the children of this parent are keys to a Mapping.
83
78
  #
84
79
  # @return [true,false] whether the children are keys to a Mapping
85
- #
86
- # @since 1.2.0
87
80
  def child_key?
88
81
  return @child_type == :key
89
82
  end
@@ -91,8 +84,6 @@ module Psychgus
91
84
  # Check if the children of this parent are values to a Mapping (i.e., values to a key).
92
85
  #
93
86
  # @return [true,false] whether the children are values to a Mapping (i.e., values to a key)
94
- #
95
- # @since 1.2.0
96
87
  def child_value?
97
88
  return @child_type == :value
98
89
  end
@@ -3,21 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus/super_sniffer/parent'
13
12
 
14
13
  module Psychgus
15
14
  class SuperSniffer
16
15
  ###
17
16
  # An empty {SuperSniffer} used for speed when you don't need sniffing in {StyledTreeBuilder}.
18
- #
19
- # @author Jonathan Bradley Whited
20
- # @since 1.0.0
21
17
  ###
22
18
  class Empty < SuperSniffer
23
19
  def add_alias(*) end
@@ -132,9 +128,6 @@ module Psychgus
132
128
  # @note You should never call the methods that are not readers, like {#add_alias}, {#start_mapping}, etc.
133
129
  # unless you are extending this class (creating a subclass).
134
130
  #
135
- # @author Jonathan Bradley Whited
136
- # @since 1.0.0
137
- #
138
131
  # @see StyledTreeBuilder
139
132
  # @see Styler
140
133
  # @see Blueberry#psychgus_stylers
@@ -3,13 +3,12 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2017-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2017 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  module Psychgus
13
- # Version of this gem in "#.#.#" format
14
- VERSION = '1.3.4'
12
+ # Version of this gem in "#.#.#" format.
13
+ VERSION = '1.3.5'
15
14
  end
data/lib/psychgus.rb CHANGED
@@ -3,16 +3,14 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2017-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2017 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psych'
13
12
 
14
13
  require 'psychgus/blueberry'
15
- require 'psychgus/ext'
16
14
  require 'psychgus/stylables'
17
15
  require 'psychgus/styled_document_stream'
18
16
  require 'psychgus/styled_tree_builder'
@@ -294,14 +292,11 @@ require 'psychgus/super_sniffer/parent'
294
292
  # parser.parse(yaml)
295
293
  # parser.handler
296
294
  # parser.handler.root
297
- #
298
- # @author Jonathan Bradley Whited
299
- # @since 1.0.0
300
295
  ###
301
296
  module Psychgus
302
297
  # Include these in the top namespace for convenience (i.e., less typing).
303
- include Stylables # @since 1.2.0
304
- include Stylers # @since 1.2.0
298
+ include Stylables
299
+ include Stylers
305
300
 
306
301
  NODE_CLASS_ALIASES = {Doc: :Document,Map: :Mapping,Seq: :Sequence}.freeze
307
302
  OPTIONS_ALIASES = {canon: :canonical,indent: :indentation}.freeze
@@ -577,8 +572,6 @@ module Psychgus
577
572
  #
578
573
  # @see Stylers::HierarchyStyler
579
574
  # @see dump_stream
580
- #
581
- # @since 1.2.0
582
575
  def self.hierarchy(*objects,**kargs)
583
576
  styler = Stylers::HierarchyStyler.new(**kargs)
584
577
 
@@ -757,9 +750,6 @@ module Psychgus
757
750
  # Private methods of Psych are not defined.
758
751
  #
759
752
  # @note For devs/hacking: because extend is used, do not prefix methods with "self."
760
- #
761
- # @author Jonathan Bradley Whited
762
- # @since 1.0.0
763
753
  ###
764
754
  module PsychDropIn
765
755
  # @see Psych.add_builtin_type
data/psychgus.gemspec CHANGED
@@ -1,14 +1,12 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
-
5
4
  require_relative 'lib/psychgus/version'
6
5
 
7
-
8
6
  Gem::Specification.new do |spec|
9
7
  spec.name = 'psychgus'
10
8
  spec.version = Psychgus::VERSION
11
- spec.authors = ['Jonathan Bradley Whited']
9
+ spec.authors = ['Bradley Whited']
12
10
  spec.email = ['code@esotericpig.com']
13
11
  spec.licenses = ['LGPL-3.0-or-later']
14
12
  spec.homepage = 'https://github.com/esotericpig/psychgus'
@@ -23,7 +21,7 @@ Gem::Specification.new do |spec|
23
21
  'documentation_uri' => 'https://esotericpig.github.io/docs/psychgus/yardoc/index.html',
24
22
  }
25
23
 
26
- spec.required_ruby_version = '>= 2.1.10'
24
+ spec.required_ruby_version = '>= 2.2'
27
25
  spec.require_paths = ['lib']
28
26
  spec.bindir = 'bin'
29
27
 
@@ -36,13 +34,13 @@ Gem::Specification.new do |spec|
36
34
  ].flatten
37
35
 
38
36
  # Test using different Gem versions:
39
- # GST=1 bundle update && bundle exec rake test_all
37
+ # GST=1 bundle update && bundle exec rake test
40
38
  gemspec_test = ENV.fetch('GST','').to_s.strip
41
39
  psych_gemv = false
42
40
 
43
41
  if !gemspec_test.empty?
44
42
  case gemspec_test
45
- when '1' then psych_gemv = '~> 3.0'
43
+ when '1' then psych_gemv = '<= 5.1.1'
46
44
  end
47
45
 
48
46
  puts 'Using Gem versions:'
@@ -52,13 +50,5 @@ Gem::Specification.new do |spec|
52
50
  # 3.0 is needed for this issue:
53
51
  # - https://bugs.ruby-lang.org/issues/13115
54
52
  # - https://github.com/ruby/psych/commit/712a65a53f3c15105cd86e8ad3ee3c779050ada4
55
- spec.add_runtime_dependency 'psych',psych_gemv || '>= 3.0'
56
-
57
- spec.add_development_dependency 'bundler' ,'~> 2.2'
58
- spec.add_development_dependency 'minitest' ,'~> 5.14' # For testing
59
- spec.add_development_dependency 'rake' ,'~> 13.0'
60
- spec.add_development_dependency 'rdoc' ,'~> 6.3' # For RDoc for YARD (*.rb)
61
- spec.add_development_dependency 'redcarpet' ,'~> 3.5' # For Markdown for YARD (*.md)
62
- spec.add_development_dependency 'yard' ,'~> 0.9' # For documentation
63
- spec.add_development_dependency 'yard_ghurt','~> 1.2' # For YARD GitHub rake tasks
53
+ spec.add_dependency 'psych',psych_gemv || '>= 3.0'
64
54
  end
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus_tester'
13
12
 
14
13
  class Burger
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus_tester'
13
12
 
14
13
  require 'tempfile'
@@ -65,15 +64,9 @@ Toppings:
65
64
  assert_equal EXPECTED_BURGERS,BURGERS_DATA.to_yaml(stylers: @flow_styler)
66
65
  end
67
66
 
68
- # Execute "rake test_all" if you update Psychgus.dump_file()/load_file()
69
67
  def test_file
70
- if !TEST_ALL
71
- skip(TEST_ALL_SKIP_MSG)
72
- return # Justin Case
73
- end
74
-
75
68
  Tempfile.create(['Psychgus','.yaml']) do |file|
76
- puts "Testing #{self.class.name} w/ temp file: #{file.path}"
69
+ #puts "Testing #{self.class.name} w/ temp file: #{file.path}"
77
70
 
78
71
  Psychgus.dump_file(file,BURGERS_DATA,
79
72
  mode: File::CREAT | File::RDWR,
@@ -3,27 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'minitest/autorun'
13
12
 
14
13
  require 'psychgus'
15
14
 
16
15
  # Changing the YAML/data will break tests
17
16
  class PsychgusTester < Minitest::Test
18
- # If true, will...
19
- # - Run tests that create temp file(s).
20
- # - I don't like creating temp file(s) every time I run tests (which is a lot).
21
- #
22
- # To do this, execute:
23
- # rake test_all
24
- TEST_ALL = (ENV['PSYCHGUS_TEST'].to_s.strip.casecmp('all') == 0)
25
- TEST_ALL_SKIP_MSG = 'Execute "rake test_all" for this test'
26
-
27
17
  BURGERS_YAML = <<-YAML
28
18
  Burgers:
29
19
  Classic:
data/test/sniffer_test.rb CHANGED
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus_tester'
13
12
 
14
13
  require 'stringio'
data/test/styler_test.rb CHANGED
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus_tester'
13
12
 
14
13
  class MyStyler
data/test/stylers_test.rb CHANGED
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'psychgus_tester'
13
12
 
14
13
  class EggCarton
@@ -26,9 +25,6 @@ class EggCarton
26
25
  end
27
26
  end
28
27
 
29
- ###
30
- # @since 1.2.0
31
- ###
32
28
  class StylersTest < PsychgusTester
33
29
  def setup
34
30
  @egg_carton = EggCarton.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psychgus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
- - Jonathan Bradley Whited
8
- autorequire:
7
+ - Bradley Whited
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-20 00:00:00.000000000 Z
11
+ date: 2024-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: psych
@@ -24,104 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.2'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.2'
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '5.14'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '5.14'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '13.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '13.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rdoc
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '6.3'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '6.3'
83
- - !ruby/object:Gem::Dependency
84
- name: redcarpet
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '3.5'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '3.5'
97
- - !ruby/object:Gem::Dependency
98
- name: yard
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.9'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.9'
111
- - !ruby/object:Gem::Dependency
112
- name: yard_ghurt
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.2'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.2'
125
27
  description: Easily style YAML files using Psych, like Sequence/Mapping Flow style.
126
28
  email:
127
29
  - code@esotericpig.com
@@ -137,7 +39,6 @@ files:
137
39
  - Rakefile
138
40
  - lib/psychgus.rb
139
41
  - lib/psychgus/blueberry.rb
140
- - lib/psychgus/ext.rb
141
42
  - lib/psychgus/ext/core_ext.rb
142
43
  - lib/psychgus/ext/node_ext.rb
143
44
  - lib/psychgus/ext/yaml_tree_ext.rb
@@ -166,7 +67,7 @@ metadata:
166
67
  bug_tracker_uri: https://github.com/esotericpig/psychgus/issues
167
68
  changelog_uri: https://github.com/esotericpig/psychgus/blob/master/CHANGELOG.md
168
69
  documentation_uri: https://esotericpig.github.io/docs/psychgus/yardoc/index.html
169
- post_install_message:
70
+ post_install_message:
170
71
  rdoc_options: []
171
72
  require_paths:
172
73
  - lib
@@ -174,15 +75,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
75
  requirements:
175
76
  - - ">="
176
77
  - !ruby/object:Gem::Version
177
- version: 2.1.10
78
+ version: '2.2'
178
79
  required_rubygems_version: !ruby/object:Gem::Requirement
179
80
  requirements:
180
81
  - - ">="
181
82
  - !ruby/object:Gem::Version
182
83
  version: '0'
183
84
  requirements: []
184
- rubygems_version: 3.2.15
185
- signing_key:
85
+ rubygems_version: 3.5.18
86
+ signing_key:
186
87
  specification_version: 4
187
88
  summary: Easily style YAML files using Psych.
188
89
  test_files: []
data/lib/psychgus/ext.rb DELETED
@@ -1,21 +0,0 @@
1
- # encoding: UTF-8
2
- # frozen_string_literal: true
3
-
4
- #--
5
- # This file is part of Psychgus.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
7
- #
8
- # SPDX-License-Identifier: LGPL-3.0-or-later
9
- #++
10
-
11
-
12
- module Psychgus
13
- ###
14
- # Contains all of the extensions (monkey patching) to core/Psych classes/modules.
15
- #
16
- # @author Jonathan Bradley Whited
17
- # @since 1.0.0
18
- ###
19
- module Ext
20
- end
21
- end