mdextab 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -8
- data/.rubocop_todo.yml +8 -551
- data/Gemfile +2 -0
- data/bin/makemdtab +46 -283
- data/bin/mdextab +12 -20
- data/lib/mdextab/layer.rb +157 -0
- data/lib/mdextab/makemdtab.rb +119 -0
- data/lib/mdextab/table.rb +11 -14
- data/lib/mdextab/tbody.rb +9 -9
- data/lib/mdextab/td.rb +22 -22
- data/lib/mdextab/th.rb +7 -7
- data/lib/mdextab/token.rb +98 -4
- data/lib/mdextab/tr.rb +1 -1
- data/lib/mdextab/version.rb +1 -1
- data/lib/mdextab.rb +418 -533
- data/mdextab.gemspec +4 -0
- metadata +60 -4
- data/lib/mdextab/loggerx.rb +0 -58
- data/lib/mdextab/yamlx.rb +0 -67
data/mdextab.gemspec
CHANGED
@@ -43,4 +43,8 @@ Gem::Specification.new do |spec|
|
|
43
43
|
|
44
44
|
spec.add_runtime_dependency "simpleoptparse"
|
45
45
|
spec.add_runtime_dependency "erubis"
|
46
|
+
spec.add_runtime_dependency "messagex"
|
47
|
+
spec.add_runtime_dependency "filex"
|
48
|
+
spec.add_development_dependency "rubocop"
|
49
|
+
spec.add_development_dependency "rubocop-performance"
|
46
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdextab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yasuo kominami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,62 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: messagex
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: filex
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-performance
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
97
153
|
description: mainly extend table tag of HTML5 of Makrdown on Pandoc.
|
98
154
|
email:
|
99
155
|
- ykominami@gmail.com
|
@@ -117,7 +173,8 @@ files:
|
|
117
173
|
- bin/setup
|
118
174
|
- exe/mdextab
|
119
175
|
- lib/mdextab.rb
|
120
|
-
- lib/mdextab/
|
176
|
+
- lib/mdextab/layer.rb
|
177
|
+
- lib/mdextab/makemdtab.rb
|
121
178
|
- lib/mdextab/table.rb
|
122
179
|
- lib/mdextab/tbody.rb
|
123
180
|
- lib/mdextab/td.rb
|
@@ -125,7 +182,6 @@ files:
|
|
125
182
|
- lib/mdextab/token.rb
|
126
183
|
- lib/mdextab/tr.rb
|
127
184
|
- lib/mdextab/version.rb
|
128
|
-
- lib/mdextab/yamlx.rb
|
129
185
|
- mdextab.gemspec
|
130
186
|
homepage: ''
|
131
187
|
licenses:
|
data/lib/mdextab/loggerx.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'logger'
|
2
|
-
|
3
|
-
module Mdextab
|
4
|
-
class Loggerx
|
5
|
-
def initialize(fname)
|
6
|
-
@loggerSTDOUT = Logger.new(STDOUT)
|
7
|
-
@loggerSTDOUT.level = Logger::UNKNOWN
|
8
|
-
@loggerSTDOUT.formatter = proc do |severity, datetime, progname, msg|
|
9
|
-
"#{severity[0]}: #{msg}\n"
|
10
|
-
# "#{msg}\n"
|
11
|
-
end
|
12
|
-
file = File.open( fname , 'w')
|
13
|
-
@loggerFILE = Logger.new(file)
|
14
|
-
@loggerFILE.level = Logger::INFO
|
15
|
-
@loggerFILE.formatter = proc do |severity, datetime, progname, msg|
|
16
|
-
"#{severity}: #{msg}\n"
|
17
|
-
# "#{msg}\n"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def datetime_format=(format)
|
22
|
-
@loggerSTDOUT.datetime_format=format
|
23
|
-
@loggerFILE.datetime_format=format
|
24
|
-
end
|
25
|
-
|
26
|
-
def level=(value)
|
27
|
-
puts value
|
28
|
-
@loggerSTDOUT.level=value
|
29
|
-
@loggerFILE.level=value
|
30
|
-
end
|
31
|
-
|
32
|
-
def set_level(value)
|
33
|
-
puts value
|
34
|
-
@loggerSTDOUT.level=value
|
35
|
-
@loggerFILE.level=value
|
36
|
-
end
|
37
|
-
|
38
|
-
def debug(mes)
|
39
|
-
@loggerSTDOUT.debug(mes)
|
40
|
-
@loggerFILE.debug(mes)
|
41
|
-
end
|
42
|
-
|
43
|
-
def error(mes)
|
44
|
-
@loggerSTDOUT.error(mes)
|
45
|
-
@loggerFILE.error(mes)
|
46
|
-
end
|
47
|
-
|
48
|
-
def fatal(mes)
|
49
|
-
@loggerSTDOUT.fatal(mes)
|
50
|
-
@loggerFILE.fatal(mes)
|
51
|
-
end
|
52
|
-
|
53
|
-
def info(mes)
|
54
|
-
@loggerSTDOUT.info(mes)
|
55
|
-
@loggerFILE.info(mes)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
data/lib/mdextab/yamlx.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'erubis'
|
3
|
-
|
4
|
-
module Mdextab
|
5
|
-
module Yamlx
|
6
|
-
extend self
|
7
|
-
|
8
|
-
def loadSetting(yamlfname , auxiliaryYamlFname, erubyfname , hs={})
|
9
|
-
if yamlfname
|
10
|
-
begin
|
11
|
-
obj = YAML.load_file(yamlfname)
|
12
|
-
rescue RuntimeError => ex
|
13
|
-
obj = {}
|
14
|
-
end
|
15
|
-
obj = {} unless obj
|
16
|
-
else
|
17
|
-
obj = {}
|
18
|
-
end
|
19
|
-
|
20
|
-
if auxiliaryYamlFname
|
21
|
-
begin
|
22
|
-
obj2 = YAML.load_file(auxiliaryYamlFname)
|
23
|
-
rescue RuntimeError => ex
|
24
|
-
obj2 = {}
|
25
|
-
end
|
26
|
-
obj2 = {} unless obj2
|
27
|
-
else
|
28
|
-
obj2 = {}
|
29
|
-
end
|
30
|
-
obj3 = obj.merge(obj2)
|
31
|
-
|
32
|
-
str = File.read(erubyfname)
|
33
|
-
Erubis::Eruby.new(str).result(obj3).split("\n")
|
34
|
-
# File.readlines( erubyfname ).map{|x| Erubis::Eruby.new(x).result(obj3)}
|
35
|
-
end
|
36
|
-
|
37
|
-
def getContent( fname , hash = {} )
|
38
|
-
if File.exist?( fname )
|
39
|
-
fpath = fname
|
40
|
-
else
|
41
|
-
fpath = File.join( Dir.pwd , fname )
|
42
|
-
end
|
43
|
-
str = File.read( fpath )
|
44
|
-
eruby = Erubis::Eruby.new( str )
|
45
|
-
eruby.result( hash )
|
46
|
-
end
|
47
|
-
|
48
|
-
def changeContext( obj )
|
49
|
-
obj_new = {}
|
50
|
-
obj.each{|k,v|
|
51
|
-
if v.class == Hash
|
52
|
-
if v["path"]
|
53
|
-
hs = {}
|
54
|
-
v.each{|k2,v2|
|
55
|
-
hs[k2]=v2 if k2 != "path"
|
56
|
-
}
|
57
|
-
obj_new[k] = get_content( v["path"] , hs )
|
58
|
-
end
|
59
|
-
end
|
60
|
-
}
|
61
|
-
obj_new.each{|k3,v3|
|
62
|
-
obj[k3] = v3
|
63
|
-
}
|
64
|
-
obj_new
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|