Browse Source

Update to Roda 2.23 and Sequel 4.43 (#2577)

[ci fw-only Ruby/rack-sequel Ruby/roda-sequel Ruby/sinatra-sequel]
Mike Pastore 8 years ago
parent
commit
b06df01b47

+ 1 - 2
frameworks/Ruby/rack-sequel/Gemfile

@@ -3,8 +3,7 @@ source 'https://rubygems.org'
 gem 'json', '~> 2.0'
 gem 'passenger', '~> 5.1', :platforms=>[:ruby, :mswin], :require=>false
 gem 'puma', '~> 3.6', :require=>false
-gem 'sequel', '~> 4.40',
-  :git=>'https://github.com/jeremyevans/sequel.git', :branch=>'master'
+gem 'sequel', '~> 4.43'
 gem 'rack', '~> 2.0'
 gem 'sysrandom', '~> 1.0', :require=>'sysrandom/securerandom'
 gem 'torquebox-web', '>= 4.0.0.beta3', '< 5', :platforms=>:jruby, :require=>false

+ 2 - 4
frameworks/Ruby/roda-sequel/Gemfile

@@ -4,10 +4,8 @@ gem 'erubi', '~> 1.4'
 gem 'json', '~> 2.0'
 gem 'passenger', '~> 5.1', :platforms=>[:ruby, :mswin], :require=>false
 gem 'puma', '~> 3.6', :require=>false
-gem 'sequel', '~> 4.40',
-  :git=>'https://github.com/jeremyevans/sequel.git', :branch=>'master'
-gem 'roda', '~> 2.22',
-  :git=>'https://github.com/jeremyevans/roda.git', :branch=>'master'
+gem 'sequel', '~> 4.43'
+gem 'roda', '~> 2.23'
 gem 'sysrandom', '~> 1.0', :require=>'sysrandom/securerandom'
 gem 'tilt', '~> 2.0', :require=>'tilt/erb'
 gem 'torquebox-web', '>= 4.0.0.beta3', '< 5', :platforms=>:jruby, :require=>false

+ 11 - 6
frameworks/Ruby/roda-sequel/hello_world.rb

@@ -25,23 +25,27 @@ class HelloWorld < Roda
     (1..MAX_PK).to_a.shuffle!.take(n)
   end
 
+  def set_date
+    response['Date'] = Time.now.httpdate
+  end
+
   # Test type 1: JSON serialization
   static_get '/json' do
-    response['Date'] = Time.now.httpdate
+    set_date
 
     { :message=>'Hello, World!' }
   end
 
   # Test type 2: Single database query
   static_get '/db' do
-    response['Date'] = Time.now.httpdate
+    set_date
 
     World.with_pk(rand1).values
   end
 
   # Test type 3: Multiple database queries
   static_get '/queries' do
-    response['Date'] = Time.now.httpdate
+    set_date
 
     # Benchmark requirements explicitly forbid a WHERE..IN here, so be good
     randn(bounded_queries)
@@ -50,7 +54,7 @@ class HelloWorld < Roda
 
   # Test type 4: Fortunes
   static_get '/fortunes' do
-    response['Date'] = Time.now.httpdate
+    set_date
 
     @fortunes = Fortune.all
     @fortunes << Fortune.new(
@@ -64,7 +68,7 @@ class HelloWorld < Roda
 
   # Test type 5: Database updates
   static_get '/updates' do
-    response['Date'] = Time.now.httpdate
+    set_date
 
     # Benchmark requirements explicitly forbid a WHERE..IN here, transactions
     # are optional, batch updates are allowed (but each transaction can only
@@ -80,8 +84,9 @@ class HelloWorld < Roda
 
   # Test type 6: Plaintext
   static_get '/plaintext' do
+    set_date
+
     response['Content-Type'] = 'text/plain'
-    response['Date'] = Time.now.httpdate
 
     'Hello, World!'
   end

+ 1 - 2
frameworks/Ruby/sinatra-sequel/Gemfile

@@ -3,8 +3,7 @@ source 'https://rubygems.org'
 gem 'json', '~> 2.0'
 gem 'passenger', '~> 5.1', :platforms=>[:ruby, :mswin], :require=>false
 gem 'puma', '~> 3.6', :require=>false
-gem 'sequel', '~> 4.40',
-  :git=>'https://github.com/jeremyevans/sequel.git', :branch=>'master'
+gem 'sequel', '~> 4.43'
 gem 'sinatra', '>= 2.0.0.beta2', '< 3.0', :require=>'sinatra/base',
   :git=>'https://github.com/sinatra/sinatra.git', :branch=>'master'
 gem 'slim', '~> 3.0'