muflax 0.3.17 → 0.3.18
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
- checksums.yaml.gz.sig +3 -1
- data/Gemfile.lock +1 -1
- data/lib/muflax/align.rb +5 -20
- data/muflax.gemspec +1 -1
- data.tar.gz.sig +2 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a633eb18821a470c9d818d57bcc4406aaf79861522957defd698ce2bfdc4ced
|
4
|
+
data.tar.gz: d682e16f1eec598a949b2d22db1dee20a75a1b9cdb9d9e04ff32a37485dd9556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102246d9feb7a32a2fee1ce34cad9d6e122e808a53eece94fc9833e1071ff0254a714193c1a1e9511659dbd659084ebb293a090ca477b8c1da1116d59da93d63
|
7
|
+
data.tar.gz: aab37b803b43ab5241ab075beecf1c495eb2390e3aa9865c429e27746dc8edaeaa1aeada91035f6987155c9809945a020e05a992471e78b24825d3c160b878fe
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
�'#�;�X��7������o!�V�П3
|
2
|
+
��4��U�"X������a�����s] ��ƙ�Ż�����[ԝ����r9��k
|
3
|
+
���9��<����~#�r)#���5"4����y���A����Wñ4YX������d�*j��Q���YTb���9m[�^
|
data/Gemfile.lock
CHANGED
data/lib/muflax/align.rb
CHANGED
@@ -39,9 +39,9 @@ end
|
|
39
39
|
class Array
|
40
40
|
def align str="\t", alignment: :left, force: false
|
41
41
|
just_function = case alignment
|
42
|
-
when :left ; Proc.new{|e,l,_c| e.ljust
|
43
|
-
when :right ; Proc.new{|e,l,_c| e.rjust
|
44
|
-
when :center ; Proc.new{|e,l,_c| e.center
|
42
|
+
when :left ; Proc.new{|e,l,_c| e.ljust l }
|
43
|
+
when :right ; Proc.new{|e,l,_c| e.rjust l }
|
44
|
+
when :center ; Proc.new{|e,l,_c| e.center l }
|
45
45
|
when Proc ; alignment
|
46
46
|
else
|
47
47
|
raise "invalid alignment: #{alignment}"
|
@@ -50,11 +50,10 @@ class Array
|
|
50
50
|
# split all lines
|
51
51
|
lines = []
|
52
52
|
columns = 0
|
53
|
-
rx = /[ ]
|
53
|
+
rx = force ? /[ ]*#{str}/ : str
|
54
54
|
|
55
55
|
self.each do |line|
|
56
|
-
line .
|
57
|
-
line = line.split(str, -1)
|
56
|
+
line = line.split(rx, -1)
|
58
57
|
lines << line
|
59
58
|
columns = [columns, line.size].max
|
60
59
|
end
|
@@ -79,18 +78,4 @@ class Array
|
|
79
78
|
|
80
79
|
lines
|
81
80
|
end
|
82
|
-
|
83
|
-
def align! str=" ", alignment: :left
|
84
|
-
self.replace(self.align(str, alignment: alignment))
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
class String
|
89
|
-
def align str=" ", alignment: :left
|
90
|
-
self.split("\n").align(str, alignment: alignment).join("\n")
|
91
|
-
end
|
92
|
-
|
93
|
-
def align! str=" ", alignment: :left
|
94
|
-
self.replace(self.align(str, aligment: alignment))
|
95
|
-
end
|
96
81
|
end
|
data/muflax.gemspec
CHANGED
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
Zu�|�3�D�|z<�%�B����[?d]�0��T(���qjF"<�)�o��.�h��|'%���?m{$��ƕ�~;�`:�؍G��4?LBS#V�,x��`�� �|�Ћ������8�H�eNr�BV*�++�� x��yS��1w�*�cy9Ga�X;[ar��L���x��²x�{�1��dk�:ׇ�d�44C��HvG�B^C����+��? w$�G
|
2
|
+
�݇�SBKZY��֙�����IϚ��.*Q%XJ�W2�
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|