From d1de14d89b73cc9561682048ae94aef12f161d2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 19:48:50 +0000 Subject: [PATCH 1/4] Bump activerecord from 6.1.6.1 to 6.1.7.1 Bumps [activerecord](https://github.com/rails/rails) from 6.1.6.1 to 6.1.7.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.4.1/activerecord/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v6.1.6.1...v6.1.7.1) --- updated-dependencies: - dependency-name: activerecord dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4d4a2ad..4750ebb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ GEM remote: https://rubygems.org/ specs: - activemodel (6.1.6.1) - activesupport (= 6.1.6.1) - activerecord (6.1.6.1) - activemodel (= 6.1.6.1) - activesupport (= 6.1.6.1) - activesupport (6.1.6.1) + activemodel (6.1.7.1) + activesupport (= 6.1.7.1) + activerecord (6.1.7.1) + activemodel (= 6.1.7.1) + activesupport (= 6.1.7.1) + activesupport (6.1.7.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -19,7 +19,7 @@ GEM httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) - i18n (1.11.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -27,7 +27,7 @@ GEM mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2021.0901) - minitest (5.16.2) + minitest (5.17.0) multi_xml (0.6.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) @@ -56,11 +56,11 @@ GEM httparty (~> 0.13) sqlite3 (1.4.2) tilt (2.0.10) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) whenever (1.0.0) chronic (>= 0.6.3) - zeitwerk (2.6.0) + zeitwerk (2.6.6) PLATFORMS ruby From 4aad9600991c8855717581c4828bc3b0ec017540 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Mar 2023 10:07:37 +0000 Subject: [PATCH 2/4] Bump rack from 2.2.3.1 to 2.2.6.4 Bumps [rack](https://github.com/rack/rack) from 2.2.3.1 to 2.2.6.4. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/2.2.3.1...v2.2.6.4) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4d4a2ad..a337566 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,7 +34,7 @@ GEM nio4r (2.5.8) puma (5.6.4) nio4r (~> 2.0) - rack (2.2.3.1) + rack (2.2.6.4) rack-protection (2.2.0) rack rake (13.0.6) From c8c11e1e3965eea733099077087ff381e8e278d7 Mon Sep 17 00:00:00 2001 From: "Luiz F. Picolo" Date: Sat, 9 Sep 2023 19:08:04 -0400 Subject: [PATCH 3/4] Added last value --- models/rate.rb | 8 ++++++++ public/style.css | 4 ++++ views/home.erb | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/models/rate.rb b/models/rate.rb index 0501559..ac346d6 100644 --- a/models/rate.rb +++ b/models/rate.rb @@ -21,6 +21,14 @@ class Rate < ActiveRecord::Base where(created_at: Date.today.all_day) end + def self.last_time + self.transfer('download').last.first + end + + def self.last_value(type) + self.transfer(type).last.last + end + def self.save test = Speedtest::Test.new(debug: false) result = test.run diff --git a/public/style.css b/public/style.css index 3d5a568..c03b655 100644 --- a/public/style.css +++ b/public/style.css @@ -22,4 +22,8 @@ section { canvas { margin-top: 15px; +} + +.lastcheck { + margin-right: 20px !important; } \ No newline at end of file diff --git a/views/home.erb b/views/home.erb index 0b96d15..6180c62 100644 --- a/views/home.erb +++ b/views/home.erb @@ -1,5 +1,12 @@

Data Transfer Test

+
+

Last Check

+
<%= Rate.last_time %>
+ Download: <%= Rate.last_value('download') %> + Upload: <%= Rate.last_value('upload') %> +
+

Transfer Rate

From 33ba4195ea26c683e84d5ac4df0e8e16ee943f98 Mon Sep 17 00:00:00 2001 From: "Luiz F. Picolo" Date: Sat, 9 Sep 2023 19:24:28 -0400 Subject: [PATCH 4/4] Upgrade ruby version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8f90833..88a44ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7.4 +FROM ruby:3.2 RUN apt-get update && apt-get install -y \ curl \