zine_brewer 1.12.2 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zine_brewer/main.rb +10 -12
- data/lib/zine_brewer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0866a4f772232329a602ff5587b12e31bf46b7b46b814f5cec9e68726376fce1'
|
4
|
+
data.tar.gz: 36ca28bd21052cee1e014d2dc6204d01391dbac7e84b4ebd40aff6bfc1db3c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4639cf60bf80214be476d933e79218b3041d44b13f660801731044fd5f4f28ed128a996618e899f0ad7fe7d61dc7d11c16cf7f0df11e6f51ec2979155666031e
|
7
|
+
data.tar.gz: 847b84194aa7a1aa254f7f2c1e1fa0684283e7bebe29ae4bf49eebe65e387f4d7e1fe308da45feb7640f48502c88085bd2c92aa1d92d8c93f7c5a631cacbd0ad
|
data/lib/zine_brewer/main.rb
CHANGED
@@ -42,24 +42,22 @@ module ZineBrewer
|
|
42
42
|
|
43
43
|
@article_id = $+ if header.sub!(/^■記事ID■[^0-9]+(\d+)$/, '')
|
44
44
|
h = header.strip.split(/\n\n+/)
|
45
|
-
@corner = set_header_item(h[
|
46
|
-
@
|
47
|
-
@
|
48
|
-
@pic = set_header_item(h[3], 'dummy.png')
|
49
|
-
@author = set_header_item(h[4], '著者 クレジット')
|
50
|
-
@css = set_header_item((h[5].each_line.map{|i| '.c-article_content ' + i }.join rescue nil), '')
|
45
|
+
@corner, @title, @lead, @author = [0, 1, 2, 4].map{|i| set_header_item(h[i], '')}
|
46
|
+
@pic = set_header_item(h[3], ''){ "#{@article_id}_#{h[3]}" }
|
47
|
+
@css = set_header_item(h[5], ''){ h[5].each_line.map{|i| '.c-article_content ' + i }.join }
|
51
48
|
|
52
49
|
@pp_header = make_pp_header
|
53
50
|
@converted = convert(body)
|
54
51
|
end
|
55
52
|
|
56
|
-
def set_header_item(
|
57
|
-
if /\A\ufeff?[\-%]+\Z/ =~
|
58
|
-
|
59
|
-
|
53
|
+
def set_header_item(value, alt)
|
54
|
+
if /\A\ufeff?[\-%]+\Z/ =~ value || value.nil?
|
55
|
+
alt.define_singleton_method(:is_complete?){ false }
|
56
|
+
alt
|
60
57
|
else
|
61
|
-
|
62
|
-
|
58
|
+
value = yield if block_given?
|
59
|
+
value.define_singleton_method(:is_complete?){ true }
|
60
|
+
value
|
63
61
|
end
|
64
62
|
end
|
65
63
|
|
data/lib/zine_brewer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zine_brewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori Ichigo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mustache
|