Browse Source

Update Ruby to 2.4.1 in Rails, Rack and Grape (#2755)

Jester 8 years ago
parent
commit
c49bc6f136

+ 13 - 12
frameworks/Ruby/grape/Gemfile

@@ -1,20 +1,21 @@
 source 'http://rubygems.org'
 source 'http://rubygems.org'
 
 
 platforms :jruby do
 platforms :jruby do
-  gem "activerecord-jdbcmysql-adapter", "~> 1.3.9", :require => false
-  gem 'torqbox', '0.1.7'
-  gem "trinidad", "1.4.6"
+  gem 'activerecord-jdbcmysql-adapter', '~> 1.3.9', :require => false
+  gem 'torquebox', '3.2.0'
+  gem 'trinidad', '1.4.6'
 end
 end
 
 
 platforms :ruby do
 platforms :ruby do
-  gem 'mysql2', '0.3.16'
-  gem "unicorn", "4.8.3"
-  gem "thin", "~> 1.6.2"
+  gem 'mysql2', '0.4.5'
+  gem 'unicorn', '5.3.0'
+  gem 'thin', '1.7.0'
 end
 end
 
 
-gem 'activerecord', '4.1.4', :require => 'active_record'
-gem "activerecord-import", "~> 0.5.0"
-gem "grape", "0.8.0"
-gem 'rack', '1.5.2'
-gem 'json', '1.8.1'
-gem "puma", "~> 2.9.0"
+gem 'puma', '3.8.2'
+
+gem 'activerecord', '5.1.0', :require => 'active_record'
+gem 'activerecord-import', "~> 0.18.1"
+gem 'grape', '0.19.2'
+gem 'rack', '1.6.5'
+gem 'json', '2.1.0'

+ 95 - 58
frameworks/Ruby/grape/Gemfile.lock

@@ -1,88 +1,125 @@
 GEM
 GEM
   remote: http://rubygems.org/
   remote: http://rubygems.org/
   specs:
   specs:
-    activemodel (4.1.4)
-      activesupport (= 4.1.4)
-      builder (~> 3.1)
-    activerecord (4.1.4)
-      activemodel (= 4.1.4)
-      activesupport (= 4.1.4)
-      arel (~> 5.0.0)
-    activerecord-import (0.5.0)
-      activerecord (>= 3.0)
-    activerecord-jdbc-adapter (1.3.21)
+    activemodel (5.1.0)
+      activesupport (= 5.1.0)
+    activerecord (5.1.0)
+      activemodel (= 5.1.0)
+      activesupport (= 5.1.0)
+      arel (~> 8.0)
+    activerecord-import (0.18.1)
+      activerecord (>= 3.2)
+    activerecord-jdbc-adapter (1.3.22)
       activerecord (>= 2.2)
       activerecord (>= 2.2)
-    activerecord-jdbcmysql-adapter (1.3.21)
-      activerecord-jdbc-adapter (~> 1.3.21)
+    activerecord-jdbcmysql-adapter (1.3.22)
+      activerecord-jdbc-adapter (~> 1.3.22)
       jdbc-mysql (>= 5.1.22)
       jdbc-mysql (>= 5.1.22)
-    activesupport (4.1.4)
-      i18n (~> 0.6, >= 0.6.9)
-      json (~> 1.7, >= 1.7.7)
+    activesupport (5.1.0)
+      concurrent-ruby (~> 1.0, >= 1.0.2)
+      i18n (~> 0.7)
       minitest (~> 5.1)
       minitest (~> 5.1)
-      thread_safe (~> 0.1)
       tzinfo (~> 1.1)
       tzinfo (~> 1.1)
-    arel (5.0.1.20140414130214)
+    arel (8.0.0)
     axiom-types (0.1.1)
     axiom-types (0.1.1)
       descendants_tracker (~> 0.0.4)
       descendants_tracker (~> 0.0.4)
       ice_nine (~> 0.11.0)
       ice_nine (~> 0.11.0)
       thread_safe (~> 0.3, >= 0.3.1)
       thread_safe (~> 0.3, >= 0.3.1)
-    builder (3.2.2)
+    blankslate (2.1.2.4)
+    builder (3.2.3)
     coercible (1.0.0)
     coercible (1.0.0)
       descendants_tracker (~> 0.0.1)
       descendants_tracker (~> 0.0.1)
+    concurrent-ruby (1.0.5)
+    concurrent-ruby (1.0.5-java)
     daemons (1.2.4)
     daemons (1.2.4)
     descendants_tracker (0.0.4)
     descendants_tracker (0.0.4)
       thread_safe (~> 0.3, >= 0.3.1)
       thread_safe (~> 0.3, >= 0.3.1)
+    edn (1.0.0)
+      parslet (~> 1.4.0)
     equalizer (0.0.11)
     equalizer (0.0.11)
-    eventmachine (1.2.0.1)
-    grape (0.8.0)
+    eventmachine (1.2.3)
+    grape (0.19.2)
       activesupport
       activesupport
       builder
       builder
       hashie (>= 2.1.0)
       hashie (>= 2.1.0)
       multi_json (>= 1.3.2)
       multi_json (>= 1.3.2)
       multi_xml (>= 0.5.2)
       multi_xml (>= 0.5.2)
+      mustermann-grape (~> 1.0.0)
       rack (>= 1.3.0)
       rack (>= 1.3.0)
       rack-accept
       rack-accept
-      rack-mount
       virtus (>= 1.0.0)
       virtus (>= 1.0.0)
-    hashie (3.4.4)
-    i18n (0.7.0)
+    hashie (3.5.5)
+    i18n (0.8.1)
     ice_nine (0.11.2)
     ice_nine (0.11.2)
-    jdbc-mysql (5.1.38)
+    jdbc-mysql (5.1.40)
     jruby-rack (1.1.20)
     jruby-rack (1.1.20)
-    json (1.8.1)
-    json (1.8.1-java)
-    kgio (2.10.0)
-    minitest (5.9.0)
+    json (2.1.0)
+    json (2.1.0-java)
+    kgio (2.11.0)
+    minitest (5.10.1)
     multi_json (1.12.1)
     multi_json (1.12.1)
-    multi_xml (0.5.5)
-    mysql2 (0.3.16)
-    puma (2.9.2)
-      rack (>= 1.1, < 2.0)
-    puma (2.9.2-java)
-      rack (>= 1.1, < 2.0)
-    rack (1.5.2)
+    multi_xml (0.6.0)
+    mustermann (1.0.0)
+    mustermann-grape (1.0.0)
+      mustermann (~> 1.0.0)
+    mysql2 (0.4.5)
+    parslet (1.4.0)
+      blankslate (~> 2.0)
+    puma (3.8.2)
+    puma (3.8.2-java)
+    rack (1.6.5)
     rack-accept (0.4.5)
     rack-accept (0.4.5)
       rack (>= 0.4)
       rack (>= 0.4)
-    rack-mount (0.8.3)
-      rack (>= 1.0.0)
-    raindrops (0.17.0)
-    thin (1.6.4)
+    raindrops (0.18.0)
+    rake (12.0.0)
+    thin (1.7.0)
       daemons (~> 1.0, >= 1.0.9)
       daemons (~> 1.0, >= 1.0.9)
       eventmachine (~> 1.0, >= 1.0.4)
       eventmachine (~> 1.0, >= 1.0.4)
-      rack (~> 1.0)
-    thread_safe (0.3.5)
-    thread_safe (0.3.5-java)
-    torqbox (0.1.7-java)
-      rack (>= 1.4.0, < 2.0)
+      rack (>= 1, < 3)
+    thor (0.19.4)
+    thread_safe (0.3.6)
+    thread_safe (0.3.6-java)
+    torquebox (3.2.0)
+      thor (>= 0.14.6)
+      torquebox-cache (= 3.2.0)
+      torquebox-configure (= 3.2.0)
+      torquebox-core (= 3.2.0)
+      torquebox-messaging (= 3.2.0)
+      torquebox-naming (= 3.2.0)
+      torquebox-rake-support (= 3.2.0)
+      torquebox-security (= 3.2.0)
+      torquebox-stomp (= 3.2.0)
+      torquebox-transactions (= 3.2.0)
+      torquebox-web (= 3.2.0)
+    torquebox-cache (3.2.0-java)
+      torquebox-core (= 3.2.0)
+      torquebox-transactions (= 3.2.0)
+    torquebox-configure (3.2.0-java)
+      blankslate (= 2.1.2.4)
+    torquebox-core (3.2.0-java)
+      edn (= 1.0.0)
+    torquebox-messaging (3.2.0-java)
+      torquebox-core (= 3.2.0)
+      torquebox-transactions (= 3.2.0)
+    torquebox-naming (3.2.0-java)
+      torquebox-core (= 3.2.0)
+    torquebox-rake-support (3.2.0)
+      rake (>= 0.8.7)
+    torquebox-security (3.2.0-java)
+      torquebox-core (= 3.2.0)
+    torquebox-stomp (3.2.0)
+      torquebox-core (= 3.2.0)
+      torquebox-messaging (= 3.2.0)
+    torquebox-transactions (3.2.0)
+      torquebox-core (= 3.2.0)
+    torquebox-web (3.2.0-java)
     trinidad (1.4.6)
     trinidad (1.4.6)
       jruby-rack (~> 1.1.13)
       jruby-rack (~> 1.1.13)
       trinidad_jars (>= 1.3.0, < 1.5.0)
       trinidad_jars (>= 1.3.0, < 1.5.0)
     trinidad_jars (1.4.2)
     trinidad_jars (1.4.2)
-    tzinfo (1.2.2)
+    tzinfo (1.2.3)
       thread_safe (~> 0.1)
       thread_safe (~> 0.1)
-    unicorn (4.8.3)
+    unicorn (5.3.0)
       kgio (~> 2.6)
       kgio (~> 2.6)
-      rack
       raindrops (~> 0.7)
       raindrops (~> 0.7)
     virtus (1.0.5)
     virtus (1.0.5)
       axiom-types (~> 0.1)
       axiom-types (~> 0.1)
@@ -95,18 +132,18 @@ PLATFORMS
   ruby
   ruby
 
 
 DEPENDENCIES
 DEPENDENCIES
-  activerecord (= 4.1.4)
-  activerecord-import (~> 0.5.0)
+  activerecord (= 5.1.0)
+  activerecord-import (~> 0.18.1)
   activerecord-jdbcmysql-adapter (~> 1.3.9)
   activerecord-jdbcmysql-adapter (~> 1.3.9)
-  grape (= 0.8.0)
-  json (= 1.8.1)
-  mysql2 (= 0.3.16)
-  puma (~> 2.9.0)
-  rack (= 1.5.2)
-  thin (~> 1.6.2)
-  torqbox (= 0.1.7)
+  grape (= 0.19.2)
+  json (= 2.1.0)
+  mysql2 (= 0.4.5)
+  puma (= 3.8.2)
+  rack (= 1.6.5)
+  thin (= 1.7.0)
+  torquebox (= 3.2.0)
   trinidad (= 1.4.6)
   trinidad (= 1.4.6)
-  unicorn (= 4.8.3)
+  unicorn (= 5.3.0)
 
 
 BUNDLED WITH
 BUNDLED WITH
-   1.13.1
+   1.14.3

+ 17 - 17
frameworks/Ruby/grape/benchmark_config.json

@@ -4,9 +4,9 @@
     "default": {
     "default": {
       "setup_file": "run_mri_puma",
       "setup_file": "run_mri_puma",
       "json_url": "/json",
       "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/query?queries=", 
-      "update_url": "/updates?queries=", 
+      "db_url": "/db",
+      "query_url": "/query?queries=",
+      "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
@@ -24,11 +24,11 @@
       "versus": "rack-puma-mri"
       "versus": "rack-puma-mri"
     },
     },
     "thin": {
     "thin": {
-      "setup_file": "run_thin",
+      "setup_file": "run_mri_thin",
       "json_url": "/json",
       "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/query?queries=", 
-      "update_url": "/updates?queries=", 
+      "db_url": "/db",
+      "query_url": "/query?queries=",
+      "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
@@ -41,16 +41,16 @@
       "webserver": "Thin",
       "webserver": "Thin",
       "os": "Linux",
       "os": "Linux",
       "database_os": "Linux",
       "database_os": "Linux",
-      "display_name": "grape-thin",
+      "display_name": "grape-thin-mri",
       "notes": "",
       "notes": "",
-      "versus": "rack-thin"
-    },  
+      "versus": "rack-thin-mri"
+    },
     "unicorn": {
     "unicorn": {
-      "setup_file": "run_unicorn",
+      "setup_file": "run_mri_unicorn",
       "json_url": "/json",
       "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/query?queries=", 
-      "update_url": "/updates?queries=", 
+      "db_url": "/db",
+      "query_url": "/query?queries=",
+      "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
@@ -63,9 +63,9 @@
       "webserver": "Unicorn",
       "webserver": "Unicorn",
       "os": "Linux",
       "os": "Linux",
       "database_os": "Linux",
       "database_os": "Linux",
-      "display_name": "grape-unicorn",
+      "display_name": "grape-unicorn-mri",
       "notes": "",
       "notes": "",
-      "versus": "rack-unicorn"
-    } 
+      "versus": "rack-unicorn-mri"
+    }
   }]
   }]
 }
 }

