jekyll-spaceship 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jekyll-spaceship.gemspec +1 -0
- data/lib/jekyll-spaceship/cores/logger.rb +7 -4
- data/lib/jekyll-spaceship/cores/manager.rb +7 -7
- data/lib/jekyll-spaceship/cores/register.rb +1 -1
- data/lib/jekyll-spaceship/processors/table-processor.rb +6 -5
- data/lib/jekyll-spaceship/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 742f0614b3439278bf2c29734eea5b0659766e01d8e411397b3ee1c1374350a0
|
4
|
+
data.tar.gz: 701bcad3732fa5d19f66600a56e3e2fd339e56b480cb41e305b50e0defcc5e6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a4f4e91e888b5bae2b3ec78755dccb7b5a89747f572bc2eea82c375f94c69315e9952d63354e276d577fcbb62ec0e51deafa7fe6392bb9860dbb5bd2294bff
|
7
|
+
data.tar.gz: 633b3de00d4b7ddc0c19bf1644d626fb21c4ba3ba0fb466678a25199701082e47f346ce4aeaaf5ed495977f0e886dacae42f46422f1eb43f05280055f3181a32
|
data/jekyll-spaceship.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency "jekyll", ">= 3.6", "< 5.0"
|
22
22
|
spec.add_dependency "nokogiri", "~> 1.6"
|
23
|
+
spec.add_dependency "rainbow", "~> 3.0"
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler"
|
25
26
|
spec.add_development_dependency "rake", "~> 12.0"
|
@@ -1,6 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'jekyll-spaceship/version'
|
4
|
+
require 'rainbow/refinement'
|
5
|
+
|
6
|
+
using Rainbow
|
4
7
|
|
5
8
|
module Jekyll::Spaceship
|
6
9
|
class Logger
|
@@ -9,13 +12,13 @@ module Jekyll::Spaceship
|
|
9
12
|
end
|
10
13
|
|
11
14
|
def self.display_info
|
12
|
-
self.log "Jekyll-Spaceship #{Jekyll::Spaceship::VERSION}"
|
13
|
-
self.log 'A Jekyll plugin to provide powerful supports.'
|
14
|
-
self.log 'https://github.com/jeffreytse/jekyll-spaceship'
|
15
|
+
self.log "🚀 Jekyll-Spaceship #{Jekyll::Spaceship::VERSION}"
|
16
|
+
self.log '🎉 A Jekyll plugin to provide powerful supports.'
|
17
|
+
self.log '👉 ' + 'https://github.com/jeffreytse/jekyll-spaceship'.underline
|
15
18
|
end
|
16
19
|
|
17
20
|
def self.log(content)
|
18
|
-
self.output 'Jekyll Spaceship', content
|
21
|
+
self.output 'Jekyll Spaceship', content.bright
|
19
22
|
end
|
20
23
|
|
21
24
|
def self.output(title, content)
|
@@ -6,7 +6,7 @@ require __dir__ + '/type'
|
|
6
6
|
module Jekyll::Spaceship
|
7
7
|
class Manager
|
8
8
|
@@_hooks = {}
|
9
|
-
@@
|
9
|
+
@@_processors = []
|
10
10
|
|
11
11
|
def self.add(processor)
|
12
12
|
# register for listening event
|
@@ -21,8 +21,8 @@ module Jekyll::Spaceship
|
|
21
21
|
self.hook container, event
|
22
22
|
end
|
23
23
|
end
|
24
|
-
@@
|
25
|
-
@@
|
24
|
+
@@_processors.push(processor)
|
25
|
+
@@_processors = @@_processors.sort { |a, b| b.priority <=> a.priority }
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.hook(container, event, &block)
|
@@ -57,13 +57,13 @@ module Jekyll::Spaceship
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.dispatch(page, container, event)
|
60
|
-
@@
|
60
|
+
@@_processors.each do |processor|
|
61
61
|
processor.dispatch page, container, event
|
62
62
|
end
|
63
63
|
if event.to_s.start_with?('post') and Type.html? output_ext(page)
|
64
64
|
self.dispatch_html_block(page)
|
65
65
|
end
|
66
|
-
@@
|
66
|
+
@@_processors.each do |processor|
|
67
67
|
processor.on_handled if processor.handled
|
68
68
|
end
|
69
69
|
end
|
@@ -91,7 +91,7 @@ module Jekyll::Spaceship
|
|
91
91
|
next if type.nil?
|
92
92
|
|
93
93
|
# dispatch to on_handle_html_block
|
94
|
-
@@
|
94
|
+
@@_processors.each do |processor|
|
95
95
|
next unless processor.process?
|
96
96
|
content = processor.on_handle_html_block content, type
|
97
97
|
# dispatch to type handlers
|
@@ -106,7 +106,7 @@ module Jekyll::Spaceship
|
|
106
106
|
content = cvter.convert content unless cvter.nil?
|
107
107
|
|
108
108
|
# dispatch to on_handle_html
|
109
|
-
@@
|
109
|
+
@@_processors.each do |processor|
|
110
110
|
next unless processor.process?
|
111
111
|
content = processor.on_handle_html content
|
112
112
|
end
|
@@ -24,7 +24,7 @@ module Jekyll::Spaceship
|
|
24
24
|
filename = File.basename(path, '.rb')
|
25
25
|
next if filename.gsub(/-/, '').downcase != name
|
26
26
|
|
27
|
-
Logger.log "use #{filename}"
|
27
|
+
Logger.log "🗂 use #{filename}"
|
28
28
|
require path
|
29
29
|
constants = Jekyll::Spaceship.constants.select do |c|
|
30
30
|
c.downcase.to_s == name
|
@@ -113,16 +113,17 @@ module Jekyll::Spaceship
|
|
113
113
|
|
114
114
|
# handle colspan
|
115
115
|
if cell == cells.last and scope.row.colspan > 0
|
116
|
-
|
117
|
-
|
118
|
-
|
116
|
+
cells.count.downto(cells.count - scope.row.colspan + 1) do |i|
|
117
|
+
c = cells[i - 1]
|
118
|
+
return unless c.get_attribute('colspan').nil?
|
119
|
+
c.remove
|
119
120
|
end
|
120
121
|
end
|
121
122
|
|
122
|
-
result = cell.content.match(/(
|
123
|
+
result = cell.content.match(/(\|)+$/)
|
123
124
|
return if result.nil?
|
124
125
|
|
125
|
-
cell.content = cell.content.gsub(/(
|
126
|
+
cell.content = cell.content.gsub(/(\|)+$/, '')
|
126
127
|
result = result[0]
|
127
128
|
colspan = result.scan(/\|/).count
|
128
129
|
scope.row.colspan += colspan
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-spaceship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeffreytse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.6'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rainbow
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: bundler
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|