Browse Source

Ruby fixes (#2279)

Nate 9 years ago
parent
commit
1bb9fbc3c8
32 changed files with 656 additions and 81 deletions
  1. 112 0
      frameworks/Ruby/grape/Gemfile.lock
  2. 2 2
      frameworks/Ruby/grape/config.ru
  3. 1 1
      frameworks/Ruby/grape/run_rbx_puma.sh
  4. 0 1
      frameworks/Ruby/padrino/.gitignore
  5. 121 0
      frameworks/Ruby/padrino/Gemfile.lock
  6. 3 6
      frameworks/Ruby/padrino/app/controllers.rb
  7. 0 23
      frameworks/Ruby/padrino/benchmark_config.json
  8. 1 1
      frameworks/Ruby/padrino/run_mri_puma.sh
  9. 0 7
      frameworks/Ruby/padrino/run_rbx_puma.sh
  10. 1 1
      frameworks/Ruby/padrino/run_thin.sh
  11. 1 1
      frameworks/Ruby/padrino/run_unicorn.sh
  12. 0 1
      frameworks/Ruby/rack/.gitignore
  13. 37 0
      frameworks/Ruby/rack/Gemfile.lock
  14. 3 6
      frameworks/Ruby/rack/app/ruby_impl.rb
  15. 1 1
      frameworks/Ruby/rack/run_mri_puma.sh
  16. 1 1
      frameworks/Ruby/rack/run_rbx_puma.sh
  17. 1 1
      frameworks/Ruby/rack/run_thin.sh
  18. 0 9
      frameworks/Ruby/rack/run_torqbox.sh
  19. 0 9
      frameworks/Ruby/rack/run_trinidad.sh
  20. 1 1
      frameworks/Ruby/rack/run_unicorn.sh
  21. 113 0
      frameworks/Ruby/rails-stripped/Gemfile.lock
  22. 0 1
      frameworks/Ruby/rails/.gitignore
  23. 128 0
      frameworks/Ruby/rails/Gemfile.lock
  24. 3 2
      frameworks/Ruby/rails/app/controllers/hello_world_controller.rb
  25. 1 1
      frameworks/Ruby/rails/run_rbx_puma.sh
  26. 0 1
      frameworks/Ruby/sinatra-sequel/.gitignore
  27. 34 0
      frameworks/Ruby/sinatra-sequel/Gemfile.lock
  28. 0 1
      frameworks/Ruby/sinatra/.gitignore
  29. 88 0
      frameworks/Ruby/sinatra/Gemfile.lock
  30. 1 1
      frameworks/Ruby/sinatra/hello_world.rb
  31. 1 1
      frameworks/Ruby/sinatra/run_rbx_puma.sh
  32. 1 1
      toolset/setup/linux/languages/ruby-2.2.sh

+ 112 - 0
frameworks/Ruby/grape/Gemfile.lock

@@ -0,0 +1,112 @@
+GEM
+  remote: http://rubygems.org/
+  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)
+      activerecord (>= 2.2)
+    activerecord-jdbcmysql-adapter (1.3.21)
+      activerecord-jdbc-adapter (~> 1.3.21)
+      jdbc-mysql (>= 5.1.22)
+    activesupport (4.1.4)
+      i18n (~> 0.6, >= 0.6.9)
+      json (~> 1.7, >= 1.7.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.1)
+      tzinfo (~> 1.1)
+    arel (5.0.1.20140414130214)
+    axiom-types (0.1.1)
+      descendants_tracker (~> 0.0.4)
+      ice_nine (~> 0.11.0)
+      thread_safe (~> 0.3, >= 0.3.1)
+    builder (3.2.2)
+    coercible (1.0.0)
+      descendants_tracker (~> 0.0.1)
+    daemons (1.2.4)
+    descendants_tracker (0.0.4)
+      thread_safe (~> 0.3, >= 0.3.1)
+    equalizer (0.0.11)
+    eventmachine (1.2.0.1)
+    grape (0.8.0)
+      activesupport
+      builder
+      hashie (>= 2.1.0)
+      multi_json (>= 1.3.2)
+      multi_xml (>= 0.5.2)
+      rack (>= 1.3.0)
+      rack-accept
+      rack-mount
+      virtus (>= 1.0.0)
+    hashie (3.4.4)
+    i18n (0.7.0)
+    ice_nine (0.11.2)
+    jdbc-mysql (5.1.38)
+    jruby-rack (1.1.20)
+    json (1.8.1)
+    json (1.8.1-java)
+    kgio (2.10.0)
+    minitest (5.9.0)
+    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)
+    rack-accept (0.4.5)
+      rack (>= 0.4)
+    rack-mount (0.8.3)
+      rack (>= 1.0.0)
+    raindrops (0.17.0)
+    thin (1.6.4)
+      daemons (~> 1.0, >= 1.0.9)
+      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)
+    trinidad (1.4.6)
+      jruby-rack (~> 1.1.13)
+      trinidad_jars (>= 1.3.0, < 1.5.0)
+    trinidad_jars (1.4.2)
+    tzinfo (1.2.2)
+      thread_safe (~> 0.1)
+    unicorn (4.8.3)
+      kgio (~> 2.6)
+      rack
+      raindrops (~> 0.7)
+    virtus (1.0.5)
+      axiom-types (~> 0.1)
+      coercible (~> 1.0)
+      descendants_tracker (~> 0.0, >= 0.0.3)
+      equalizer (~> 0.0, >= 0.0.9)
+
+PLATFORMS
+  java
+  ruby
+
+DEPENDENCIES
+  activerecord (= 4.1.4)
+  activerecord-import (~> 0.5.0)
+  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)
+  trinidad (= 1.4.6)
+  unicorn (= 4.8.3)
+
+BUNDLED WITH
+   1.13.1