+ 15 - 11
frameworks/Ruby/grape/config.ru

@@ -3,25 +3,26 @@ require 'active_record'
 
 
 Bundler.require :default
 Bundler.require :default
 
 
-db_config = YAML.load(ERB.new(File.read("config/database.yml")).result)[ENV['RACK_ENV']]
+db_config = YAML.load(ERB.new(File.read('config/database.yml')).result)[ENV['RACK_ENV']]
 ActiveRecord::Base.establish_connection(db_config)
 ActiveRecord::Base.establish_connection(db_config)
 
 
 class World < ActiveRecord::Base
 class World < ActiveRecord::Base
-  self.table_name = "World"
+  self.table_name = 'World'
 end
 end
 
 
 module Acme
 module Acme
   class HelloWorld < Grape::API
   class HelloWorld < Grape::API
     get '/json' do
     get '/json' do
-      {message:"Hello, World!"}
+      {message:'Hello, World!'}
     end
     end
   end
   end
 
 
   class PlainText < Grape::API
   class PlainText < Grape::API
-    content_type :plain, "text/plain; charset=utf-8"
+    content_type :plain, 'text/plain'
     format :plain
     format :plain
+
     get '/plaintext' do
     get '/plaintext' do
-      "Hello, World!"
+      'Hello, World!'
     end
     end
   end
   end
 
 
