Skip to content

Commit 0fb591e

Browse files
authored
Downgrade ruby to 3.3.5 (#531)
* downgrade ruby to 3.3.5 * try 3.4.8 * support ruby 3.3.3 to 3.3.10 * remove total_segments in favour of segments_count
1 parent 3df6b8f commit 0fb591e

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '3.3.10'
4+
ruby ">= 3.3.3", "<= 3.3.10"
55

66
gem 'concurrent-ruby', '1.3.4'
77
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ DEPENDENCIES
677677
web-console
678678

679679
RUBY VERSION
680-
ruby 3.3.3p89
680+
ruby 3.3.5p100
681681

682682
BUNDLED WITH
683683
2.5.15

app/models/audio/chapter_audio_file.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def humanize
7575
end
7676

7777
def segment_progress
78-
if total_segments.zero?
78+
if segments_count.to_i.zero?
7979
0
8080
else
81-
(total_verses / total_segments.to_f) * 100
81+
(total_verses / segments_count.to_i.to_f) * 100
8282
end
8383
end
8484

@@ -139,7 +139,7 @@ def total_verses
139139
end
140140

141141
def total_segments
142-
read_attribute(:total_segments).to_f
142+
segments_count
143143
end
144144

145145
def wav_parts

app/views/surah_audio_files/index.html.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@
5454
<th scope="row" class="tw-py-2 tw-pl-2"><%= file.chapter_id %></th>
5555

5656
<td class="tw-py-2">
57-
<% progress = file.segment_progress %>
57+
<% progress = [file.segment_progress, 100].min %>
5858
<div class="tw-w-full tw-bg-gray-200 tw-rounded-full tw-h-6">
5959
<div class="tw-h-6 tw-rounded-full tw-text-white tw-text-xs tw-flex tw-items-center tw-justify-center tw-transition-all tw-duration-300 tw-bg-green-500"
6060
role="progressbar"
6161
aria-valuenow="<%= progress %>"
62-
aria-valuemin="0" aria-valuemax="100"
62+
aria-valuemin="0"
63+
aria-valuemax="100"
6364
style="width: <%= progress %>%; min-width: 30px"
6465
>
6566
<%= progress %>%

0 commit comments

Comments
 (0)