+ 2 - 2
frameworks/Ruby/grape/config.ru

@@ -48,14 +48,14 @@ module Acme
       queries = params[:queries].to_i
       queries = 1 if queries < 1
       queries = 500 if queries > 500
-
+      
       ActiveRecord::Base.connection_pool.with_connection do
         worlds = (1..queries).map do
           world = World.find(Random.rand(10000) + 1)
           world.randomNumber = Random.rand(10000) + 1
+          World.update(world.id, :randomNumber => world.randomNumber)
           world
         end
-        World.import worlds, :on_duplicate_key_update => [:randomNumber]
         worlds
       end
     end

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

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

+ 0 - 1
frameworks/Ruby/padrino/.gitignore

@@ -1,4 +1,3 @@
 .bundle
 vendor/bundle
-/Gemfile.lock
 /tmp/

+ 121 - 0
frameworks/Ruby/padrino/Gemfile.lock

@@ -0,0 +1,121 @@
+GEM
+  remote: http://rubygems.org/
+  specs:
+    activesupport (5.0.0.1)
+      concurrent-ruby (~> 1.0, >= 1.0.2)
+      i18n (~> 0.7)
+      minitest (~> 5.1)
+      tzinfo (~> 1.1)
+    addressable (2.4.0)
+    concurrent-ruby (1.0.2)
+    daemons (1.2.4)
+    data_objects (0.10.17)
+      addressable (~> 2.1)
+    dm-core (1.2.1)
+      addressable (~> 2.3)
+    dm-do-adapter (1.2.0)
+      data_objects (~> 0.10.6)
+      dm-core (~> 1.2.0)
+    dm-mysql-adapter (1.2.0)
+      dm-do-adapter (~> 1.2.0)
+      do_mysql (~> 0.10.6)
+    do_mysql (0.10.17)
+      data_objects (= 0.10.17)
+    eventmachine (1.2.0.1)
+    http_router (0.11.2)
+      rack (>= 1.0.0)
+      url_mount (~> 0.2.1)
+    i18n (0.7.0)
+    json (1.8.1)
+    kgio (2.10.0)
+    mail (2.6.4)
+      mime-types (>= 1.16, < 4)
+    mime-types (2.99.3)
+    minitest (5.9.0)
+    moneta (0.7.20)
+    mysql2 (0.3.16)
+    padrino (0.12.8)
+      padrino-admin (= 0.12.8)
+      padrino-cache (= 0.12.8)
+      padrino-core (= 0.12.8)
+      padrino-gen (= 0.12.8)
+      padrino-helpers (= 0.12.8)
+      padrino-mailer (= 0.12.8)
+      padrino-support (= 0.12.8)
+    padrino-admin (0.12.8)
+      padrino-core (= 0.12.8)
+      padrino-helpers (= 0.12.8)
+    padrino-cache (0.12.8)
+      moneta (~> 0.7.0)
+      padrino-core (= 0.12.8)
+      padrino-helpers (= 0.12.8)
+    padrino-core (0.12.8)
+      activesupport (>= 3.1)
+      http_router (~> 0.11.0)
+      padrino-support (= 0.12.8)
+      rack (< 1.6.0)
+      rack-protection (>= 1.5.0)
+      sinatra (~> 1.4.2)
+      thor (~> 0.18)
+    padrino-gen (0.12.8)
+      bundler (~> 1.0)
+      padrino-core (= 0.12.8)
+    padrino-helpers (0.12.8)
+      i18n (~> 0.6, >= 0.6.7)
+      padrino-support (= 0.12.8)
+      tilt (~> 1.4.1)
+    padrino-mailer (0.12.8)
+      mail (~> 2.5)
+      mime-types (< 3)
+      padrino-core (= 0.12.8)
+    padrino-support (0.12.8)
+      activesupport (>= 3.1)
+    puma (2.9.0)
+      rack (>= 1.1, < 2.0)
+    rack (1.5.5)
+    rack-protection (1.5.3)
+      rack
+    raindrops (0.17.0)
+    sinatra (1.4.7)
+      rack (~> 1.5)
+      rack-protection (~> 1.4)
+      tilt (>= 1.3, < 3)
+    slim (2.0.3)
+      temple (~> 0.6.6)
+      tilt (>= 1.3.3, < 2.1)
+    temple (0.6.10)
+    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)
+    tilt (1.4.1)
+    tzinfo (1.2.2)
+      thread_safe (~> 0.1)
+    unicorn (4.8.3)
+      kgio (~> 2.6)
+      rack
+      raindrops (~> 0.7)
+    url_mount (0.2.1)
+      rack
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  dm-core (= 1.2.1)
+  dm-mysql-adapter (= 1.2.0)
+  jdbc-mysql (= 5.1.38)
+  json (= 1.8.1)
+  mysql2 (= 0.3.16)
+  padrino (~> 0.12.3)
+  puma (= 2.9.0)
+  slim (= 2.0.3)
+  thin (= 1.6.2)
+  torqbox (= 0.1.7)
+  trinidad (= 1.4.6)
+  unicorn (= 4.8.3)
+
+BUNDLED WITH
+   1.13.1