@@ -38,7 +39,7 @@ module Acme
       queries = 500 if queries > 500
       queries = 500 if queries > 500
 
 
       ActiveRecord::Base.connection_pool.with_connection do
       ActiveRecord::Base.connection_pool.with_connection do
-        results = (1..queries).map do
+        (1..queries).map do
           World.find(Random.rand(10000) + 1)
           World.find(Random.rand(10000) + 1)
         end
         end
       end
       end
@@ -48,7 +49,7 @@ module Acme
       queries = params[:queries].to_i
       queries = params[:queries].to_i
       queries = 1 if queries < 1
       queries = 1 if queries < 1
       queries = 500 if queries > 500
       queries = 500 if queries > 500
-      
+
       ActiveRecord::Base.connection_pool.with_connection do
       ActiveRecord::Base.connection_pool.with_connection do
         worlds = (1..queries).map do
         worlds = (1..queries).map do
           world = World.find(Random.rand(10000) + 1)
           world = World.find(Random.rand(10000) + 1)
@@ -62,9 +63,14 @@ module Acme
   end
   end
 
 
   class API < Grape::API
   class API < Grape::API
-    content_type :json, "application/json; charset=utf-8"
-    format :json
+    before do
+      header 'Date', Time.now.httpdate
+      header 'Server', 'WebServer'
+    end
     
     
+    content_type :json, 'application/json'
+    format :json
+
     mount ::Acme::HelloWorld
     mount ::Acme::HelloWorld
     mount ::Acme::PlainText
     mount ::Acme::PlainText
     mount ::Acme::DatabaseQueries
     mount ::Acme::DatabaseQueries
@@ -72,5 +78,3 @@ module Acme
 end
 end
 
 
 run Acme::API
 run Acme::API
-
-

+ 1 - 1
frameworks/Ruby/grape/run_mri_puma.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.0
+fw_depends mysql rvm ruby-2.4
 
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 
 

+ 1 - 1
frameworks/Ruby/grape/run_thin.sh → frameworks/Ruby/grape/run_mri_thin.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.0
+fw_depends mysql rvm ruby-2.4
 
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 
 

+ 1 - 1
frameworks/Ruby/grape/run_unicorn.sh → frameworks/Ruby/grape/run_mri_unicorn.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm nginx ruby-2.0
+fw_depends mysql rvm nginx ruby-2.4
 
 
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 sed -i 's|  host:.*|  host: '"${DBHOST}"'|g' config/database.yml
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf

+ 10 - 9
frameworks/Ruby/rack/Gemfile

@@ -1,17 +1,18 @@
 source 'http://rubygems.org'
 source 'http://rubygems.org'
 
 
 platforms :jruby do
 platforms :jruby do
-  gem "jdbc-mysql", "5.1.38", :require => 'jdbc/mysql'
-  gem 'torqbox', '0.1.7'
-  gem "trinidad", "1.4.6"
+  gem 'jdbc-mysql', '5.1.38', :require => 'jdbc/mysql'
+  gem 'torquebox', '3.2.0'
+  gem 'trinidad', '1.4.6'
 end
 end
 
 
 platforms :ruby do
 platforms :ruby do
