Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frameworks/Ruby/roda-sequel/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion frameworks/Ruby/roda-sequel/boot.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions frameworks/Ruby/roda-sequel/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -40,7 +40,7 @@ def rand1
World.with_pk(id).values
end
end
RapidJSON.encode(worlds)
worlds.to_json
end

# Test type 4: Fortunes
Expand Down Expand Up @@ -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
Expand Down
Loading