+ 3 - 6
frameworks/Ruby/padrino/app/controllers.rb

@@ -32,17 +32,13 @@ HelloWorld::App.controllers  do
     queries = 500 if queries > 500
 
     worlds = (1..queries).map do
+      # get a random row from the database, which we know has 10000
+      # rows with ids 1 - 10000
       world = World.get(Random.rand(10000) + 1)
       world.update(:randomNumber => Random.rand(10000) + 1)
       world.attributes
     end
 
-    #mass update
-    values = worlds.map { |h| ['(', h[:id], ',' , h[:randomNumber], ')', ','] }.flatten[0..-2].join
-    sql = "INSERT INTO `World` (`id`,`randomNumber`) VALUES #{values} ON DUPLICATE KEY UPDATE `World`.`randomNumber` = VALUES(`randomNumber`)"
-    adapter = DataMapper.repository(:default).adapter
-    adapter.execute(sql)
-    
     worlds.to_json
   end
 
@@ -52,3 +48,4 @@ HelloWorld::App.controllers  do
   end
 
 end
+

+ 0 - 23
frameworks/Ruby/padrino/benchmark_config.json

@@ -24,29 +24,6 @@
       "notes": "",
       "versus": "rack-puma-mri"
     },
-    "puma-rbx": {
-      "setup_file": "run_rbx_puma",
-      "json_url": "/json",
-      "db_url": "/db", 
-      "query_url": "/queries?queries=", 
-      "fortune_url": "/fortunes",
-      "update_url": "/updates?queries=", 
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "padrino",
-      "language": "Ruby",
-      "orm": "Full",
-      "platform": "Rubinius",
-      "webserver": "Puma",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "padrino-rbx",
-      "notes": "",
-      "versus": "rack-puma-rbx"
-    },
     "thin": {
       "setup_file": "run_thin",
       "json_url": "/json",

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

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

+ 0 - 7
frameworks/Ruby/padrino/run_rbx_puma.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends rvm rbx-2.4
-
-rvm rbx-$RBX_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
-
-DB_HOST=${DBHOST} rvm rbx-$RBX_VERSION do bundle exec puma &

+ 1 - 1
frameworks/Ruby/padrino/run_thin.sh

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

+ 1 - 1
frameworks/Ruby/padrino/run_unicorn.sh

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

+ 0 - 1
frameworks/Ruby/rack/.gitignore

@@ -1,4 +1,3 @@
 .bundle
 /vendor/
 /tmp/
-/Gemfile.lock

+ 37 - 0
frameworks/Ruby/rack/Gemfile.lock

@@ -0,0 +1,37 @@
+GEM
+  remote: http://rubygems.org/
+  specs:
+    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)
+      daemons (~> 1.0, >= 1.0.9)
+      eventmachine (~> 1.0, >= 1.0.4)
+      rack (~> 1.0)
+    unicorn (4.8.3)
+      kgio (~> 2.6)
+      rack
+      raindrops (~> 0.7)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  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)
+  trinidad (= 1.4.6)
+  unicorn (= 4.8.3)
+
+BUNDLED WITH
+   1.13.1

