unclekryon 0.4.9.pre.alpha → 0.4.12.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -26
- data/Gemfile.lock +20 -24
- data/README.md +3 -2
- data/Rakefile +11 -30
- data/bin/unclekryon +4 -15
- data/hax/kryon.yaml +28 -0
- data/hax/kryon_aums_2002-2005.yaml +460 -0
- data/hax/kryon_aums_2006.yaml +601 -0
- data/hax/kryon_aums_2007.yaml +1024 -0
- data/hax/kryon_aums_2008.yaml +950 -0
- data/hax/kryon_aums_2009.yaml +496 -0
- data/hax/kryon_aums_2010.yaml +1443 -0
- data/hax/kryon_aums_2011.yaml +1458 -0
- data/hax/kryon_aums_2012.yaml +2123 -0
- data/hax/kryon_aums_2013.yaml +1647 -0
- data/hax/kryon_aums_2014.yaml +2478 -0
- data/hax/kryon_aums_2015.yaml +3386 -0
- data/hax/kryon_aums_2016.yaml +3476 -0
- data/hax/kryon_aums_2017.yaml +3712 -0
- data/hax/kryon_aums_2018.yaml +3654 -0
- data/lib/unclekryon/data/album_data.rb +74 -82
- data/lib/unclekryon/data/artist_data.rb +24 -36
- data/lib/unclekryon/data/artist_data_data.rb +29 -41
- data/lib/unclekryon/data/aum_data.rb +20 -32
- data/lib/unclekryon/data/base_data.rb +27 -39
- data/lib/unclekryon/data/pic_data.rb +25 -37
- data/lib/unclekryon/data/release_data.rb +14 -26
- data/lib/unclekryon/data/social_data.rb +6 -18
- data/lib/unclekryon/data/timespan_data.rb +16 -28
- data/lib/unclekryon/dev_opts.rb +7 -19
- data/lib/unclekryon/hacker.rb +121 -135
- data/lib/unclekryon/iso/base_iso.rb +69 -81
- data/lib/unclekryon/iso/can_prov_terr.rb +34 -47
- data/lib/unclekryon/iso/country.rb +34 -51
- data/lib/unclekryon/iso/language.rb +84 -98
- data/lib/unclekryon/iso/region.rb +8 -29
- data/lib/unclekryon/iso/subregion.rb +8 -29
- data/lib/unclekryon/iso/usa_state.rb +28 -41
- data/lib/unclekryon/iso.rb +128 -138
- data/lib/unclekryon/jsoner.rb +31 -50
- data/lib/unclekryon/log.rb +34 -46
- data/lib/unclekryon/parsers/kryon_aum_year_album_parser.rb +163 -167
- data/lib/unclekryon/parsers/kryon_aum_year_parser.rb +122 -127
- data/lib/unclekryon/server.rb +8 -17
- data/lib/unclekryon/trainer.rb +68 -85
- data/lib/unclekryon/uploader.rb +8 -17
- data/lib/unclekryon/util.rb +80 -92
- data/lib/unclekryon/version.rb +4 -16
- data/lib/unclekryon.rb +166 -166
- data/train/kryon.yaml +6077 -0
- data/unclekryon.gemspec +49 -49
- 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-
|
8
|
-
#
|
9
|
-
#
|
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 ==(
|
52
|
-
return @name ==
|
53
|
-
@filename ==
|
54
|
-
@alt ==
|
55
|
-
@caption ==
|
56
|
-
@url ==
|
57
|
-
@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?
|
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-
|
8
|
-
#
|
9
|
-
#
|
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
|
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-
|
8
|
-
#
|
9
|
-
#
|
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-
|
8
|
-
#
|
9
|
-
#
|
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?
|
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
|
data/lib/unclekryon/dev_opts.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 UncleKryon-server.
|
7
|
-
# Copyright (c) 2018-
|
8
|
-
#
|
9
|
-
#
|
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
|