commentbox 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commentbox.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f33b4420fef198112fd6fe3b52306004024b3a6b70359e545e6e2e45fccfbed1
|
4
|
+
data.tar.gz: ac9415da017b4b9693674e49bf816661e3bcbf9ec73a0b2480ea3eb2a30dbcea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4424cad553e6c719226f93f3d123cb5a0ed53b2c0314ee21334c9714c865a8b32124033ea06550abd3265bd8a55f6dff555f2c8fa47c8bd170b84c8335c6b2
|
7
|
+
data.tar.gz: 300273669341b063b2a568c16efa1db79691385decda38adefd921c0af44e3997c7d0699d132c76ee46e426c0e10ee106cb6f59745af246aac6afb7ca347f68f
|
data/lib/commentbox.rb
CHANGED
@@ -5,7 +5,6 @@ module CommentBoxStyles
|
|
5
5
|
padding: 4,
|
6
6
|
stretch: 0,
|
7
7
|
offset: 2,
|
8
|
-
# TODO next. some people may want their boxes to all be the same width
|
9
8
|
min_width: 0,
|
10
9
|
spacelines: true,
|
11
10
|
alignment: :left
|
@@ -17,9 +16,7 @@ module CommentBoxStyles
|
|
17
16
|
evenlines: ['/ ', ' /'],
|
18
17
|
oddcorners: ['=/','/=']
|
19
18
|
},
|
20
|
-
|
21
|
-
# what a cool name
|
22
|
-
bars: {
|
19
|
+
parallax: {
|
23
20
|
hlines: '==',
|
24
21
|
oddlines: ['||', '||'],
|
25
22
|
evenlines: ['||', '||'],
|
@@ -81,9 +78,11 @@ class CommentBox
|
|
81
78
|
@@styles = CommentBoxStyles::Styles
|
82
79
|
|
83
80
|
# class methods for messing with default values
|
81
|
+
# make sure everything is symbolized that needs to be
|
84
82
|
def self.default_params; @@default_params end
|
85
|
-
def self.default_params=(value); @@default_params = value end
|
86
|
-
def self.
|
83
|
+
def self.default_params=(value); @@default_params = value.transform_keys(&:to_sym) end
|
84
|
+
# def self.default_params[]= (key, value); @@default_params[key.to_sym] = value end
|
85
|
+
def self.set_default_params (value = {}); value.each { |key, val| @@default_params[key.to_sym] = val } end
|
87
86
|
def self.styles; @@styles end
|
88
87
|
def self.add_style(value)
|
89
88
|
value.each do |key, val|
|
@@ -93,7 +92,8 @@ class CommentBox
|
|
93
92
|
end
|
94
93
|
end
|
95
94
|
# I could attempt to remove a :default? key here but it doesn't matter
|
96
|
-
|
95
|
+
# this is a terse one but trust me
|
96
|
+
@@styles.merge! value.transform_keys(&:to_sym).transform_values { |v| v.transform_keys(&:to_sym) }
|
97
97
|
end
|
98
98
|
|
99
99
|
# instance setter methods
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commentbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonard H. Phelan IV
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A little gem for generating pretty multiline comment boxes in C/C++ templates
|
14
14
|
email: lenny@lenny.beer
|