+ 3 - 6
frameworks/Ruby/rack/app/ruby_impl.rb

@@ -42,14 +42,11 @@ module App
         results = begin
           results = (1..queries).map do
             id = Random.rand(10000) + 1
+            num = Random.rand(10000) + 1
+            client.query("UPDATE World SET randomNumber = " + num.to_s + " WHERE id = " + id.to_s)
             client.query("SELECT * FROM World WHERE id = " + id.to_s).first
           end
 
-          #mass update
-          values = results.map { |h| ['(', h['id'], ',' ,Random.rand(10000) + 1, ')', ','] }.flatten[0..-2].join
-          sql = "INSERT INTO `World` (`id`,`randomNumber`) VALUES #{values} ON DUPLICATE KEY UPDATE `World`.`randomNumber` = VALUES(`randomNumber`)"
-          client.query(sql)
-
           results
         ensure
           client.close
@@ -58,4 +55,4 @@ module App
       end
     [200, { 'Content-Type' => content_type }, [body]]
   end 
-end
+end

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

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

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

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

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

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

+ 0 - 9
frameworks/Ruby/rack/run_torqbox.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends rvm jruby-1.7
-
-sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
-
-rvm jruby-$JRUBY_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
-
-rvm jruby-$JRUBY_VERSION do bundle exec torqbox -b 0.0.0.0 -E production &

+ 0 - 9
frameworks/Ruby/rack/run_trinidad.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends rvm jruby-1.7
-
-sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
-
-rvm jruby-$JRUBY_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
-
-rvm jruby-$JRUBY_VERSION do bundle exec trinidad --config config/trinidad.yml &

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

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

+ 113 - 0
frameworks/Ruby/rails-stripped/Gemfile.lock

