Address rubocop errors

This commit is contained in:
0x1eef 2023-02-13 13:21:41 -03:00 committed by Robert
parent 3d8deaecf3
commit dd406b8a45
7 changed files with 18 additions and 6 deletions

View file

@ -10,6 +10,10 @@ inherit_gem:
AllCops:
TargetRubyVersion: 3.2
Include:
- libexec/quran-json/*
- lib/quran-json/**/*.rb
- bin/*
##
# Enabled cops
@ -24,5 +28,3 @@ Layout/ArgumentAlignment:
Enabled: false
Style/LambdaCall:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false

View file

@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "json"
##

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Quran
module JSON
require_relative "json/cmd"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Quran::JSON::Cmd
require "ryo"
require "json"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Quran::JSON::Pull
require "ryo"
require "json"
@ -43,7 +45,7 @@ class Quran::JSON::Pull
def write(surah_no, rows)
mkdir_p(locale_dir)
rows[0] = Ryo.table_of(metadata[surah_no-1])
rows[0] = Ryo.table_of(metadata[surah_no - 1])
write_json File.join(locale_dir, "#{surah_no}.json"), rows
end
@ -100,8 +102,6 @@ class Quran::JSON::Pull
end
def sources
@sources ||= Ryo.from(
JSON.parse File.binread(File.join(data_dir, "sources.json"))
)
@sources ||= Ryo.from read_json(File.join(data_dir, "sources.json"))
end
end

View file

@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
lib_dir = File.realpath File.join(__dir__, "..", "..", "lib", "quran-json")
require File.join(lib_dir, "quran", "json")
require "optparse"

View file

@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
lib_dir = File.realpath File.join(__dir__, "..", "..", "lib", "quran-json")
require File.join(lib_dir, "quran", "json")
require "optparse"