diff --git a/frameworks/Ruby/roda-sequel/Gemfile b/frameworks/Ruby/roda-sequel/Gemfile index c5dd09c3375..73b6ee99edc 100644 --- a/frameworks/Ruby/roda-sequel/Gemfile +++ b/frameworks/Ruby/roda-sequel/Gemfile @@ -2,13 +2,13 @@ source "https://rubygems.org" gem 'base64' # required by passenger on Ruby 3.4 gem "erubi", "~> 1.12" +gem "json", "~> 2.8" gem "passenger", "~> 6.0", platforms: %i[ruby mswin], require: false gem "puma", "~> 6.2", require: false gem "sequel", "~> 5.67" gem "roda", "~> 3.66" gem "tilt", "~> 2.1", require: "tilt/erb" gem "unicorn", "~> 6.1", platforms: %i[ruby mswin], require: false -gem "rapidjson" group :mysql do gem "mysql2", "~> 0.5", platforms: %i[ruby mswin] diff --git a/frameworks/Ruby/roda-sequel/boot.rb b/frameworks/Ruby/roda-sequel/boot.rb index bc7277e2362..5d852e9e80c 100644 --- a/frameworks/Ruby/roda-sequel/boot.rb +++ b/frameworks/Ruby/roda-sequel/boot.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require "bundler/setup" require "time" -require "rapidjson" MAX_PK = 10_000 QUERY_RANGE = (1..MAX_PK).freeze ALL_IDS = QUERY_RANGE.to_a diff --git a/frameworks/Ruby/roda-sequel/hello_world.rb b/frameworks/Ruby/roda-sequel/hello_world.rb index 458e1a7c687..c05354e2097 100644 --- a/frameworks/Ruby/roda-sequel/hello_world.rb +++ b/frameworks/Ruby/roda-sequel/hello_world.rb @@ -22,13 +22,13 @@ def rand1 # Test type 1: JSON serialization r.is "json" do response[CONTENT_TYPE] = JSON_TYPE - RapidJSON.encode({ message: "Hello, World!" }) + { message: "Hello, World!" }.to_json end # Test type 2: Single database query r.is "db" do response[CONTENT_TYPE] = JSON_TYPE - RapidJSON.encode(World.with_pk(rand1).values) + World.with_pk(rand1).values.to_json end # Test type 3: Multiple database queries @@ -40,7 +40,7 @@ def rand1 World.with_pk(id).values end end - RapidJSON.encode(worlds) + worlds.to_json end # Test type 4: Fortunes @@ -70,7 +70,7 @@ def rand1 end World.batch_update(worlds) end - RapidJSON.encode(worlds.map!(&:values)) + worlds.map!(&:values).to_json end # Test type 6: Plaintext