-  gem 'mysql2', '0.3.16'
-  gem "unicorn", "4.8.3"
-  gem "thin", "~> 1.6.2"
+  gem 'mysql2', '0.4.5'
+  gem 'unicorn', '5.3.0'
+  gem 'thin', '1.7.0'
 end
 end
 
 
-gem 'rack', '1.5.2'
-gem 'json', '1.8.1'
-gem "puma", "~> 2.9.0"
+gem 'puma', '3.8.2'
+
+gem 'rack', '2.0.1'
+gem 'json', '2.1.0'

+ 18 - 20
frameworks/Ruby/rack/Gemfile.lock

@@ -2,21 +2,19 @@ GEM
   remote: http://rubygems.org/
   remote: http://rubygems.org/
   specs:
   specs:
     daemons (1.2.4)
     daemons (1.2.4)
-    eventmachine (1.2.0.1)
-    json (1.8.1)
-    kgio (2.10.0)
-    mysql2 (0.3.16)
-    puma (2.9.2)
-      rack (>= 1.1, < 2.0)
-    rack (1.5.2)
-    raindrops (0.17.0)
-    thin (1.6.4)
+    eventmachine (1.2.3)
+    json (2.1.0)
+    kgio (2.11.0)
+    mysql2 (0.4.5)
+    puma (3.8.2)
+    rack (2.0.1)
+    raindrops (0.18.0)
+    thin (1.7.0)
       daemons (~> 1.0, >= 1.0.9)
       daemons (~> 1.0, >= 1.0.9)
       eventmachine (~> 1.0, >= 1.0.4)
       eventmachine (~> 1.0, >= 1.0.4)
-      rack (~> 1.0)
-    unicorn (4.8.3)
+      rack (>= 1, < 3)
+    unicorn (5.3.0)
       kgio (~> 2.6)
       kgio (~> 2.6)
-      rack
       raindrops (~> 0.7)
       raindrops (~> 0.7)
 
 
 PLATFORMS
 PLATFORMS
@@ -24,14 +22,14 @@ PLATFORMS
 
 
 DEPENDENCIES
 DEPENDENCIES
   jdbc-mysql (= 5.1.38)
   jdbc-mysql (= 5.1.38)
-  json (= 1.8.1)
-  mysql2 (= 0.3.16)
-  puma (~> 2.9.0)
-  rack (= 1.5.2)
-  thin (~> 1.6.2)
-  torqbox (= 0.1.7)
+  json (= 2.1.0)
+  mysql2 (= 0.4.5)
+  puma (= 3.8.2)
+  rack (= 2.0.1)
+  thin (= 1.7.0)
+  torquebox (= 3.2.0)
   trinidad (= 1.4.6)
   trinidad (= 1.4.6)
-  unicorn (= 4.8.3)
+  unicorn (= 5.3.0)
 
 
 BUNDLED WITH
 BUNDLED WITH
-   1.13.1
+   1.14.3

+ 8 - 8
frameworks/Ruby/rack/app/jruby_impl.rb

@@ -7,12 +7,12 @@ username, password = DB_CONFIG[:username], DB_CONFIG[:password]
 JDBC_CONFIG = "jdbc:mysql://#{host}/#{database}?user=#{username}&password=#{password}"
 JDBC_CONFIG = "jdbc:mysql://#{host}/#{database}?user=#{username}&password=#{password}"
 
 
 module App
 module App
-  JRuby = lambda do |env| 
+  JRuby = lambda do |env|
     content_type, body = case env['PATH_INFO']
     content_type, body = case env['PATH_INFO']
       when '/plaintext'
       when '/plaintext'
-        ['text/plain; charset=utf-8', "Hello, World!"] 
+        ['text/plain', "Hello, World!"]
       when '/json'
       when '/json'
-        ['application/json; charset=utf-8', {:message => "Hello, World!"}.to_json]
+        ['application/json', {:message => "Hello, World!"}.to_json]
       when '/db'
       when '/db'
         id = Random.rand(10000) + 1
         id = Random.rand(10000) + 1
         query = "SELECT * FROM World WHERE id = " + id.to_s
         query = "SELECT * FROM World WHERE id = " + id.to_s
@@ -30,7 +30,7 @@ module App
         ensure
         ensure
           connection.close
           connection.close
         end
         end
-        ['application/json; charset=utf-8', results.to_json]
+        ['application/json', results.to_json]
       when '/queries'
       when '/queries'
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         queries = query_string['queries'].to_i
         queries = query_string['queries'].to_i
@@ -53,7 +53,7 @@ module App
         ensure
         ensure
           connection.close
           connection.close
         end
         end
-        ['application/json; charset=utf-8', results.to_json] 
+        ['application/json', results.to_json]
       when '/updates'
       when '/updates'
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         queries = query_string['queries'].to_i
         queries = query_string['queries'].to_i
@@ -84,8 +84,8 @@ module App
           connection.close
           connection.close
         end
         end
 
 
-        ['application/json; charset=utf-8', results.to_json] 
+        ['application/json', results.to_json]
       end
       end
     [200, { 'Content-Type' => content_type }, [body]]
     [200, { 'Content-Type' => content_type }, [body]]
-  end 
-end
+  end
+end

+ 8 - 8
frameworks/Ruby/rack/app/ruby_impl.rb

@@ -1,10 +1,10 @@
 module App
 module App
-  Ruby = lambda do |env| 
+  Ruby = lambda do |env|
     content_type, body = case env['PATH_INFO']
     content_type, body = case env['PATH_INFO']
       when '/plaintext'
       when '/plaintext'
-        ['text/plain; charset=utf-8', "Hello, World!"] 
+        ['text/plain', "Hello, World!"]
       when '/json'
       when '/json'
-        ['application/json; charset=utf-8', {:message => "Hello, World!"}.to_json]
+        ['application/json', {:message => "Hello, World!"}.to_json]
       when '/db'
       when '/db'
         id = Random.rand(10000) + 1
         id = Random.rand(10000) + 1
         query = "SELECT * FROM World WHERE id = " + id.to_s
         query = "SELECT * FROM World WHERE id = " + id.to_s
