s/arab_path/src_path/g

This commit is contained in:
0x1eef 2022-07-12 16:16:08 -03:00
parent f8c33d9e7c
commit 2909ac5a53
3 changed files with 6 additions and 6 deletions

View file

@ -22,7 +22,7 @@ path = "/%{chapter_num}/%{verse_num}"
dest_path = File.join( dest_path = File.join(
__dir__, "..", "src", "json", "en", "%{chapter_num}.json" __dir__, "..", "src", "json", "en", "%{chapter_num}.json"
) )
arab_path = File.join( src_path = File.join(
__dir__, "..", "src", "json", "ar", "%{chapter_num}.json" __dir__, "..", "src", "json", "ar", "%{chapter_num}.json"
) )
chapter_count = 114 chapter_count = 114
@ -48,7 +48,7 @@ end
final_dest = format(dest_path, chapter_num:) final_dest = format(dest_path, chapter_num:)
rows = [] rows = []
verses = JSON.parse File.read(format(arab_path, chapter_num:)) verses = JSON.parse File.read(format(src_path, chapter_num:))
verses.each do |verse_num, _| verses.each do |verse_num, _|
case res = http.request(get_request(path, chapter_num, verse_num)) case res = http.request(get_request(path, chapter_num, verse_num))
when Net::HTTPOK when Net::HTTPOK

View file

@ -54,7 +54,7 @@ ch_names = %w[
base_uri = "al-quran.cc" base_uri = "al-quran.cc"
path = "/quran-translation/farsi/%{ch_name}/%{verse_num}.html" path = "/quran-translation/farsi/%{ch_name}/%{verse_num}.html"
cool_off = 5 cool_off = 5
arab_path = File.join( src_path = File.join(
__dir__, "..", "src", "json", "ar", "%{chapter_num}.json" __dir__, "..", "src", "json", "ar", "%{chapter_num}.json"
) )
dest_path = File.join( dest_path = File.join(
@ -86,7 +86,7 @@ end
## ##
# main() # main()
1.upto(114) do |chapter_num| 1.upto(114) do |chapter_num|
verses = JSON.parse File.read(format(arab_path, chapter_num:)) verses = JSON.parse File.read(format(src_path, chapter_num:))
rows = [] rows = []
ch_name = ch_names[chapter_num - 1] ch_name = ch_names[chapter_num - 1]
final_dest = format(dest_path, chapter_num:) final_dest = format(dest_path, chapter_num:)

View file

@ -54,7 +54,7 @@ ch_names = %w[
base_uri = "al-quran.cc" base_uri = "al-quran.cc"
path = "/quran-translation/portuguese/%{ch_name}/%{verse_num}.html" path = "/quran-translation/portuguese/%{ch_name}/%{verse_num}.html"
cool_off = 5 cool_off = 5
arab_path = File.join( src_path = File.join(
__dir__, "..", "src", "json", "ar", "%{chapter_num}.json" __dir__, "..", "src", "json", "ar", "%{chapter_num}.json"
) )
dest_path = File.join( dest_path = File.join(
@ -86,7 +86,7 @@ end
## ##
# main() # main()
1.upto(114) do |chapter_num| 1.upto(114) do |chapter_num|
verses = JSON.parse File.read(format(arab_path, chapter_num:)) verses = JSON.parse File.read(format(src_path, chapter_num:))
rows = [] rows = []
ch_name = ch_names[chapter_num - 1] ch_name = ch_names[chapter_num - 1]
final_dest = format(dest_path, chapter_num:) final_dest = format(dest_path, chapter_num:)