unclekryon 0.4.9.pre.alpha → 0.4.12.pre.alpha

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +10 -26
  3. data/Gemfile.lock +20 -24
  4. data/README.md +3 -2
  5. data/Rakefile +11 -30
  6. data/bin/unclekryon +4 -15
  7. data/hax/kryon.yaml +28 -0
  8. data/hax/kryon_aums_2002-2005.yaml +460 -0
  9. data/hax/kryon_aums_2006.yaml +601 -0
  10. data/hax/kryon_aums_2007.yaml +1024 -0
  11. data/hax/kryon_aums_2008.yaml +950 -0
  12. data/hax/kryon_aums_2009.yaml +496 -0
  13. data/hax/kryon_aums_2010.yaml +1443 -0
  14. data/hax/kryon_aums_2011.yaml +1458 -0
  15. data/hax/kryon_aums_2012.yaml +2123 -0
  16. data/hax/kryon_aums_2013.yaml +1647 -0
  17. data/hax/kryon_aums_2014.yaml +2478 -0
  18. data/hax/kryon_aums_2015.yaml +3386 -0
  19. data/hax/kryon_aums_2016.yaml +3476 -0
  20. data/hax/kryon_aums_2017.yaml +3712 -0
  21. data/hax/kryon_aums_2018.yaml +3654 -0
  22. data/lib/unclekryon/data/album_data.rb +74 -82
  23. data/lib/unclekryon/data/artist_data.rb +24 -36
  24. data/lib/unclekryon/data/artist_data_data.rb +29 -41
  25. data/lib/unclekryon/data/aum_data.rb +20 -32
  26. data/lib/unclekryon/data/base_data.rb +27 -39
  27. data/lib/unclekryon/data/pic_data.rb +25 -37
  28. data/lib/unclekryon/data/release_data.rb +14 -26
  29. data/lib/unclekryon/data/social_data.rb +6 -18
  30. data/lib/unclekryon/data/timespan_data.rb +16 -28
  31. data/lib/unclekryon/dev_opts.rb +7 -19
  32. data/lib/unclekryon/hacker.rb +121 -135
  33. data/lib/unclekryon/iso/base_iso.rb +69 -81
  34. data/lib/unclekryon/iso/can_prov_terr.rb +34 -47
  35. data/lib/unclekryon/iso/country.rb +34 -51
  36. data/lib/unclekryon/iso/language.rb +84 -98
  37. data/lib/unclekryon/iso/region.rb +8 -29
  38. data/lib/unclekryon/iso/subregion.rb +8 -29
  39. data/lib/unclekryon/iso/usa_state.rb +28 -41
  40. data/lib/unclekryon/iso.rb +128 -138
  41. data/lib/unclekryon/jsoner.rb +31 -50
  42. data/lib/unclekryon/log.rb +34 -46
  43. data/lib/unclekryon/parsers/kryon_aum_year_album_parser.rb +163 -167
  44. data/lib/unclekryon/parsers/kryon_aum_year_parser.rb +122 -127
  45. data/lib/unclekryon/server.rb +8 -17
  46. data/lib/unclekryon/trainer.rb +68 -85
  47. data/lib/unclekryon/uploader.rb +8 -17
  48. data/lib/unclekryon/util.rb +80 -92
  49. data/lib/unclekryon/version.rb +4 -16
  50. data/lib/unclekryon.rb +166 -166
  51. data/train/kryon.yaml +6077 -0
  52. data/unclekryon.gemspec +49 -49
  53. metadata +50 -22
@@ -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 UncleKryon-server.
7
- # Copyright (c) 2017-2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # UncleKryon-server is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU 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
- # UncleKryon-server 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 General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU General Public License
20
- # along with UncleKryon-server. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2017-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: GPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -27,49 +15,49 @@ module UncleKryon
27
15
  class PicData < BaseData
28
16
  attr_accessor :name
29
17
  attr_accessor :filename
30
-
18
+
31
19
  attr_accessor :alt
32
20
  attr_accessor :caption
33
-
21
+
34
22
  attr_accessor :url
35
23
  attr_accessor :mirrors
36
-
37
- def initialize()
24
+
25
+ def initialize
38
26
  super()
39
-
27
+
40
28
  @name = ''
41
29
  @filename = ''
42
-
30
+
43
31
  @alt = ''
44
32
  @caption = ''
45
-
33
+
46
34
  @url = ''
47
35
  @mirrors = {}
48
36
  end
49
-
37
+
50
38
  # Excludes @updated_on
51
- def ==(y)
52
- return @name == y.name &&
53
- @filename == y.filename &&
54
- @alt == y.alt &&
55
- @caption == y.caption &&
56
- @url == y.url &&
57
- @mirrors == y.mirrors
39
+ def ==(other)
40
+ return @name == other.name &&
41
+ @filename == other.filename &&
42
+ @alt == other.alt &&
43
+ @caption == other.caption &&
44
+ @url == other.url &&
45
+ @mirrors == other.mirrors
58
46
  end
59
-
60
- def to_s()
61
- s = ''.dup()
62
-
63
- if @name.empty?() || @name.strip().empty?()
47
+
48
+ def to_s
49
+ s = ''.dup
50
+
51
+ if @name.empty? || @name.strip.empty?
64
52
  s << ('%-100s' % [@url])