@@ -15,7 +15,7 @@ module App
         ensure
         ensure
           client.close
           client.close
         end
         end
-        ['application/json; charset=utf-8', results.first.to_json]
+        ['application/json', results.first.to_json]
       when '/queries'
       when '/queries'
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         queries = query_string['queries'].to_i
         queries = query_string['queries'].to_i
@@ -31,7 +31,7 @@ module App
         ensure
         ensure
           client.close
           client.close
         end
         end
-        ['application/json; charset=utf-8', results.to_json] 
+        ['application/json', results.to_json]
       when '/updates'
       when '/updates'
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         query_string = Rack::Utils.parse_query(env['QUERY_STRING'])
         queries = query_string['queries'].to_i
         queries = query_string['queries'].to_i
@@ -51,8 +51,8 @@ module App
         ensure
         ensure
           client.close
           client.close
         end
         end
-        ['application/json; charset=utf-8', results.to_json] 
+        ['application/json', results.to_json]
       end
       end
-    [200, { 'Content-Type' => content_type }, [body]]
-  end 
+    [200, { 'Content-Type' => content_type, 'Date' => Time.now.httpdate, 'Server' => 'WebServer' }, [body]]
+  end
 end
 end

+ 13 - 13
frameworks/Ruby/rack/benchmark_config.json

@@ -4,9 +4,9 @@
     "default": {
     "default": {
       "setup_file": "run_mri_puma",
       "setup_file": "run_mri_puma",
       "json_url": "/json",
       "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/queries?queries=", 
-      "update_url": "/updates?queries=", 
+      "db_url": "/db",
+      "query_url": "/queries?queries=",
+      "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
       "approach": "Stripped",
       "approach": "Stripped",
@@ -23,11 +23,11 @@
       "notes": ""
       "notes": ""
     },
     },
     "thin": {
     "thin": {
-      "setup_file": "run_thin",
+      "setup_file": "run_mri_thin",
       "json_url": "/json",
       "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/queries?queries=", 
-      "update_url": "/updates?queries=", 
+      "db_url": "/db",
+      "query_url": "/queries?queries=",
+      "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
       "approach": "Stripped",
       "approach": "Stripped",
@@ -40,15 +40,15 @@
       "webserver": "Thin",
       "webserver": "Thin",
       "os": "Linux",
       "os": "Linux",
       "database_os": "Linux",
       "database_os": "Linux",
-      "display_name": "rack-thin",
+      "display_name": "rack-thin-mri",
       "notes": ""
       "notes": ""
     },
     },
     "unicorn": {
     "unicorn": {
-      "setup_file": "run_unicorn",
+      "setup_file": "run_mri_unicorn",
       "json_url": "/json",
       "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/queries?queries=", 
-      "update_url": "/updates?queries=", 
+      "db_url": "/db",
+      "query_url": "/queries?queries=",
+      "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
       "approach": "Stripped",
       "approach": "Stripped",
@@ -61,7 +61,7 @@
       "webserver": "Unicorn",
       "webserver": "Unicorn",
       "os": "Linux",
       "os": "Linux",
       "database_os": "Linux",
       "database_os": "Linux",
-      "display_name": "rack-unicorn",
+      "display_name": "rack-unicorn-mri",
       "notes": ""
       "notes": ""
     }
     }
   }]
   }]

+ 2 - 1
frameworks/Ruby/rack/config.ru

@@ -1,5 +1,6 @@
 Bundler.require :default
 Bundler.require :default
 require 'erb'
 require 'erb'
+require 'yaml'
 
 
 $: << "."
 $: << "."
 
 
@@ -11,4 +12,4 @@ if RUBY_PLATFORM == 'java'
 else
 else
  require 'app/ruby_impl'
  require 'app/ruby_impl'
  run App::Ruby
  run App::Ruby
-end
+end

+ 1 - 1
frameworks/Ruby/rack/run_mri_puma.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.2
+fw_depends mysql rvm ruby-2.4
 
 
 sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 

+ 1 - 1
frameworks/Ruby/rack/run_thin.sh → frameworks/Ruby/rack/run_mri_thin.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.2
+fw_depends mysql rvm ruby-2.4
 
 
 sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 

+ 1 - 1
frameworks/Ruby/rack/run_unicorn.sh → frameworks/Ruby/rack/run_mri_unicorn.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm nginx ruby-2.2
+fw_depends mysql rvm nginx ruby-2.4
 
 
 sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf

+ 10 - 10
frameworks/Ruby/rails/Gemfile

@@ -1,20 +1,20 @@
 source 'http://rubygems.org'
 source 'http://rubygems.org'
 
 
 platforms :jruby do
 platforms :jruby do
-  gem "activerecord-jdbcmysql-adapter", "~> 1.3.9", :require => false
-  gem 'torqbox', '0.1.7'
-  gem "trinidad", '1.4.6'
+  gem 'activerecord-jdbcmysql-adapter', '~> 1.3.9', :require => false
+  gem 'torquebox', '3.2.0'
+  gem 'trinidad', '1.4.6'
 end
 end
 
 
 platforms :ruby do
 platforms :ruby do
-  gem 'mysql2', '0.3.16'
-  gem "unicorn", '4.8.3'
-  gem "thin", '1.6.2'
+  gem 'mysql2', '0.4.5'
+  gem 'unicorn', '5.3.0'
+  gem 'thin', '1.7.0'
 end
 end
 
 
-gem "puma", '2.9.0'
+gem 'puma', '3.8.2'
 
 
-gem "activerecord-import", '0.5.0'
-gem 'activerecord', '4.1.4', :require => 'active_record'
+gem 'activerecord-import', '0.18.1'
+gem 'activerecord', '5.1.0', :require => 'active_record'
 
 
-gem 'rails', '~> 4.1.4'
+gem 'rails', '~> 5.1.0'

+ 158 - 94
frameworks/Ruby/rails/Gemfile.lock

