Skip to content

Commit

Permalink
Fix Rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericpig committed Jul 25, 2022
1 parent 65e1a48 commit 390d659
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $ bundle exec rake -T
[GNU GPL v3+](LICENSE)

> UncleKryon-server (https://github.com/esotericpig/UncleKryon-server)
> Copyright (c) 2017-2021 Jonathan Bradley Whited
> Copyright (c) 2017-2022 Jonathan Bradley Whited
>
> UncleKryon-server is free software: you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions lib/unclekryon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2017-2021 Jonathan Bradley Whited
# Copyright (c) 2017-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand Down Expand Up @@ -355,7 +355,7 @@ def gsub_updated_on(dirname,updated_on)
updated_on = Util.format_datetime(updated_on)

Dir.glob(File.join(dirname,'*.yaml')) do |filepath|
lines = IO.readlines(filepath)
lines = File.readlines(filepath)
update_count = 0

lines.each_with_index do |line,i|
Expand Down
6 changes: 3 additions & 3 deletions lib/unclekryon/hacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2017-2021 Jonathan Bradley Whited
# Copyright (c) 2017-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand Down Expand Up @@ -198,7 +198,7 @@ def parse_kryon_aum_year_albums(year,begin_album=nil)

if !begin_album.nil?
album_index = find_kryon_aum_year_album(artist,begin_album,year,index)[1]
albums = albums[album_index..-1]
albums = albums[album_index..]
end

albums.each do |album_id|
Expand Down Expand Up @@ -262,7 +262,7 @@ def train_kryon_aum_year_albums(year,begin_album=nil)

if !begin_album.nil?
album_index = find_kryon_aum_year_album(artist,begin_album,year,index)[1]
albums = albums[album_index..-1]
albums = albums[album_index..]
end

albums.each do |album_id|
Expand Down
6 changes: 1 addition & 5 deletions lib/unclekryon/iso/country.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2018-2021 Jonathan Bradley Whited
# Copyright (c) 2018-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand Down Expand Up @@ -63,10 +63,6 @@ def to_s
class Countries < BaseIsos
DEFAULT_FILEPATH = "#{DEFAULT_DIR}/countries.yaml"

def initialize
super()
end

def self.load_file(filepath=DEFAULT_FILEPATH)
return Countries.new.load_file(filepath)
end
Expand Down
6 changes: 1 addition & 5 deletions lib/unclekryon/iso/language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2018-2021 Jonathan Bradley Whited
# Copyright (c) 2018-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand Down Expand Up @@ -111,10 +111,6 @@ def to_s
class Languages < BaseIsos
DEFAULT_FILEPATH = "#{DEFAULT_DIR}/languages.yaml"

def initialize
super()
end

def find_by_kryon(text,add_english: false,**options)
langs = []
regexes = [
Expand Down
9 changes: 1 addition & 8 deletions lib/unclekryon/iso/region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2018-2021 Jonathan Bradley Whited
# Copyright (c) 2018-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand All @@ -16,18 +16,11 @@
##
module UncleKryon
class Region < BaseIso
def initialize
super()
end
end

class Regions < BaseIsos
DEFAULT_FILEPATH = "#{DEFAULT_DIR}/regions.yaml"

def initialize
super()
end

def self.load_file(filepath=DEFAULT_FILEPATH)
return Regions.new.load_file(filepath)
end
Expand Down
9 changes: 1 addition & 8 deletions lib/unclekryon/iso/subregion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2019-2021 Jonathan Bradley Whited
# Copyright (c) 2019-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand All @@ -16,18 +16,11 @@
##
module UncleKryon
class Subregion < BaseIso
def initialize
super()
end
end

class Subregions < BaseIsos
DEFAULT_FILEPATH = "#{DEFAULT_DIR}/subregions.yaml"

def initialize
super()
end

def self.load_file(filepath=DEFAULT_FILEPATH)
return Subregions.new.load_file(filepath)
end
Expand Down
8 changes: 4 additions & 4 deletions lib/unclekryon/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2017-2021 Jonathan Bradley Whited
# Copyright (c) 2017-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand All @@ -15,6 +15,6 @@ class Server
end
end

if $PROGRAM_NAME == __FILE__
# Test here.
end
#if $PROGRAM_NAME == __FILE__
# # Test here.
#end
7 changes: 2 additions & 5 deletions lib/unclekryon/trainer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2017-2021 Jonathan Bradley Whited
# Copyright (c) 2017-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand Down Expand Up @@ -147,10 +147,7 @@ def save_to_file
end

Util.mk_dirs_from_filepath(@filepath)

File.open(@filepath,'w') do |f|
f.write(to_s)
end
File.write(@filepath,to_s)
end

def [](id)
Expand Down
8 changes: 4 additions & 4 deletions lib/unclekryon/uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#--
# This file is part of UncleKryon-server.
# Copyright (c) 2017-2021 Jonathan Bradley Whited
# Copyright (c) 2017-2022 Jonathan Bradley Whited
#
# SPDX-License-Identifier: GPL-3.0-or-later
#++
Expand All @@ -15,6 +15,6 @@ class Uploader
end
end

if $PROGRAM_NAME == __FILE__
# Test here.
end
#if $PROGRAM_NAME == __FILE__
# # Test here.
#end

0 comments on commit 390d659

Please sign in to comment.