nhkore 0.3.4 → 0.3.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1db415fe5fa2d6f112fae3ef163b79ddaa88d639de565c4cb35b40fa14fb5a66
4
- data.tar.gz: c535ba1f719db2c64ba6713c21c6365f51e31361efd6046064cdf700219f30ab
3
+ metadata.gz: 4a7084fd097785a525cbe62fe59eaaa5a659c84a1673cb8663b3413b70e4e3a9
4
+ data.tar.gz: 7fd6c701cacc6bcbc2b55d8c33a1f9cefcbff36e39b2ebbb42022ce438188920
5
5
  SHA512:
6
- metadata.gz: af517bada681dc850e60f1c0e275ba35d2177dc413b076612a091217fd653bba82be725c0247c52bb1e342489fe99c731ac7f5efc0b681d54cdcbb02cdb5360b
7
- data.tar.gz: 579569f8c5201f3fe8b460281d585ac8b10c50c881d18ca6d6ff342fab0c178f0ad6e532df42200db117b0f8e85dbbace87846c85fcdd5c0c4eac1501f4b24e7
6
+ metadata.gz: e14fa1030416d99ad30c55ecb97b58135641e8008a485fe081104ab3cd177495889c3132015a8310b7aa9eee22e502e83de8378faee48c64785ed502eada4727
7
+ data.tar.gz: 16a856938c0a598122671cdf39ebaf569a9ec9d260a32f5830b9a21b1a3cf45b0940289c4136c273de1358211653ab3e250dd22bede936d312d4989edbb37cdd
data/.yardopts ADDED
@@ -0,0 +1,3 @@
1
+ --files 'CHANGELOG.md,LICENSE.txt'
2
+ --protected
3
+ --readme 'README.md'
data/CHANGELOG.md CHANGED
@@ -1,8 +1,80 @@
1
1
  # Changelog | NHKore
2
2
 