@@ -0,0 +1,113 @@
+GEM
+  remote: http://rubygems.org/
+  specs:
+    actionmailer (3.2.18)
+      actionpack (= 3.2.18)
+      mail (~> 2.5.4)
+    actionpack (3.2.18)
+      activemodel (= 3.2.18)
+      activesupport (= 3.2.18)
+      builder (~> 3.0.0)
+      erubis (~> 2.7.0)
+      journey (~> 1.0.4)
+      rack (~> 1.4.5)
+      rack-cache (~> 1.2)
+      rack-test (~> 0.6.1)
+      sprockets (~> 2.2.1)
+    activemodel (3.2.18)
+      activesupport (= 3.2.18)
+      builder (~> 3.0.0)
+    activerecord (3.2.18)
+      activemodel (= 3.2.18)
+      activesupport (= 3.2.18)
+      arel (~> 3.0.2)
+      tzinfo (~> 0.3.29)
+    activerecord-jdbc-adapter (1.3.20)
+      activerecord (>= 2.2)
+    activeresource (3.2.18)
+      activemodel (= 3.2.18)
+      activesupport (= 3.2.18)
+    activesupport (3.2.18)
+      i18n (~> 0.6, >= 0.6.4)
+      multi_json (~> 1.0)
+    arel (3.0.3)
+    builder (3.0.4)
+    daemon_controller (1.2.0)
+    erubis (2.7.0)
+    hike (1.2.3)
+    i18n (0.7.0)
+    jdbc-mysql (5.1.38)
+    journey (1.0.4)
+    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)
+    multi_json (1.12.1)
+    mysql2 (0.3.16)
+    passenger (4.0.44)
+      daemon_controller (>= 1.2.0)
+      rack
+      rake (>= 0.8.1)
+    polyglot (0.3.5)
+    rack (1.4.7)
+    rack-cache (1.6.1)
+      rack (>= 0.4)
+    rack-ssl (1.3.4)
+      rack
+    rack-test (0.6.3)
+      rack (>= 1.0)
+    rails (3.2.18)
+      actionmailer (= 3.2.18)
+      actionpack (= 3.2.18)
+      activerecord (= 3.2.18)
+      activeresource (= 3.2.18)
+      activesupport (= 3.2.18)
+      bundler (~> 1.0)
+      railties (= 3.2.18)
+    railties (3.2.18)
+      actionpack (= 3.2.18)
+      activesupport (= 3.2.18)
+      rack-ssl (~> 1.3.2)
+      rake (>= 0.8.7)
+      rdoc (~> 3.4)
+      thor (>= 0.14.6, < 2.0)
+    raindrops (0.16.0)
+    rake (11.2.2)
+    rdoc (3.12.2)
+      json (~> 1.4)
+    sprockets (2.2.3)
+      hike (~> 1.2)
+      multi_json (~> 1.0)
+      rack (~> 1.0)
+      tilt (~> 1.1, != 1.3.0)
+    thor (0.19.1)
+    tilt (1.4.1)
+    torqbox (0.1.7-java)
+      rack (>= 1.4.0, < 2.0)
+    treetop (1.4.15)
+      polyglot
+      polyglot (>= 0.3.1)
+    tzinfo (0.3.51)
+    unicorn (4.8.3)
+      kgio (~> 2.6)
+      rack
+      raindrops (~> 0.7)
+
+PLATFORMS
+  java
+  ruby
+
+DEPENDENCIES
+  activerecord-jdbc-adapter (~> 1.3.7)
+  jdbc-mysql (= 5.1.38)
+  mysql2 (= 0.3.16)
+  passenger (= 4.0.44)
+  rails (= 3.2.18)
+  torqbox (= 0.1.7)
+  unicorn (= 4.8.3)
+
+BUNDLED WITH
+   1.12.5

+ 0 - 1
frameworks/Ruby/rails/.gitignore

@@ -1,4 +1,3 @@
 .bundle
 vendor/bundle
-/Gemfile.lock
 /tmp/

