psychgus 1.0.0 → 1.0.1
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/README.md +2 -0
- data/lib/psychgus/version.rb +1 -1
- data/psychgus.gemspec +1 -57
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cfde7f03f882111004ff6803bccf54482e0fe87096339e9c2978dafbe75e886
|
4
|
+
data.tar.gz: 5d2e3b11f94fe6272032cd94657f1918106b29446a72c90762a9c8ea04058405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc8920579914bda512cfa5b347ecb5af3221843634e7b019e368be93ff2160a353e833aa631c388f5a3118ba5247fcb469cc7b23f4802c46837d839ab7331ce4
|
7
|
+
data.tar.gz: f6cb6210f97e2178c8ce95c16ec7eb276115376c11ad200aec6540a2e98fe2a03721f7674407fa056aabec8f62a83643ca13358dbf6989ef0969ba8dcaf018c4
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Psychgus
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/psychgus)
|
4
|
+
|
3
5
|
Psychgus uses the core standard library [Psych](https://github.com/ruby/psych) for working with [YAML](https://yaml.org) and extends it so that developers can easily style the YAML according to their needs.
|
4
6
|
|
5
7
|
Thank you to the people that worked and continue to work hard on the Psych project.
|
data/lib/psychgus/version.rb
CHANGED
data/psychgus.gemspec
CHANGED
@@ -41,63 +41,7 @@ Gem::Specification.new do |spec|
|
|
41
41
|
|
42
42
|
spec.homepage = 'https://github.com/esotericpig/psychgus'
|
43
43
|
spec.summary = %q(Easily style YAML files using Psych, like Sequence/Mapping Flow style.)
|
44
|
-
spec.description =
|
45
|
-
Easily style YAML files using Psych, like Sequence/Mapping Flow style.
|
46
|
-
|
47
|
-
Simple example:
|
48
|
-
class CoffeeStyler
|
49
|
-
include Psychgus::Styler
|
50
|
-
|
51
|
-
def style_sequence(sniffer,node)
|
52
|
-
node.style = Psychgus::SEQUENCE_FLOW
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
coffee = {
|
57
|
-
'Roast'=>['Light', 'Medium', 'Dark', 'Extra Dark'],
|
58
|
-
'Style'=>['Cappuccino', 'Espresso', 'Latte', 'Mocha']}
|
59
|
-
|
60
|
-
puts coffee.to_yaml(stylers: CoffeeStyler.new)
|
61
|
-
|
62
|
-
# Output:
|
63
|
-
# ---
|
64
|
-
# Roast: [Light, Medium, Dark, Extra Dark]
|
65
|
-
# Style: [Cappuccino, Espresso, Latte, Mocha]
|
66
|
-
|
67
|
-
Class example:
|
68
|
-
class Coffee
|
69
|
-
include Psychgus::Blueberry
|
70
|
-
|
71
|
-
def initialize
|
72
|
-
@roast = ['Light', 'Medium', 'Dark', 'Extra Dark']
|
73
|
-
@style = ['Cappuccino', 'Espresso', 'Latte', 'Mocha']
|
74
|
-
end
|
75
|
-
|
76
|
-
def psychgus_stylers(sniffer)
|
77
|
-
CoffeeStyler.new
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
puts Coffee.new.to_yaml
|
82
|
-
|
83
|
-
# Output:
|
84
|
-
# --- !ruby/object:Coffee
|
85
|
-
# roast: [Light, Medium, Dark, Extra Dark]
|
86
|
-
# style: [Cappuccino, Espresso, Latte, Mocha]
|
87
|
-
|
88
|
-
The produced YAML without Psychgus styling (i.e., without CoffeeStyler):
|
89
|
-
# ---
|
90
|
-
# Roast:
|
91
|
-
# - Light
|
92
|
-
# - Medium
|
93
|
-
# - Dark
|
94
|
-
# - Extra Dark
|
95
|
-
# Style:
|
96
|
-
# - Cappuccino
|
97
|
-
# - Espresso
|
98
|
-
# - Latte
|
99
|
-
# - Mocha
|
100
|
-
EOS
|
44
|
+
spec.description = %q(Easily style YAML files using Psych, like Sequence/Mapping Flow style.)
|
101
45
|
|
102
46
|
spec.files = Dir.glob("{lib,test,yard}/**/*") + %w(
|
103
47
|
Gemfile
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: psychgus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Bradley Whited (@esotericpig)
|
@@ -108,21 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.9'
|
111
|
-
description:
|
112
|
-
example:\n class CoffeeStyler\n include Psychgus::Styler\n \n def style_sequence(sniffer,node)\n
|
113
|
-
\ node.style = Psychgus::SEQUENCE_FLOW\n end\n end\n \n coffee = {\n 'Roast'=>['Light',
|
114
|
-
'Medium', 'Dark', 'Extra Dark'],\n 'Style'=>['Cappuccino', 'Espresso', 'Latte',
|
115
|
-
'Mocha']}\n \n puts coffee.to_yaml(stylers: CoffeeStyler.new)\n \n # Output:\n
|
116
|
-
\ # ---\n # Roast: [Light, Medium, Dark, Extra Dark]\n # Style: [Cappuccino, Espresso,
|
117
|
-
Latte, Mocha]\n\nClass example:\n class Coffee\n include Psychgus::Blueberry\n
|
118
|
-
\ \n def initialize\n @roast = ['Light', 'Medium', 'Dark', 'Extra Dark']\n
|
119
|
-
\ @style = ['Cappuccino', 'Espresso', 'Latte', 'Mocha']\n end\n \n def
|
120
|
-
psychgus_stylers(sniffer)\n CoffeeStyler.new\n end\n end\n \n puts Coffee.new.to_yaml\n
|
121
|
-
\ \n # Output:\n # --- !ruby/object:Coffee\n # roast: [Light, Medium, Dark, Extra
|
122
|
-
Dark]\n # style: [Cappuccino, Espresso, Latte, Mocha]\n\nThe produced YAML without
|
123
|
-
Psychgus styling (i.e., without CoffeeStyler):\n # ---\n # Roast:\n # - Light\n
|
124
|
-
\ # - Medium\n # - Dark\n # - Extra Dark\n # Style:\n # - Cappuccino\n # -
|
125
|
-
Espresso\n # - Latte\n # - Mocha\n"
|
111
|
+
description: Easily style YAML files using Psych, like Sequence/Mapping Flow style.
|
126
112
|
email:
|
127
113
|
- bradley@esotericpig.com
|
128
114
|
executables: []
|