AoBane 0.1.4 → 0.1.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.
- data/lib/AoBane/utilities.rb +18 -3
- data/lib/AoBane/version.rb +1 -1
- data/lib/AoBane.rb +3 -3
- metadata +2 -2
data/lib/AoBane/utilities.rb
CHANGED
@@ -16,7 +16,9 @@ $MAX_H = 6
|
|
16
16
|
@@log.level = Logger::WARN
|
17
17
|
|
18
18
|
###paling proccessing##########################################################
|
19
|
-
$startDivMark =
|
19
|
+
$startDivMark =
|
20
|
+
'\|\-:b=(\d+?)\s(\w+?\s\w+?\s)(w=(\w+?)\s){0,1}(h=(\w+?)\s){0,1}(bg=(\w+?)\s){0,1}' +
|
21
|
+
'rad=(\w+?)\-+\|'
|
20
22
|
$endDivMark = '\|\-+\|'
|
21
23
|
|
22
24
|
def prePaling(text)
|
@@ -38,12 +40,24 @@ def prePaling(text)
|
|
38
40
|
return output.join("\n")
|
39
41
|
end #def prePaling
|
40
42
|
|
43
|
+
def isDigit(str)
|
44
|
+
if /\d+/ =~ str then
|
45
|
+
return true
|
46
|
+
else
|
47
|
+
return false
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
41
51
|
def postPaling(text)
|
42
52
|
output = text.split("\n")
|
43
53
|
output.each_with_index{|line,index|
|
44
54
|
if /#{$startDivMark}/ =~ line then
|
45
|
-
output[index] = '<div style="border:' + $1 + 'px ' + $2 +
|
46
|
-
|
55
|
+
output[index] = '<div style="border:' + $1 + 'px ' + $2 + ';' +
|
56
|
+
if $4.nil? then '' else 'width:' + if Utilities::isDigit($4) then $4 + 'px;' else $4 + ';' end end +
|
57
|
+
if $6.nil? then '' else 'height:' + if Utilities::isDigit($6) then $6 + 'px;' else $6 + ';' end end +
|
58
|
+
if $8.nil? then '' else 'background-color:' + $8 + ';' end +
|
59
|
+
'border-radius:' +
|
60
|
+
if $9.nil? then '' else $9 end + 'px;">'
|
47
61
|
loop do
|
48
62
|
index += 1
|
49
63
|
if /#{$endDivMark}/ =~ output[index] then
|
@@ -105,6 +119,7 @@ end #def
|
|
105
119
|
|
106
120
|
module_function :calcSectionNo
|
107
121
|
module_function :prePaling
|
122
|
+
module_function :isDigit
|
108
123
|
module_function :postPaling
|
109
124
|
#############################################################################
|
110
125
|
end
|
data/lib/AoBane/version.rb
CHANGED
data/lib/AoBane.rb
CHANGED
@@ -51,9 +51,9 @@ require 'AoBane/utilities'
|
|
51
51
|
require 'math_ml/string'
|
52
52
|
|
53
53
|
module AoBane
|
54
|
-
VERSION = '0.1.
|
55
|
-
VERSION_NUMBER = 0.
|
56
|
-
RELEASE_DATE = '2013-04-
|
54
|
+
VERSION = '0.1.5'
|
55
|
+
VERSION_NUMBER = 0.0105
|
56
|
+
RELEASE_DATE = '2013-04-15'
|
57
57
|
VERSION_LABEL = "#{VERSION} (#{RELEASE_DATE})"
|
58
58
|
|
59
59
|
UTF8_BOM = "\xef\xbb\xbf"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: AoBane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: math_ml
|