commentbox 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/commentbox.rb +7 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ebd9f2c2594225bc341c2f5fe19c715ffbf5cb9baa10282738218f7aae49f5b
4
- data.tar.gz: 9b6a3e592d4208f27392d03f74a8e9efcb0a7edd41557695a4b4e9b0e805506f
3
+ metadata.gz: f33b4420fef198112fd6fe3b52306004024b3a6b70359e545e6e2e45fccfbed1
4
+ data.tar.gz: ac9415da017b4b9693674e49bf816661e3bcbf9ec73a0b2480ea3eb2a30dbcea
5
5
  SHA512:
6
- metadata.gz: b9fc9afd9b06cbb135e0bb0d43602b8e330d43409669d3c0a327b15009f44e8a46c0a4cbcd9cee70025608ea8ca1f2a429e36225b327101218c1b5dbfe37b98f
7
- data.tar.gz: f2abc7f8fcdb3d98e1dc280a491e78eda83064bdd8e8aee0e775e7582b9238d41be48df936905ae390179037cbe99dc09c76cf5d7cbb5358ecf75a27e1029cf2
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
- # i should rename this to parallax
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.set_default_params (value = {}); value.each { |key, val| @@default_params[key] = val } end
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
- @@styles.merge! value
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.0
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-02 00:00:00.000000000 Z
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