65
53
  else
66
54
  s << ('%-30s' % [@name])
67
55
  s << (' | %30s' % [@filename]) unless @name == @filename
68
-
56
+
69
57
  s << (' | %30s' % [@alt]) unless @name == @alt
70
58
  s << (' | %60s' % [@caption])
71
59
  end
72
-
60
+
73
61
  return s
74
62
  end
75
63
  end
@@ -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 UncleKryon-server.
7
- # Copyright (c) 2017-2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # UncleKryon-server is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU 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
- # UncleKryon-server 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 General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU General Public License
20
- # along with UncleKryon-server. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2017-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: GPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -26,31 +14,31 @@ require 'unclekryon/data/base_data'
26
14
  module UncleKryon
27
15
  class ReleaseData < BaseData
28
16
  attr_accessor :title
29
-
17
+
30
18
  attr_accessor :url
31
19
  attr_accessor :mirrors
32
-
20
+
33
21
  attr_accessor :albums
34
-
35
- def initialize()
22
+
23
+ def initialize
36
24
  super()
37
-
25
+
38
26
  @title = ''
39
-
27
+
40
28
  @url = ''
41
29
  @mirrors = {}
42
-
30
+
43
31
  @albums = []
44
32
  end
45
-
46
- def to_mini_s()
33
+
34
+ def to_mini_s
47
35
  return to_s(true)
48
36
  end
49
-
37
+
50
38
  def to_s(mini=false)
51
39
  s = ''
52
40
  s << ('%-10s' % [@title])
53
- s << (mini ? (' | %3d' % [@albums.length()]) : ("\n- " << @albums.join("\n- ")))
41
+ s << (mini ? (' | %3d' % [@albums.length]) : ("\n- " << @albums.join("\n- ")))
54
42
  return s
55
43
  end
56
44
  end
@@ -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 UncleKryon-server.
7
- # Copyright (c) 2018-2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # UncleKryon-server is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU 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
- # UncleKryon-server 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 General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU General Public License
20
- # along with UncleKryon-server. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2018-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: GPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -28,10 +16,10 @@ module UncleKryon
28
16
  class SocialData
29
17
  attr_accessor :username
30
18
  attr_accessor :url
31
-
32
- def initialize()
19
+
20
+ def initialize
33
21
  super()
34
-
22
+
35
23
  @username = ''
36
24
  @url = ''
37
25
  end
@@ -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 UncleKryon-server.
7
- # Copyright (c) 2017-2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # UncleKryon-server is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU 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
- # UncleKryon-server 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 General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU General Public License
20
- # along with UncleKryon-server. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2017-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: GPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -30,28 +18,28 @@ module UncleKryon
30
18
  attr_accessor :hours
31
19
  attr_accessor :mins
32
20
  attr_accessor :secs
33
-
21
+
34
22
  def initialize(time=nil)
35
23
  @hours = 0
36
24
  @mins = 0
37
25
  @secs = 0
38
-
39
- if !time.nil?() && !(time = time.strip()).empty?()
26
+
27
+ if !time.nil? && !(time = time.strip).empty?
40
28
  time = time.gsub(/\A[^\(]+\(/,'') # "One hour 6 minutes - (66 minutes)"
41
29
  time = time.gsub(/[^[[:digit:]]\:\.]+/,'')
42
30
  a = time.split(/[\:\.]/)
43
-
31
+
44
32
  if a.length == 1
45
- @mins = a[0].to_i()
33
+ @mins = a[0].to_i
46
34
  elsif a.length == 2
47
- @mins = a[0].to_i()
48
- @secs = a[1].to_i()
35
+ @mins = a[0].to_i
36
+ @secs = a[1].to_i
49
37
  elsif a.length >= 3
50
- @hours = a[0].to_i()
51
- @mins = a[1].to_i()
52
- @secs = a[2].to_i()
38
+ @hours = a[0].to_i
39
+ @mins = a[1].to_i
40
+ @secs = a[2].to_i
53
41
  end
54
-
42
+
55
43
  if @secs >= 60
56
44
  @mins += (@secs / 60)
57
45
  @secs = @secs % 60
@@ -62,8 +50,8 @@ module UncleKryon
62
50
  end
63
51
  end
64
52
  end
65
-
66
- def to_s()
53
+
54
+ def to_s
67
55
  return "#{@hours}:#{@mins}:#{@secs}"
68
56
  end
69
57
  end
@@ -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 UncleKryon-server.
7
- # Copyright (c) 2018-2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # UncleKryon-server is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU 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
- # UncleKryon-server 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 General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU General Public License
20
- # along with UncleKryon-server. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2018-2021 Jonathan Bradley Whited
7
+ #
8
+ # SPDX-License-Identifier: GPL-3.0-or-later
21
9
  #++
22
10
 
23
11
 
@@ -26,14 +14,14 @@ require 'singleton'
26
14
  module UncleKryon
27
15
  class DevOpts
28
16
  include Singleton
29
-
17
+
30
18
  attr_accessor :dev
31
19
  attr_accessor :test
32
-
20
+
33
21
  alias_method :dev?,:dev
34
22
  alias_method :test?,:test
35
-
36
- def initialize()
23
+
24
+ def initialize
37
25
  @dev = false
38
26
  @test = false
39
27
  end