nhkore 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
data/samples/looper.rb CHANGED
@@ -4,28 +4,17 @@
4
4
 
5
5
  #--
6
6
  # This file is part of NHKore.
7
- # Copyright (c) 2020 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # NHKore is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # NHKore is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with NHKore. If not, see <https://www.gnu.org/licenses/>.
7
+ # Copyright (c) 2020-2021 Jonathan Bradley Whited
8
+ #
9
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
10
  #++
22
11
 
23
12
 
24
13
  ###
25
14
  # If you run this script, be aware that it uses the +-F+ force option
26
15
  # (which overwrites files without prompting).
27
- #
28
- # @author Jonathan Bradley Whited (@esotericpig)
16
+ #
17
+ # @author Jonathan Bradley Whited
29
18
  # @since 0.3.2
30
19
  ###
31
20
 
@@ -33,10 +22,10 @@ case ARGV[0]
33
22
  when '-c' # count
34
23
  system('nhkore search ez --show-count')
35
24
  puts
36
- puts %q{Use the first number with the '-a' option.}
25
+ puts "Use the first number with the '-a' option."
37
26
  exit
38
27
  when '-a' # articles
39
- articles = ARGV[1].to_i()
28
+ articles = ARGV[1].to_i
40
29
  articles = 0 if articles < 0
41
30
  else
42
31
  puts 'Options:'
@@ -49,34 +38,34 @@ articles_inc = 25
49
38
  max_errors = 5 # Exit, for example, if 404 errors repeatedly
50
39
  max_loop = 5 # Possible total = articles_inc * max_loop
51
40
 
52
- thread = Thread.new() do
41
+ thread = Thread.new do
53
42
  i = 0
54
-
43
+
55
44
  while i < max_loop
56
45
  puts "Loop #{i += 1} => #{articles} articles"
57
-
46
+
58
47
  if system("nhkore -F -t 300 -m 10 news ez -s #{articles_inc}")
59
48
  articles += articles_inc
60
- else
61
- break if (max_errors -= 1) <= 0
49
+ elsif (max_errors -= 1) <= 0
50
+ break
62
51
  end
63
-
52
+
64
53
  puts
65
54
  end
66
55
  end
67
56
 
68
57
  # Ctrl+C
69
58
  trap('INT') do
70
- if thread.alive?()
59
+ if thread.alive?
71
60
  # Try to exit gracefully.
72
61
  max_loop = -1
73
62
  thread.join(5)
74
-
63
+
75
64
  # Die!
76
- thread.kill() if thread.alive?()
65
+ thread.kill if thread.alive?
77
66
  end
78
-
67
+
79
68
  exit
80
69
  end
81
70
 
82
- thread.join() # Run
71
+ thread.join # Run
@@ -1,23 +1,11 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of NHKore.
7
- # Copyright (c) 2020 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # NHKore is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # NHKore is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with NHKore. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2020-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
data/test/nhkore_test.rb CHANGED
@@ -1,23 +1,11 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of NHKore.
7
- # Copyright (c) 2020 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # NHKore is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # NHKore is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with NHKore. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2020-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: LGPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -26,10 +14,10 @@ require 'nhkore/test_helper'
26
14
 
27
15
  module NHKore
28
16
  class NHKoreTest < TestHelper
29
- def setup()
17
+ def setup
30
18
  end
31
-
32
- def test_something()
19
+
20
+ def test_something
33
21
  end
34
22
  end
35
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nhkore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
- - Jonathan Bradley Whited (@esotericpig)
8
- autorequire:
7
+ - Jonathan Bradley Whited
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-07 00:00:00.000000000 Z
11
+ date: 2021-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attr_bool
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '5.1'
61
+ version: '5.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '5.1'
68
+ version: '5.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: highline
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.10'
117
+ version: '1.11'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.10'
124
+ version: '1.11'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: psychgus
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '0.17'
201
+ version: '0.18'
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '0.17'
208
+ version: '0.18'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: tty-spinner
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '2.1'
229
+ version: '2.2'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '2.1'
236
+ version: '2.2'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: minitest
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -282,14 +282,14 @@ dependencies:
282
282
  requirements:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: '6.2'
285
+ version: '6.3'
286
286
  type: :development
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
- version: '6.2'
292
+ version: '6.3'
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: redcarpet
295
295
  requirement: !ruby/object:Gem::Requirement
@@ -335,7 +335,7 @@ dependencies:
335
335
  description: Scrapes NHK News Web (Easy) for the word frequency (core list) for Japanese
336
336
  language learners. Includes a CLI app and a scraper library.
337
337
  email:
338
- - bradley@esotericpig.com
338
+ - code@esotericpig.com
339
339
  executables:
340
340
  - nhkore
341
341
  extensions: []
@@ -396,16 +396,24 @@ metadata:
396
396
  source_code_uri: https://github.com/esotericpig/nhkore
397
397
  bug_tracker_uri: https://github.com/esotericpig/nhkore/issues
398
398
  changelog_uri: https://github.com/esotericpig/nhkore/blob/master/CHANGELOG.md
399
- post_install_message: " \n NHKore v0.3.7\n \n You can now use [nhkore] on the
400
- command line.\n \n Homepage: https://github.com/esotericpig/nhkore\n \n Code:
401
- \ https://github.com/esotericpig/nhkore\n Bugs: https://github.com/esotericpig/nhkore/issues\n
402
- \ \n Changelog: https://github.com/esotericpig/nhkore/blob/master/CHANGELOG.md\n
403
- \ \n"
399
+ post_install_message: |2+
400
+
401
+ NHKore v0.3.8
402
+
403
+ You can now use [nhkore] on the command line.
404
+
405
+ Homepage: https://github.com/esotericpig/nhkore
406
+
407
+ Code: https://github.com/esotericpig/nhkore
408
+ Bugs: https://github.com/esotericpig/nhkore/issues
409
+
410
+ Changelog: https://github.com/esotericpig/nhkore/blob/master/CHANGELOG.md
411
+
404
412
  rdoc_options:
405
413
  - "--hyperlink-all"
406
414
  - "--show-hash"
407
415
  - "--title"
408
- - NHKore v0.3.7 Doc
416
+ - NHKore v0.3.8 Doc
409
417
  - "--main"
410
418
  - README.md
411
419
  require_paths:
@@ -414,7 +422,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
414
422
  requirements:
415
423
  - - ">="
416
424
  - !ruby/object:Gem::Version
417
- version: '2.4'
425
+ version: '2.5'
418
426
  required_rubygems_version: !ruby/object:Gem::Requirement
419
427
  requirements:
420
428
  - - ">="
@@ -422,8 +430,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
422
430
  version: '0'
423
431
  requirements:
424
432
  - 'Nokogiri: https://www.nokogiri.org/tutorials/installing_nokogiri.html'
425
- rubygems_version: 3.1.2
426
- signing_key:
433
+ rubygems_version: 3.2.15
434
+ signing_key:
427
435
  specification_version: 4
428
436
  summary: NHK News Web (Easy) word frequency (core) scraper for Japanese language learners.
429
437
  test_files: []
438
+ ...