@@ -1,128 +1,192 @@
 GEM
 GEM
   remote: http://rubygems.org/
   remote: http://rubygems.org/
   specs:
   specs:
-    actionmailer (4.1.4)
-      actionpack (= 4.1.4)
-      actionview (= 4.1.4)
-      mail (~> 2.5.4)
-    actionpack (4.1.4)
-      actionview (= 4.1.4)
-      activesupport (= 4.1.4)
-      rack (~> 1.5.2)
-      rack-test (~> 0.6.2)
-    actionview (4.1.4)
-      activesupport (= 4.1.4)
+    actioncable (5.1.0)
+      actionpack (= 5.1.0)
+      nio4r (~> 2.0)
+      websocket-driver (~> 0.6.1)
+    actionmailer (5.1.0)
+      actionpack (= 5.1.0)
+      actionview (= 5.1.0)
+      activejob (= 5.1.0)
+      mail (~> 2.5, >= 2.5.4)
+      rails-dom-testing (~> 2.0)
+    actionpack (5.1.0)
+      actionview (= 5.1.0)
+      activesupport (= 5.1.0)
+      rack (~> 2.0)
+      rack-test (~> 0.6.3)
+      rails-dom-testing (~> 2.0)
+      rails-html-sanitizer (~> 1.0, >= 1.0.2)
+    actionview (5.1.0)
+      activesupport (= 5.1.0)
       builder (~> 3.1)
       builder (~> 3.1)
-      erubis (~> 2.7.0)
-    activemodel (4.1.4)
-      activesupport (= 4.1.4)
-      builder (~> 3.1)
-    activerecord (4.1.4)
-      activemodel (= 4.1.4)
-      activesupport (= 4.1.4)
-      arel (~> 5.0.0)
-    activerecord-import (0.5.0)
-      activerecord (>= 3.0)
-    activerecord-jdbc-adapter (1.3.21)
+      erubi (~> 1.4)
+      rails-dom-testing (~> 2.0)
+      rails-html-sanitizer (~> 1.0, >= 1.0.3)
+    activejob (5.1.0)
+      activesupport (= 5.1.0)
+      globalid (>= 0.3.6)
+    activemodel (5.1.0)
+      activesupport (= 5.1.0)
+    activerecord (5.1.0)
+      activemodel (= 5.1.0)
+      activesupport (= 5.1.0)
+      arel (~> 8.0)
+    activerecord-import (0.18.1)
+      activerecord (>= 3.2)
+    activerecord-jdbc-adapter (1.3.22)
       activerecord (>= 2.2)
       activerecord (>= 2.2)
-    activerecord-jdbcmysql-adapter (1.3.21)
-      activerecord-jdbc-adapter (~> 1.3.21)
+    activerecord-jdbcmysql-adapter (1.3.22)
+      activerecord-jdbc-adapter (~> 1.3.22)
       jdbc-mysql (>= 5.1.22)
       jdbc-mysql (>= 5.1.22)
-    activesupport (4.1.4)
-      i18n (~> 0.6, >= 0.6.9)
-      json (~> 1.7, >= 1.7.7)
+    activesupport (5.1.0)
+      concurrent-ruby (~> 1.0, >= 1.0.2)
+      i18n (~> 0.7)
       minitest (~> 5.1)
       minitest (~> 5.1)
-      thread_safe (~> 0.1)
       tzinfo (~> 1.1)
       tzinfo (~> 1.1)
-    arel (5.0.1.20140414130214)
-    builder (3.2.2)
-    concurrent-ruby (1.0.2)
-    concurrent-ruby (1.0.2-java)
+    arel (8.0.0)
+    blankslate (2.1.2.4)
+    builder (3.2.3)
+    concurrent-ruby (1.0.5)
+    concurrent-ruby (1.0.5-java)
     daemons (1.2.4)
     daemons (1.2.4)
-    erubis (2.7.0)
-    eventmachine (1.2.0.1)
-    i18n (0.7.0)
-    jdbc-mysql (5.1.38)
+    edn (1.0.0)
+      parslet (~> 1.4.0)
+    erubi (1.6.0)
+    eventmachine (1.2.3)
+    globalid (0.4.0)
+      activesupport (>= 4.2.0)
+    i18n (0.8.1)
+    jdbc-mysql (5.1.40)
     jruby-rack (1.1.20)
     jruby-rack (1.1.20)
-    json (1.8.3)
-    json (1.8.3-java)
-    kgio (2.10.0)
-    mail (2.5.4)
-      mime-types (~> 1.16)
-      treetop (~> 1.4.8)
-    mime-types (1.25.1)
-    minitest (5.9.0)
-    mysql2 (0.3.16)
-    polyglot (0.3.5)
-    puma (2.9.0)
-      rack (>= 1.1, < 2.0)
-    puma (2.9.0-java)
-      rack (>= 1.1, < 2.0)
-    rack (1.5.5)
+    kgio (2.11.0)
+    loofah (2.0.3)
+      nokogiri (>= 1.5.9)
+    mail (2.6.5)
+      mime-types (>= 1.16, < 4)
+    method_source (0.8.2)
+    mime-types (3.1)
+      mime-types-data (~> 3.2015)
+    mime-types-data (3.2016.0521)
+    mini_portile2 (2.1.0)
+    minitest (5.10.1)
+    mysql2 (0.4.5)
+    nio4r (2.0.0)
+    nio4r (2.0.0-java)
+    nokogiri (1.7.1)
+      mini_portile2 (~> 2.1.0)
+    nokogiri (1.7.1-java)
+    parslet (1.4.0)
+      blankslate (~> 2.0)
+    puma (3.8.2)
+    puma (3.8.2-java)
+    rack (2.0.1)
     rack-test (0.6.3)
     rack-test (0.6.3)
       rack (>= 1.0)
       rack (>= 1.0)
