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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b6dda9b65244009d454fa6c72095dd8fa34658610dde8ee9cad0c582f1ac732
4
- data.tar.gz: c8b1899ceac36ef08fa9412f0999a05461d5d2b13b0d7344e226a3cb95afdd9c
3
+ metadata.gz: '0866a4f772232329a602ff5587b12e31bf46b7b46b814f5cec9e68726376fce1'
4
+ data.tar.gz: 36ca28bd21052cee1e014d2dc6204d01391dbac7e84b4ebd40aff6bfc1db3c0a
5
5
  SHA512:
6
- metadata.gz: d831fd2d681490b0b05ccec15d055fe9b9e2c5526f0d9ca7a0280e43755ea4352bb29815177edc502d80d83f8abfbb52229e84adb8b237b2f6260cd87e25d312
7
- data.tar.gz: 51c92e90a7a70f5bd4b45b32f5c3b6e2478babc30402c6eabe1b24e95a8ac3451a33c5b9291507487391879e6c0e81adc98879aefaa124939a401a19eea1d1fc
6
+ metadata.gz: 4639cf60bf80214be476d933e79218b3041d44b13f660801731044fd5f4f28ed128a996618e899f0ad7fe7d61dc7d11c16cf7f0df11e6f51ec2979155666031e
7
+ data.tar.gz: 847b84194aa7a1aa254f7f2c1e1fa0684283e7bebe29ae4bf49eebe65e387f4d7e1fe308da45feb7640f48502c88085bd2c92aa1d92d8c93f7c5a631cacbd0ad
@@ -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[0], '記事・ニュースのコーナー')
46
- @title = set_header_item(h[1], 'タイトル' )
47
- @lead = set_header_item(h[2], 'nil')
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(target, default)
57
- if /\A\ufeff?[\-%]+\Z/ =~ target || target.nil?
58
- default.define_singleton_method(:is_complete?){ false }
59
- default
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
- target.define_singleton_method(:is_complete?){ true }
62
- target
58
+ value = yield if block_given?
59
+ value.define_singleton_method(:is_complete?){ true }
60
+ value
63
61
  end
64
62
  end
65
63
 
@@ -1,3 +1,3 @@
1
1
  module ZineBrewer
2
- VERSION = "1.12.2"
2
+ VERSION = "1.13.0"
3
3
  end
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.12.2
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 00:00:00.000000000 Z
11
+ date: 2022-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mustache