+ 128 - 0
frameworks/Ruby/rails/Gemfile.lock

@@ -0,0 +1,128 @@
+GEM
+  remote: http://rubygems.org/
+  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)
+      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)
+      activerecord (>= 2.2)
+    activerecord-jdbcmysql-adapter (1.3.21)
+      activerecord-jdbc-adapter (~> 1.3.21)
+      jdbc-mysql (>= 5.1.22)
+    activesupport (4.1.4)
+      i18n (~> 0.6, >= 0.6.9)
+      json (~> 1.7, >= 1.7.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.1)
+      tzinfo (~> 1.1)
+    arel (5.0.1.20140414130214)
+    builder (3.2.2)
+    concurrent-ruby (1.0.2)
+    concurrent-ruby (1.0.2-java)
+    daemons (1.2.4)
+    erubis (2.7.0)
+    eventmachine (1.2.0.1)
+    i18n (0.7.0)
+    jdbc-mysql (5.1.38)
+    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)
+    rack-test (0.6.3)
+      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)
+      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)
+      rake (>= 0.8.7)
+      thor (>= 0.18.1, < 2.0)
+    raindrops (0.17.0)
+    rake (11.2.2)
+    sprockets (3.7.0)
+      concurrent-ruby (~> 1.0)
+      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)
+    trinidad (1.4.6)
+      jruby-rack (~> 1.1.13)
+      trinidad_jars (>= 1.3.0, < 1.5.0)
+    trinidad_jars (1.4.2)
+    tzinfo (1.2.2)
+      thread_safe (~> 0.1)
+    unicorn (4.8.3)
+      kgio (~> 2.6)
+      rack
+      raindrops (~> 0.7)
+
+PLATFORMS
+  java
+  ruby
+
+DEPENDENCIES
+  activerecord (= 4.1.4)
+  activerecord-import (= 0.5.0)
+  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)
+  trinidad (= 1.4.6)
+  unicorn (= 4.8.3)
+
+BUNDLED WITH
+   1.13.1

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

@@ -39,9 +39,10 @@ class HelloWorldController < ApplicationController
       # rows with ids 1 - 10000
       world = World.find(Random.rand(10000) + 1)
       world.randomNumber = Random.rand(10000) + 1
+      World.update(world.id, :randomNumber => world.randomNumber)
       world
     end
-    World.import worlds, :on_duplicate_key_update => [:randomNumber]
+
     render :json => worlds
   end
-end
+end

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

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends rvm rbx-2.4
+fw_depends rvm rbx-2.5
 
 rvm rbx-$RBX_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
 

+ 0 - 1
frameworks/Ruby/sinatra-sequel/.gitignore

@@ -1,3 +1,2 @@
 .bundle
 vendor/bundle
-/Gemfile.lock

+ 34 - 0
frameworks/Ruby/sinatra-sequel/Gemfile.lock

@@ -0,0 +1,34 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    json (1.8.3)
+    mysql2 (0.4.4)
+    puma (2.15.3)
+    rack (1.6.4)
+    rack-protection (1.5.3)
+      rack
+    sequel (4.38.0)
+    sinatra (1.4.7)
+      rack (~> 1.5)
+      rack-protection (~> 1.4)
+      tilt (>= 1.3, < 3)
+    slim (3.0.7)
+      temple (~> 0.7.6)
+      tilt (>= 1.3.3, < 2.1)
+    temple (0.7.7)
+    tilt (2.0.5)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  jdbc-mysql (~> 5.1.38)
+  json (~> 1.8.3)
+  mysql2 (~> 0.4.0)
+  puma (~> 2.15.3)
+  sequel (~> 4.28)
+  sinatra (~> 1.4.6)
+  slim (~> 3.0.6)
+
+BUNDLED WITH
+   1.13.1

+ 0 - 1
frameworks/Ruby/sinatra/.gitignore

@@ -1,4 +1,3 @@
 .bundle
 /vendor/
 /tmp/
-/Gemfile.lock