-    rails (4.1.4)
-      actionmailer (= 4.1.4)
-      actionpack (= 4.1.4)
-      actionview (= 4.1.4)
-      activemodel (= 4.1.4)
-      activerecord (= 4.1.4)
-      activesupport (= 4.1.4)
+    rails (5.1.0)
+      actioncable (= 5.1.0)
+      actionmailer (= 5.1.0)
+      actionpack (= 5.1.0)
+      actionview (= 5.1.0)
+      activejob (= 5.1.0)
+      activemodel (= 5.1.0)
+      activerecord (= 5.1.0)
+      activesupport (= 5.1.0)
       bundler (>= 1.3.0, < 2.0)
       bundler (>= 1.3.0, < 2.0)
-      railties (= 4.1.4)
-      sprockets-rails (~> 2.0)
-    railties (4.1.4)
-      actionpack (= 4.1.4)
-      activesupport (= 4.1.4)
+      railties (= 5.1.0)
+      sprockets-rails (>= 2.0.0)
+    rails-dom-testing (2.0.2)
+      activesupport (>= 4.2.0, < 6.0)
+      nokogiri (~> 1.6)
+    rails-html-sanitizer (1.0.3)
+      loofah (~> 2.0)
+    railties (5.1.0)
+      actionpack (= 5.1.0)
+      activesupport (= 5.1.0)
+      method_source
       rake (>= 0.8.7)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
       thor (>= 0.18.1, < 2.0)
-    raindrops (0.17.0)
-    rake (11.2.2)
-    sprockets (3.7.0)
+    raindrops (0.18.0)
+    rake (12.0.0)
+    sprockets (3.7.1)
       concurrent-ruby (~> 1.0)
       concurrent-ruby (~> 1.0)
       rack (> 1, < 3)
       rack (> 1, < 3)
-    sprockets-rails (2.3.3)
-      actionpack (>= 3.0)
-      activesupport (>= 3.0)
-      sprockets (>= 2.8, < 4.0)
-    thin (1.6.2)
-      daemons (>= 1.0.9)
-      eventmachine (>= 1.0.0)
-      rack (>= 1.0.0)
-    thor (0.19.1)
-    thread_safe (0.3.5)
-    thread_safe (0.3.5-java)
-    torqbox (0.1.7-java)
-      rack (>= 1.4.0, < 2.0)
-    treetop (1.4.15)
-      polyglot
-      polyglot (>= 0.3.1)
+    sprockets-rails (3.2.0)
+      actionpack (>= 4.0)
+      activesupport (>= 4.0)
+      sprockets (>= 3.0.0)
+    thin (1.7.0)
+      daemons (~> 1.0, >= 1.0.9)
+      eventmachine (~> 1.0, >= 1.0.4)
+      rack (>= 1, < 3)
+    thor (0.19.4)
+    thread_safe (0.3.6)
+    thread_safe (0.3.6-java)
+    torquebox (3.2.0)
+      thor (>= 0.14.6)
+      torquebox-cache (= 3.2.0)
+      torquebox-configure (= 3.2.0)
+      torquebox-core (= 3.2.0)
+      torquebox-messaging (= 3.2.0)
+      torquebox-naming (= 3.2.0)
+      torquebox-rake-support (= 3.2.0)
+      torquebox-security (= 3.2.0)
+      torquebox-stomp (= 3.2.0)
+      torquebox-transactions (= 3.2.0)
+      torquebox-web (= 3.2.0)
+    torquebox-cache (3.2.0-java)
+      torquebox-core (= 3.2.0)
+      torquebox-transactions (= 3.2.0)
+    torquebox-configure (3.2.0-java)
+      blankslate (= 2.1.2.4)
+    torquebox-core (3.2.0-java)
+      edn (= 1.0.0)
+    torquebox-messaging (3.2.0-java)
+      torquebox-core (= 3.2.0)
+      torquebox-transactions (= 3.2.0)
+    torquebox-naming (3.2.0-java)
+      torquebox-core (= 3.2.0)
+    torquebox-rake-support (3.2.0)
+      rake (>= 0.8.7)
+    torquebox-security (3.2.0-java)
+      torquebox-core (= 3.2.0)
+    torquebox-stomp (3.2.0)
+      torquebox-core (= 3.2.0)
+      torquebox-messaging (= 3.2.0)
+    torquebox-transactions (3.2.0)
+      torquebox-core (= 3.2.0)
+    torquebox-web (3.2.0-java)
     trinidad (1.4.6)
     trinidad (1.4.6)
       jruby-rack (~> 1.1.13)
       jruby-rack (~> 1.1.13)
       trinidad_jars (>= 1.3.0, < 1.5.0)
       trinidad_jars (>= 1.3.0, < 1.5.0)
     trinidad_jars (1.4.2)
     trinidad_jars (1.4.2)
-    tzinfo (1.2.2)
+    tzinfo (1.2.3)
       thread_safe (~> 0.1)
       thread_safe (~> 0.1)
-    unicorn (4.8.3)
+    unicorn (5.3.0)
       kgio (~> 2.6)
       kgio (~> 2.6)
-      rack
       raindrops (~> 0.7)
       raindrops (~> 0.7)
+    websocket-driver (0.6.5)
+      websocket-extensions (>= 0.1.0)
+    websocket-driver (0.6.5-java)
+      websocket-extensions (>= 0.1.0)
+    websocket-extensions (0.1.2)
 
 
 PLATFORMS
 PLATFORMS
   java
   java
   ruby
   ruby
 
 
 DEPENDENCIES
 DEPENDENCIES
-  activerecord (= 4.1.4)
-  activerecord-import (= 0.5.0)
+  activerecord (= 5.1.0)
+  activerecord-import (= 0.18.1)
   activerecord-jdbcmysql-adapter (~> 1.3.9)
   activerecord-jdbcmysql-adapter (~> 1.3.9)
-  mysql2 (= 0.3.16)
-  puma (= 2.9.0)
-  rails (~> 4.1.4)
-  thin (= 1.6.2)
-  torqbox (= 0.1.7)
+  mysql2 (= 0.4.5)
+  puma (= 3.8.2)
+  rails (~> 5.1.0)
+  thin (= 1.7.0)
+  torquebox (= 3.2.0)
   trinidad (= 1.4.6)
   trinidad (= 1.4.6)
