diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56fd89ff67b..c15ad83f87b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,16 +12,16 @@ jobs: strategy: matrix: - ruby-version: [3.1] + ruby-version: ['3.4'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: vendor/bundle key: gems-${{ runner.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6a032b44969..f3f96cce378 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,16 +11,16 @@ jobs: runs-on: ubuntu-latest env: - ruby-version: 2.6 + ruby-version: '3.4' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.ruby-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: vendor/bundle key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index d9edd290178..c02c6e7643b 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -53,16 +53,16 @@ jobs: runs-on: ubuntu-latest env: - ruby-version: 2.6 + ruby-version: '3.4' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.ruby-version }} - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: vendor/bundle key: gems-${{ runner.os }}-${{ env.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }} diff --git a/.ruby-version b/.ruby-version index 6cb9d3dd0d6..2aa51319921 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.3 +3.4.7 diff --git a/Gemfile b/Gemfile index 28ad6f4375f..129eae593b9 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,7 @@ gem 'middleman', '~> 4.4' gem 'middleman-syntax', '~> 3.2' gem 'middleman-autoprefixer', '~> 3.0' gem 'middleman-sprockets', '~> 4.1' +gem 'sprockets', '~> 3.7' gem 'middleman-data_source' gem 'rouge', '~> 3.21' gem 'redcarpet', '~> 3.6.0' diff --git a/Gemfile.lock b/Gemfile.lock index 3d66c0fc216..d3e55a0246a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,63 +1,74 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.8) + activesupport (7.0.10) + base64 + benchmark (>= 0.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) autoprefixer-rails (10.3.1.0) execjs (~> 2) - backports (3.24.1) + backports (3.25.3) base64 (0.3.0) + benchmark (0.5.0) bigdecimal (4.0.1) borrower (0.10.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.2.3) - contracts (0.16.1) - dotenv (2.8.1) + concurrent-ruby (1.3.6) + contracts (0.17.3) + dotenv (3.2.0) + drb (2.2.3) erubis (2.7.0) - execjs (2.9.1) + execjs (2.10.0) fast_blank (1.0.1) - fastimage (2.3.0) - ffi (1.16.3) - haml (6.3.0) - temple (>= 0.8.2) - thor + fastimage (2.4.0) + ffi (1.17.3) + ffi (1.17.3-x86_64-linux-gnu) + haml (5.2.2) + temple (>= 0.8.0) tilt hamster (3.0.0) concurrent-ruby (~> 1.0) hashie (3.6.0) i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.4.0) - rexml - listen (3.8.0) + kramdown (2.5.2) + rexml (>= 3.4.4) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) memoist (0.16.2) - middleman (4.5.1) + middleman (4.4.3) coffee-script (~> 2.2) - haml (>= 4.0.5) + haml (>= 4.0.5, < 6.0) kramdown (>= 2.3.0) - middleman-cli (= 4.5.1) - middleman-core (= 4.5.1) + middleman-cli (= 4.4.3) + middleman-core (= 4.4.3) middleman-autoprefixer (3.0.0) autoprefixer-rails (~> 10.0) middleman-core (>= 4.0.0) - middleman-cli (4.5.1) - thor (>= 0.17.0, < 1.3.0) - middleman-core (4.5.1) + middleman-cli (4.4.3) + thor (>= 0.17.0, < 2.0) + middleman-core (4.4.3) activesupport (>= 6.1, < 7.1) addressable (~> 2.4) backports (~> 3.6) bundler (~> 2.0) - contracts (~> 0.13, < 0.17) + contracts (~> 0.13) dotenv erubis execjs (~> 2.0) @@ -88,7 +99,9 @@ GEM middleman-core (>= 3.2) rouge (~> 3.2) mini_portile2 (2.8.9) - minitest (5.21.2) + minitest (6.0.2) + drb (~> 2.0) + prism (~> 1.5) mutex_m (0.3.0) nokogiri (1.18.10) mini_portile2 (~> 2.8.2) @@ -100,18 +113,19 @@ GEM padrino-support (= 0.15.3) tilt (>= 1.4.1, < 3) padrino-support (0.15.3) - parallel (1.24.0) + parallel (1.27.0) parslet (2.0.0) - public_suffix (5.0.4) + prism (1.9.0) + public_suffix (7.0.2) racc (1.8.1) - rack (2.2.8) + rack (2.2.22) rack-test (0.6.3) rack (>= 1.0) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) redcarpet (3.6.1) - rexml (3.2.6) + rexml (3.4.4) rouge (3.30.0) sass (3.7.4) sass-listen (~> 4.0.0) @@ -120,12 +134,14 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) sassc (2.4.0) ffi (~> 1.9) + securerandom (0.4.1) servolux (0.13.0) - sprockets (3.7.2) + sprockets (3.7.5) + base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) - temple (0.10.3) - thor (1.2.2) + temple (0.10.4) + thor (1.5.0) tilt (2.0.11) toml (0.3.0) parslet (>= 1.8.0, < 3.0.0) @@ -152,6 +168,7 @@ DEPENDENCIES redcarpet (~> 3.6.0) rouge (~> 3.21) sass + sprockets (~> 3.7) webrick RUBY VERSION diff --git a/config.rb b/config.rb index 3074398dd49..39f42f5826d 100644 --- a/config.rb +++ b/config.rb @@ -1,3 +1,8 @@ +# Monkey-patch File.exists? removed in Ruby 3.2, needed by the borrower gem +class << ::File + alias_method :exists?, :exist? unless method_defined?(:exists?) +end + # Unique header generation # Fix for issue with header titles that are duplicated in different sections of the ToC # from: https://github.com/slatedocs/slate/issues/738#issuecomment-406353752 diff --git a/config/borrower_patch.rb b/config/borrower_patch.rb new file mode 100644 index 00000000000..276bb8d887c --- /dev/null +++ b/config/borrower_patch.rb @@ -0,0 +1,9 @@ +# This is a monkey patch to fix the File.exists? method that was removed in newer Ruby versions +# The borrower gem (v0.10.0) uses this deprecated method, but in Ruby 3.4+ it's been removed +# This patch adds back the method by redirecting to the new File.exist? method + +class File + def self.exists?(path) + exist?(path) + end +end diff --git a/source/data/tables.sql b/source/data/tables.sql index 89c59ddcf10..7e60a929dbe 100644 --- a/source/data/tables.sql +++ b/source/data/tables.sql @@ -51,7 +51,7 @@ CREATE TABLE event_imports ("id" integer, "event_import_batch_id" integer, "impo DROP TABLE IF EXISTS event_types; CREATE TABLE event_types ("id" bigint, "organisation_id" bigint, "name" CHARACTER VARYING(max), "localized_names" CHARACTER VARYING(max), "created_at" timestamp without time zone, "updated_at" timestamp without time zone, "external_ids" CHARACTER VARYING(max), "crm_settings" CHARACTER VARYING(max)); DROP TABLE IF EXISTS events; -CREATE TABLE events ("id" integer, "title" CHARACTER VARYING(max), "slug" CHARACTER VARYING(max), "start_at" timestamp without time zone, "end_at" timestamp without time zone, "location_id" integer, "created_at" timestamp without time zone, "updated_at" timestamp without time zone, "user_id" integer, "organisation_id" integer, "calendar_id" integer, "admin_status" CHARACTER VARYING(max), "admin_reason" CHARACTER VARYING(max), "administered_at" timestamp without time zone, "max_attendees_count" integer, "locale" CHARACTER VARYING(max), "target_id" integer, "thank_attendee_email_content" CHARACTER VARYING(max), "approaching_event_attendee_email_content" CHARACTER VARYING(max), "notify_changes_to_attendees" boolean, "sharing_disabled" boolean, "host_address" CHARACTER VARYING(max), "cancel_reason" CHARACTER VARYING(max), "cancelled_at" timestamp without time zone, "local_chapter_id" integer, "launched_at" timestamp without time zone, "hidden_address" boolean, "promoted_from_waitlist_email_content" CHARACTER VARYING(max), "petition_id" integer, "extra_location_info" CHARACTER VARYING(max), "external_action_id" CHARACTER VARYING(max), "request_referer" CHARACTER VARYING(max), "time_zone" CHARACTER VARYING(max), "hidden_at" timestamp without time zone, "daisy_chain_id" bigint, "new_member_daisy_chain_id" bigint, "forum_enabled" boolean, "reviewer_id" integer, "event_type_id" integer, "region_id" bigint, "settings" CHARACTER VARYING(max), "campaigner_contactable" boolean, "crm_settings" CHARACTER VARYING(max), "created_by_id" bigint, "reviewer_type" CHARACTER VARYING(max), "mentor_id" bigint, "redirect_to" CHARACTER VARYING(max), "web_conference_url" CHARACTER VARYING(max), "virtual" boolean, "content_updated_at" timestamp without time zone, "external_ids" CHARACTER VARYING(max), "featured" boolean, "theme_id" bigint, "utm_params" CHARACTER VARYING(max), "location_venue" CHARACTER VARYING(max), "unconfirmed_location" boolean, "staff_led_organiser_type" CHARACTER VARYING(max), "staff_led_organiser_id" bigint, "unlisted_at" timestamp(6) without time zone, "user_ip" CHARACTER VARYING(max), "user_agent" CHARACTER VARYING(max)); +CREATE TABLE events ("id" integer, "title" CHARACTER VARYING(max), "slug" CHARACTER VARYING(max), "start_at" timestamp without time zone, "end_at" timestamp without time zone, "location_id" integer, "created_at" timestamp without time zone, "updated_at" timestamp without time zone, "user_id" integer, "organisation_id" integer, "calendar_id" integer, "admin_status" CHARACTER VARYING(max), "admin_reason" CHARACTER VARYING(max), "administered_at" timestamp without time zone, "max_attendees_count" integer, "locale" CHARACTER VARYING(max), "target_id" integer, "thank_attendee_email_content" CHARACTER VARYING(max), "approaching_event_attendee_email_content" CHARACTER VARYING(max), "notify_changes_to_attendees" boolean, "sharing_disabled" boolean, "host_address" CHARACTER VARYING(max), "cancel_reason" CHARACTER VARYING(max), "cancelled_at" timestamp without time zone, "local_chapter_id" integer, "launched_at" timestamp without time zone, "hidden_address" boolean, "promoted_from_waitlist_email_content" CHARACTER VARYING(max), "petition_id" integer, "extra_location_info" CHARACTER VARYING(max), "external_action_id" CHARACTER VARYING(max), "request_referer" CHARACTER VARYING(max), "time_zone" CHARACTER VARYING(max), "hidden_at" timestamp without time zone, "daisy_chain_id" bigint, "new_member_daisy_chain_id" bigint, "forum_enabled" boolean, "reviewer_id" integer, "event_type_id" integer, "region_id" bigint, "settings" CHARACTER VARYING(max), "campaigner_contactable" boolean, "crm_settings" CHARACTER VARYING(max), "created_by_id" bigint, "reviewer_type" CHARACTER VARYING(max), "mentor_id" bigint, "redirect_to" CHARACTER VARYING(max), "web_conference_url" CHARACTER VARYING(max), "virtual" boolean, "content_updated_at" timestamp without time zone, "external_ids" CHARACTER VARYING(max), "featured" boolean, "theme_id" bigint, "utm_params" CHARACTER VARYING(max), "location_venue" CHARACTER VARYING(max), "unconfirmed_location" boolean, "staff_led_organiser_type" CHARACTER VARYING(max), "staff_led_organiser_id" bigint, "unlisted_at" timestamp(6) without time zone, "send_prompt_to_repeat" boolean, "prompt_to_repeat_sent_at" timestamp(6) without time zone, "predecessor_event_id" bigint, "user_ip" CHARACTER VARYING(max), "user_agent" CHARACTER VARYING(max)); DROP TABLE IF EXISTS export_download_logs; CREATE TABLE export_download_logs ("id" bigint, "user_id" bigint, "data_export_id" bigint, "created_at" timestamp without time zone); DROP TABLE IF EXISTS external_events;