+ 88 - 0
frameworks/Ruby/sinatra/Gemfile.lock

@@ -0,0 +1,88 @@
+GEM
+  remote: http://rubygems.org/
+  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)
+    activesupport (4.1.4)
+      i18n (~> 0.6, >= 0.6.9)
+      json (~> 1.7, >= 1.7.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.1)
+      tzinfo (~> 1.1)
+    arel (5.0.1.20140414130214)
+    backports (3.6.8)
+    builder (3.2.2)
+    daemons (1.2.4)
+    eventmachine (1.2.0.1)
+    i18n (0.7.0)
+    json (1.8.3)
+    kgio (2.10.0)
+    minitest (5.9.0)
+    multi_json (1.12.1)
+    mysql2 (0.3.16)
+    puma (2.9.0)
+      rack (>= 1.1, < 2.0)
+    rack (1.6.4)
+    rack-protection (1.5.3)
+      rack
+    rack-test (0.6.3)
+      rack (>= 1.0)
+    raindrops (0.17.0)
+    sinatra (1.4.5)
+      rack (~> 1.4)
+      rack-protection (~> 1.4)
+      tilt (~> 1.3, >= 1.3.4)
+    sinatra-activerecord (2.0.2)
+      activerecord (>= 3.2)
+      sinatra (~> 1.0)
+    sinatra-contrib (1.4.2)
+      backports (>= 2.0)
+      multi_json
+      rack-protection
+      rack-test
+      sinatra (~> 1.4.0)
+      tilt (~> 1.3)
+    slim (2.0.3)
+      temple (~> 0.6.6)
+      tilt (>= 1.3.3, < 2.1)
+    temple (0.6.10)
+    thin (1.6.2)
+      daemons (>= 1.0.9)
+      eventmachine (>= 1.0.0)
+      rack (>= 1.0.0)
+    thread_safe (0.3.5)
+    tilt (1.4.1)
+    tzinfo (1.2.2)
+      thread_safe (~> 0.1)
+    unicorn (4.8.3)
+      kgio (~> 2.6)
+      rack
+      raindrops (~> 0.7)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  activerecord (= 4.1.4)
+  activerecord-import (= 0.5.0)
+  activerecord-jdbcmysql-adapter (~> 1.3.9)
+  mysql2 (= 0.3.16)
+  puma (= 2.9.0)
+  sinatra (= 1.4.5)
+  sinatra-activerecord (= 2.0.2)
+  sinatra-contrib (= 1.4.2)
+  slim (= 2.0.3)
+  thin (= 1.6.2)
+  torqbox (= 0.1.7)
+  trinidad (= 1.4.6)
+  unicorn (= 4.8.3)
+
+BUNDLED WITH
+   1.13.1

+ 1 - 1
frameworks/Ruby/sinatra/hello_world.rb

@@ -88,9 +88,9 @@ get '/updates' do
     worlds = (1..queries).map do
       world = World.find(Random.rand(10000) + 1)
       world.randomNumber = Random.rand(10000) + 1
+      World.update(world.id, :randomNumber => world.randomNumber)
       world
     end
-    World.import worlds, :on_duplicate_key_update => [:randomNumber]
     worlds
   end
   json(worlds)

+ 1 - 1
frameworks/Ruby/sinatra/run_rbx_puma.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-fw_depends rvm rbx-2.4
+fw_depends rvm rbx-2.5
 
 rvm rbx-$RBX_VERSION do bundle install --jobs=4 --gemfile=$TROOT/Gemfile --path=vendor/bundle
 

+ 1 - 1
toolset/setup/linux/languages/ruby-2.2.sh

@@ -10,7 +10,7 @@ RETCODE=$(fw_exists ${IROOT}/ruby-2.2.installed)
 
 # rvm stable [typically] only provides one version of ruby-2.2
 # update this when it changes
-MRI_VERSION=2.2.1
+MRI_VERSION=2.2.2
 
 # We assume single-user installation as
 # done in our rvm.sh script and