3
- Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ Format is based on [Keep a Changelog v1.0.0](https://keepachangelog.com/en/1.0.0),
6
+ and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [[Unreleased]](https://github.com/esotericpig/nhkore/compare/v0.3.9...HEAD)
9
+ -
10
+
11
+
12
+ ## [v0.3.9] - 2021-06-26
13
+
14
+ ### Fixed
15
+ - Reverted `App#refresh_cmd()` back to not copying over the `default_proc` (from v0.3.8). Because the old code didn't know about this, it created some unintended issues with command options. Nothing major, but for example, specifying `output.html` with the `sift` command would not produce HTML output (however, using the `-e html` option still worked). This is the only instance that I know of, but reverting the code back in case of more instances. In the future, I'll need to thoroughly test all CLI options after changing `App#refresh_cmd()` to copy over the `default_proc`, but for now, not worrying about it (as it's not necessary).
16
+
17
+
18
+ ## [v0.3.8] - 2021-06-26
19
+
20
+ ### Fixed
21
+ - Fixed `App#refresh_cmd()` to also copy Cri's `default_proc` to the new Hash for the command options.
22
+ - Fixed to check for non-strings for JSON & URI.
23
+ - For JSON, convert `StringIO` to string in `DictScraper.scrape()`.
24
+ - For URL, convert URL using `URI()` because `URI.parse()` will crash with a non-string (URI object) in `Scraper.open_url()`.
25
+ - Fixed to scrape multiple HTML Ruby tag words (instead of just 1).
26
+ - I thought multiple Ruby bases/texts (`<rb>`/`<rt>`) were invalid, but after running into the article below and checking the HTML with a validator, it's actually valid HTML:
27
+ - https://www3.nhk.or.jp/news/easy/k10012759201000/k10012759201000.html
28
+ - No previous articles/URLs ran into this problem (would have raised an error), so it should only be a problem with this specific, new article.
29
+
30
+ ### Changed
31
+ - Formatted/Linted all code using RuboCop.
32
+ - Updated Gems.
33
+
34
+
35
+ ## [v0.3.7] - 2020-11-07
36
+
37
+ ### Changed
38
+ - Updated Gem `attr_bool` to v0.2
39
+ - Changed upper-case *'-V'* flag for *version* to be a lower-case *'-v'*
40
+ - Seems like a lot of apps/people expect this
41
+ - Refactored/Formatted some code
42
+ - *nhkore.gemspec* especially
43
+ - Added *samples/*, *Gemfile.lock*, and *.yardopts* to the files in *nhkore.gemspec*
44
+
45
+ ### Fixed
46
+ - ArticleScraper
47
+ - Fixed to accept text nodes that have Kanji, due to bad article:
48
+ - https://www3.nhk.or.jp/news/easy/k10012639271000/k10012639271000.html
49
+ - `第3のビール` should have HTML ruby tags around *第*
50
+
51
+
52
+ ## [v0.3.6] - 2020-08-18
53
+
54
+ ### Added
55
+ - `update_showcase` Rake task for development & personal site (GitHub Page)
56
+ - `$ bundle exec rake update_showcase`
57
+
58
+ ### Changed
59
+ - Updated Gems
60
+
61
+ ### Fixed
62
+ - ArticleScraper for title for specific site
63
+ - https://www3.nhk.or.jp/news/easy/article/disaster_earthquake_illust.html
64
+ - Ignored `/cgi2.*enqform/` URLs from SearchScraper (Bing)
65
+ - Added more detail to dictionary error in ArticleScraper
66
+
67
+
68
+ ## [v0.3.5] - 2020-05-04
69
+
70
+ ### Added
71
+ - Added check for environment var `NO_COLOR`
72
+ - [https://no-color.org/](https://no-color.org/)
73
+
74
+ ### Fixed
75
+ - Fixed URLs stored in YAML data to always be of type String (not URI)
76
+ - This initially caused a problem in DictScraper.parse_url() from ArticleScraper, but fixed it for all data
4
77
 
5
- ## [[Unreleased]](https://github.com/esotericpig/nhkore/compare/v0.3.4...master)
6
78
 
7
79
  ## [v0.3.4] - 2020-04-25
8
80
 
@@ -25,12 +97,14 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
25
97
  - `-d '3-3'`
26
98
  - `-d '3'`
27
99
 
100
+
28
101
  ## [v0.3.3] - 2020-04-23
29
102
 
30
103
  ### Added
31
104
  - Added JSON support to Sifter & SiftCmd.
32
105
  - Added use of `attr_bool` Gem for `attr_accessor?` & `attr_reader?`.
33
106
 
107
+
34
108
  ## [v0.3.2] - 2020-04-22
35
109
 
36
110
  ### Added
@@ -54,6 +128,7 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
54
128
  - ArticleScraper
55
129
  - Renamed `mode` param to `strict`. `mode` was overshadowing File.open()'s in Scraper.
56
130
 
131
+
57
132
  ## [v0.3.1] - 2020-04-20
58
133
 
59
134
  ### Changed
@@ -71,6 +146,7 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
71
146
  - BingScraper
72
147
  - Fixed possible RSS infinite loop.
73
148
 
149
+
74
150
  ## [v0.3.0] - 2020-04-12
75
151
 
76
152
  ### Added
@@ -105,7 +181,9 @@ Format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
105
181
  - ignore empty filenames in the Zip for safety.
106
182
  - ask to overwrite files instead of erroring.
107
183
 
184
+
108
185
  ## [v0.2.0] - 2020-04-01
186
+
109
187
  First working version.
110
188
 
111
189
  ### Added
@@ -141,7 +219,9 @@ First working version.
141
219
  - test/nhkore_tester.rb
142
220
  - Renamed to `test/nhkore/test_helper.rb`
143
221
 
222
+
144
223
  ## [v0.1.0] - 2020-02-24
224
+
145
225
  ### Added
146
226
  - .gitignore
147
227
  - CHANGELOG.md
data/Gemfile CHANGED
@@ -1,24 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- #--
5
- # This file is part of NHKore.
6
- # Copyright (c) 2020 Jonathan Bradley Whited (@esotericpig)
7
- #
8
- # NHKore is free software: you can redistribute it and/or modify
9
- # it under the terms of the GNU Lesser General Public License as published by
10
- # the Free Software Foundation, either version 3 of the License, or
11
- # (at your option) any later version.
12
- #
13
- # NHKore is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Lesser General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU Lesser General Public License
19
- # along with NHKore. If not, see <https://www.gnu.org/licenses/>.
20
- #++
21
-
22
4
 
23
5
  source 'https://rubygems.org'
24
6
 
data/Gemfile.lock ADDED
@@ -0,0 +1,89 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ nhkore (0.3.9)
5
+ attr_bool (~> 0.2)
6
+ bimyou_segmenter (~> 1.2)
7
+ cri (~> 2.15)
8
+ down (~> 5.2)
9
+ highline (~> 2.0)
10
+ http-cookie (~> 1.0)
11
+ japanese_deinflector (~> 0.0)
12
+ nokogiri (~> 1.11)
13
+ psychgus (~> 1.3)
14
+ public_suffix (~> 4.0)
15
+ rainbow (~> 3.0)
16
+ rubyzip (~> 2.3)
17
+ tiny_segmenter (~> 0.0)
18
+ tty-progressbar (~> 0.18)
19
+ tty-spinner (~> 0.9)
20
+
21
+ GEM
22
+ remote: https://rubygems.org/
23
+ specs:
24
+ addressable (2.7.0)
25
+ public_suffix (>= 2.0.2, < 5.0)
26
+ attr_bool (0.2.2)
27
+ bimyou_segmenter (1.2.0)
28
+ cri (2.15.11)
29
+ domain_name (0.5.20190701)
30
+ unf (>= 0.0.5, < 1.0.0)
31
+ down (5.2.2)
32
+ addressable (~> 2.5)
33
+ highline (2.0.3)
34
+ http-cookie (1.0.4)
35
+ domain_name (~> 0.5)
36
+ japanese_deinflector (0.0.2)
37
+ mini_portile2 (2.5.3)
38
+ minitest (5.14.4)
39
+ nokogiri (1.11.7)
40
+ mini_portile2 (~> 2.5.0)
41
+ racc (~> 1.4)
42
+ psych (4.0.1)
43
+ psychgus (1.3.4)
44
+ psych (>= 3.0)
45
+ public_suffix (4.0.6)
46
+ racc (1.5.2)
47
+ rainbow (3.0.0)
48
+ rake (13.0.3)
49
+ raketeer (0.2.13)
50
+ rake
51
+ rdoc (6.3.1)
52
+ redcarpet (3.5.1)
53
+ rubyzip (2.3.0)
54
+ strings-ansi (0.2.0)
55
+ tiny_segmenter (0.0.6)
56
+ tty-cursor (0.7.1)
57
+ tty-progressbar (0.18.2)
58
+ strings-ansi (~> 0.2)
59
+ tty-cursor (~> 0.7)
60
+ tty-screen (~> 0.8)
61
+ unicode-display_width (>= 1.6, < 3.0)
62
+ tty-screen (0.8.1)
63
+ tty-spinner (0.9.3)
64
+ tty-cursor (~> 0.7)
65
+ unf (0.1.4)
66
+ unf_ext
67
+ unf_ext (0.0.7.7)
68
+ unicode-display_width (2.0.0)
69
+ yard (0.9.26)
70
+ yard_ghurt (1.2.1)
71
+ rake
72
+ yard
73
+
74
+ PLATFORMS
75
+ ruby
76
+
77
+ DEPENDENCIES
78
+ bundler (~> 2.2)
79
+ minitest (~> 5.14)
80
+ nhkore!
81
+ rake (~> 13.0)
82
+ raketeer (~> 0.2)
83
+ rdoc (~> 6.3)
84
+ redcarpet (~> 3.5)
85
+ yard (~> 0.9)
86
+ yard_ghurt (~> 1.2)
87
+
88
+ BUNDLED WITH
89
+ 2.2.20
data/README.md CHANGED
@@ -435,18 +435,18 @@ require 'nhkore/scraper'
435
435
  s = NHKore::Scraper.new('https://www3.nhk.or.jp/news/easy/',
436
436
  open_timeout: 300, # Open timeout in seconds (default: nil)
437
437
  read_timeout: 300, # Read timeout in seconds (default: nil)
438
-
438
+
439
439
  # Maximum number of times to retry the URL
440
440
  # - default: 3
441
441
  # - Open/connect will fail a couple of times on a bad/slow internet connection.
442
442
  max_retries: 10,
443
-
443
+
444
444
  # Maximum number of redirects allowed.
445
445
  # - default: 3
446
446
  # - You can set this to nil or -1, but I recommend using a number
447
447
  # for safety (infinite-loop attack).
448
448
  max_redirects: 1,
449
-
449
+
450
450
  # How to check redirect URLs for safety.
451
451
  # - default: :strict
452
452
  # - nil => do not check
@@ -455,7 +455,7 @@ s = NHKore::Scraper.new('https://www3.nhk.or.jp/news/easy/',
455
455
  # - :strict => check the scheme and domain
456
456
  # (i.e., if https://bing.com, redirect URL must be https://bing.com)
457
457
  redirect_rule: :lenient,
458
-
458
+
459
459
  # Set the HTTP header field 'cookie' from the 'set-cookie' response.
460
460
  # - default: false
461
461
  # - Currently uses the 'http-cookie' Gem.
@@ -463,7 +463,7 @@ s = NHKore::Scraper.new('https://www3.nhk.or.jp/news/easy/',
463
463
  # - Necessary for Search Engines or other sites that require cookies
464
464
  # in order to block bots.
465
465
  eat_cookie: true,
466
-
466
+
467
467
  # Set HTTP header fields.
468
468
  # - default: nil
469
469
  # - Necessary for Search Engines or other sites that try to block bots.
@@ -526,9 +526,9 @@ doc = ss.html_doc()
526
526
 
527
527
  doc.css('a').each() do |anchor|
528
528
  link = anchor['href']
529
-
529
+
530
530
  next if ss.ignore_link?(link,cleaned: false)
531
-
531
+
532
532
  if link.include?('https://www3.nhk')
533
533
  puts link
534
534
  end
@@ -549,9 +549,9 @@ page_num = 1
549
549
 
550
550
  while !next_page.empty?()
551
551
  puts "Page #{page_num += 1}: #{next_page.count}"
552
-
552
+
553
553
  bs = NHKore::BingScraper.new(:yasashii,url: next_page.url)
554
-
554
+
555
555
  next_page = bs.scrape(slinks,next_page)
556
556
  end
557
557
 
@@ -570,24 +570,24 @@ require 'time'
570
570
 
571
571
  as = NHKore::ArticleScraper.new(
572
572
  'https://www3.nhk.or.jp/news/easy/k10011862381000/k10011862381000.html',
573
-
573
+
574
574
  # If false, scrape the article leniently (for older articles which
575
575
  # may not have certain tags, etc.).
576
576
  # - default: true
577
577
  strict: false,
578
-
578
+
579
579
  # {Dict} to use as the dictionary for words (Easy articles).
580
580
  # - default: :scrape
581
581
  # - nil => don't scrape/use it (necessary for Regular articles)
582
582
  # - :scrape => auto-scrape it using {DictScraper}
583
583
  # - {Dict} => your own {Dict}
584
584
  dict: nil,
585
-
585
+
586
586
  # Date time to use as a fallback if the article doesn't have one
587
587
  # (for older articles).
588
588
  # - default: nil
589
589
  datetime: Time.new(2020,2,2),
590
-
590
+
591
591
  # Year to use as a fallback if the article doesn't have one
592
592
  # (for older articles).
593
593
  # - default: nil
@@ -624,7 +624,7 @@ require 'nhkore/dict_scraper'
624
624
  url = 'https://www3.nhk.or.jp/news/easy/k10011862381000/k10011862381000.html'
625
625
  ds = NHKore::DictScraper.new(
626
626
  url,
627
-
627
+
628
628
  # Change the URL appropriately to the dictionary URL.
629
629
  # - default: true
630
630
  parse_url: true,
@@ -637,13 +637,13 @@ dict = ds.scrape()
637
637
 
638
638
  dict.entries.each() do |key,entry|
639
639
  entry.id
640
-
640
+
641
641
  entry.defns.each() do |defn|
642
642
  defn.hyoukis.each() {|hyouki| }
643
643
  defn.text
644
644
  defn.words.each() {|word| }
645
645
  end
646
-
646
+
647
647
  puts entry.build_hyouki()
648
648
  puts entry.build_defn()
649
649
  puts '---'
@@ -789,13 +789,13 @@ JPN = ['桜','ぶ','ブ']
789
789
 
790
790
  def fmt_jpn()
791
791
  fmt = []
792
-
792
+
793
793
  JPN.each() do |x|
794
794
  x = yield(x)
795
795
  x = x ? "\u2B55" : Util::JPN_SPACE unless x.is_a?(String)
796
796
  fmt << x
797
797
  end
798
-
798
+
799
799
  return "[ #{fmt.join(' | ')} ]"
800
800
  end
801
801
 
@@ -870,12 +870,16 @@ This will update *core/* for you:
870
870
  - *Raketary*: `$ raketary github_pkg`
871
871
  7. Run: `$ bundle exec rake release`
872
872
 
873
+ Releasing new HTML file for website:
874
+
875
+ 1. `$ bundle exec rake update_showcase`
876
+
873
877
  ## License [^](#contents)
874
878
 
875
879
  [GNU LGPL v3+](LICENSE.txt)
876
880
 
877
881
  > NHKore (<https://github.com/esotericpig/nhkore>)
878
- > Copyright (c) 2020 Jonathan Bradley Whited (@esotericpig)
882
+ > Copyright (c) 2020-2021 Jonathan Bradley Whited
879
883
  >
880
884
  > NHKore is free software: you can redistribute it and/or modify
881
885
  > it under the terms of the GNU Lesser General Public License as published by
data/Rakefile CHANGED
@@ -1,24 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- #--
5
- # This file is part of NHKore.
6
- # Copyright (c) 2020 Jonathan Bradley Whited (@esotericpig)
7
- #
8
- # NHKore is free software: you can redistribute it and/or modify
9
- # it under the terms of the GNU Lesser General Public License as published by
10
- # the Free Software Foundation, either version 3 of the License, or
11
- # (at your option) any later version.
12
- #
13
- # NHKore is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Lesser General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU Lesser General Public License
19
- # along with NHKore. If not, see <https://www.gnu.org/licenses/>.
20
- #++
21
-
22
4
 
23
5
  require 'bundler/gem_tasks'
24
6
 
@@ -35,31 +17,31 @@ require 'nhkore/version'
35
17
 
36
18
  PKG_DIR = 'pkg'
37
19
 
38
- CLEAN.exclude('.git/','stock/')
20
+ CLEAN.exclude('{.git,core,stock}/**/*')
39
21
  CLOBBER.include('doc/',File.join(PKG_DIR,''))
40
22
 
41
23
 
42
24
  task default: [:test]
43
25
 
44
26
  desc 'Generate documentation (YARDoc)'
45
- task :doc => [:yard,:yard_gfm_fix] do |task|
27
+ task doc: %i[yard yard_gfm_fix] do |task|
46
28
  end
47
29
 
48
30
  desc "Package '#{File.join(NHKore::Util::CORE_DIR,'')}' data as a Zip file into '#{File.join(PKG_DIR,'')}'"
49
31
  task :pkg_core do |task|
50
32
  mkdir_p PKG_DIR
51
-
33
+
52
34
  pattern = File.join(NHKore::Util::CORE_DIR,'*.{csv,html,json,yml}')
53
35
  zip_file = File.join(PKG_DIR,'nhkore-core.zip')
54
-
55
- sh 'zip','-9rv',zip_file,*Dir.glob(pattern).sort()
36
+
37
+ sh 'zip','-9rv',zip_file,*Dir.glob(pattern).sort
56
38
  end
57
39
 
58
- Rake::TestTask.new() do |task|
40
+ Rake::TestTask.new do |task|
59
41
  task.libs = ['lib','test']
60
42
  task.pattern = File.join('test','**','*_test.rb')
61
43
  task.description += ": '#{task.pattern}'"
62
- task.verbose = true
44
+ task.verbose = false
63
45
  task.warning = true
64
46
  end
65
47
 
@@ -68,58 +50,77 @@ end
68
50
  desc "Update '#{File.join(NHKore::Util::CORE_DIR,'')}' files for release"
69
51
  task :update_core do |task|
70
52
  require 'highline'
71
-
72
- CONTINUE_MSG = "\nContinue (y/n)? "
73
-
53
+
54
+ continue_msg = "\nContinue (y/n)? "
55
+
74
56
  cmd = ['ruby','-w','./lib/nhkore.rb','-t','300','-m','10']
75
- hl = HighLine.new()
76
-
57
+ hl = HighLine.new
58
+
77
59
  next unless sh(*cmd,'se','ez','bing')
78
- next unless hl.agree(CONTINUE_MSG)
60
+ next unless hl.agree(continue_msg)
79
61
  puts
80
-
81
- next unless sh(*cmd,'news','-s','100','ez')
82
- next unless hl.agree(CONTINUE_MSG)
62
+
63
+ next unless sh(*cmd,'news','-s','500','ez')
64
+ next unless hl.agree(continue_msg)
83
65
  puts
84
-
66
+
85
67
  next unless sh(*cmd,'sift','-e','csv' ,'ez')
68
+ puts
86
69
  next unless sh(*cmd,'sift','-e','html','ez')
70
+ puts
87
71
  next unless sh(*cmd,'sift','-e','json','ez')
72
+ puts
88
73
  next unless sh(*cmd,'sift','-e','yml' ,'ez')
74
+ puts
89
75
  end
90
76
 
91
- YARD::Rake::YardocTask.new() do |task|
92
- task.files = [File.join('lib','**','*.rb')]
93
-
94
- task.options += ['--files','CHANGELOG.md,LICENSE.txt']
95
- task.options += ['--readme','README.md']
96
-
97
- task.options << '--protected' # Show protected methods
77
+ # @since 0.3.6
78
+ desc 'Update showcase file for release'
79
+ task :update_showcase do |task|
80
+ require 'highline'
81
+
82
+ showcase_file = File.join('.','nhkore-ez.html')
83
+
84
+ hl = HighLine.new
85
+
86
+ next unless sh('ruby','-w','./lib/nhkore.rb',
87
+ 'sift','ez','--no-eng',
88
+ '--out',showcase_file,
89
+ )
90
+
91
+ next unless hl.agree("\nMove the file (y/n)? ")
92
+ puts
93
+ next unless sh('mv','-iv',showcase_file,
94
+ File.join('..','esotericpig.github.io','showcase',''),
95
+ )
96
+ end
97
+
98
+ YARD::Rake::YardocTask.new do |task|
98
99
  task.options += ['--template-path',File.join('yard','templates')]
99
100
  task.options += ['--title',"NHKore v#{NHKore::VERSION} Doc"]
100
101
  end
101
102
 
102
103
  # Execute "rake yard_gfm_fix" for production.
103
104
  # Execute "rake yard_gfm_fix[true]" for testing locally.
104
- YardGhurt::GFMFixTask.new() do |task|
105
+ YardGhurt::GFMFixTask.new do |task|
105
106
  task.arg_names = [:dev]
106
107
  task.dry_run = false
107
108
  task.fix_code_langs = true
108
109
  task.md_files = ['index.html']
109
-
110
- task.before = Proc.new() do |task,args|
110
+
111
+ task.before = proc do |t,args|
111
112
  # Delete this file as it's never used (index.html is an exact copy).
112
- YardGhurt::Util.rm_exist(File.join(task.doc_dir,'file.README.html'))
113
-
113
+ YardGhurt::Util.rm_exist(File.join(t.doc_dir,'file.README.html'))
114
+
114
115
  # Root dir of my GitHub Page for CSS/JS.
115
- GHP_ROOT = YardGhurt::Util.to_bool(args.dev) ? '../../esotericpig.github.io' : '../../..'
116
-
117
- task.css_styles << %Q(<link rel="stylesheet" type="text/css" href="#{GHP_ROOT}/css/prism.css" />)
118
- task.js_scripts << %Q(<script src="#{GHP_ROOT}/js/prism.js"></script>)
116
+ ghp_root = YardGhurt::Util.to_bool(args.dev) ? '../../esotericpig.github.io' : '../../..'
117
+
118
+ t.css_styles << %Q(<link rel="stylesheet" type="text/css" href="#{ghp_root}/css/prism.css" />)
119
+ t.js_scripts << %Q(<script src="#{ghp_root}/js/prism.js"></script>)
119
120
  end
120
121
  end
121
122
 
122
123
  # Probably not useful for others.
123
- YardGhurt::GHPSyncTask.new() do |task|
124
+ YardGhurt::GHPSyncTask.new do |task|
124
125
  task.ghp_dir = '../esotericpig.github.io/docs/nhkore/yardoc'
125
126
  end