-  unicorn (= 4.8.3)
+  unicorn (= 5.3.0)
 
 
 BUNDLED WITH
 BUNDLED WITH
-   1.13.1
+   1.14.3

+ 7 - 3
frameworks/Ruby/rails/app/controllers/hello_world_controller.rb

@@ -1,14 +1,17 @@
 class HelloWorldController < ApplicationController
 class HelloWorldController < ApplicationController
 
 
   def plaintext
   def plaintext
+    response.headers['Content-Type'] = "text/plain"
     render :plain => "Hello, World!"
     render :plain => "Hello, World!"
   end
   end
 
 
   def json
   def json
+    response.headers['Content-Type'] = "application/json"
     render :json => {:message => "Hello, World!"}
     render :json => {:message => "Hello, World!"}
   end
   end
 
 
   def db
   def db
+    response.headers['Content-Type'] = "application/json"
     render :json => World.find(Random.rand(10000) + 1)
     render :json => World.find(Random.rand(10000) + 1)
   end
   end
 
 
@@ -20,11 +23,12 @@ class HelloWorldController < ApplicationController
     results = (1..queries).map do
     results = (1..queries).map do
       World.find(Random.rand(10000) + 1)
       World.find(Random.rand(10000) + 1)
     end
     end
+    response.headers['Content-Type'] = "application/json"
     render :json => results
     render :json => results
   end
   end
-  
+
   def fortune
   def fortune
-    @fortunes = Fortune.all
+    @fortunes = Fortune.all.to_a
     @fortunes << Fortune.new(:id => 0, :message => "Additional fortune added at request time.")
     @fortunes << Fortune.new(:id => 0, :message => "Additional fortune added at request time.")
     @fortunes = @fortunes.sort_by { |x| x.message }
     @fortunes = @fortunes.sort_by { |x| x.message }
   end
   end
@@ -41,7 +45,7 @@ class HelloWorldController < ApplicationController
       world.update_attribute(:randomNumber, Random.rand(10000) + 1)
       world.update_attribute(:randomNumber, Random.rand(10000) + 1)
       world
       world
     end
     end
-
+    response.headers['Content-Type'] = "application/json"
     render :json => worlds
     render :json => worlds
   end
   end
 end
 end

+ 6 - 6
frameworks/Ruby/rails/benchmark_config.json

@@ -25,7 +25,7 @@
       "versus": "rack-puma-mri"
       "versus": "rack-puma-mri"
     },
     },
     "thin": {
     "thin": {
-      "setup_file": "run_thin",
+      "setup_file": "run_mri_thin",
       "json_url": "/hello_world/json",
       "json_url": "/hello_world/json",
       "db_url": "/hello_world/db",
       "db_url": "/hello_world/db",
       "query_url": "/hello_world/query?queries=",
       "query_url": "/hello_world/query?queries=",
@@ -43,12 +43,12 @@
       "webserver": "Thin",
       "webserver": "Thin",
       "os": "Linux",
       "os": "Linux",
       "database_os": "Linux",
       "database_os": "Linux",
-      "display_name": "rails-thin",
+      "display_name": "rails-thin-mri",
       "notes": "",
       "notes": "",
-      "versus": "rack-thin"
+      "versus": "rack-thin-mri"
     },
     },
     "unicorn": {
     "unicorn": {
-      "setup_file": "run_unicorn",
+      "setup_file": "run_mri_unicorn",
       "json_url": "/hello_world/json",
       "json_url": "/hello_world/json",
       "db_url": "/hello_world/db",
       "db_url": "/hello_world/db",
       "query_url": "/hello_world/query?queries=",
       "query_url": "/hello_world/query?queries=",
@@ -66,9 +66,9 @@
       "webserver": "Unicorn",
       "webserver": "Unicorn",
       "os": "Linux",
       "os": "Linux",
       "database_os": "Linux",
       "database_os": "Linux",
-      "display_name": "rails-unicorn",
+      "display_name": "rails-unicorn-mri",
       "notes": "",
       "notes": "",
-      "versus": "rack-unicorn"
+      "versus": "rack-unicorn-mri"
     }
     }
   }]
   }]
 }
 }

+ 3 - 1
frameworks/Ruby/rails/config/application.rb

@@ -19,5 +19,7 @@ module Hello
     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
     # config.i18n.default_locale = :de
     # config.i18n.default_locale = :de
+
+    config.action_dispatch.default_headers.merge!('Date' => Time.now.httpdate, 'Server' => 'WebServer')
   end
   end
-end
+end

+ 1 - 1
frameworks/Ruby/rails/run_mri_puma.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.1
+fw_depends mysql rvm ruby-2.4
 
 
 rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
 rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
 
 

+ 1 - 1
frameworks/Ruby/rails/run_thin.sh → frameworks/Ruby/rails/run_mri_thin.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.1
+fw_depends mysql rvm ruby-2.4
 
 
 rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
 rvm ruby-$MRI_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
 
 

+ 1 - 1
frameworks/Ruby/rails/run_unicorn.sh → frameworks/Ruby/rails/run_mri_unicorn.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends mysql rvm ruby-2.1 nginx
+fw_depends mysql rvm ruby-2.4 nginx
 
 
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 
 

+ 1 - 1
frameworks/Ruby/sinatra/config/auto_tune.rb

@@ -23,7 +23,7 @@ def meminfo(arg)
 end
 end
 
 
 def auto_tune
 def auto_tune
-  avail_mem = meminfo('MemAvailable') * 0.8 - MAX_THREADS * 1_024
+  avail_mem = meminfo('MemFree') * 0.8 - MAX_THREADS * 1_024
 
 
   workers = [
   workers = [
     [(1.0 * avail_mem / KB_PER_WORKER).floor, MIN_WORKERS].max,
     [(1.0 * avail_mem / KB_PER_WORKER).floor, MIN_WORKERS].max,