From 6117f5348eda8e84b82886067d057eac44776df3 Mon Sep 17 00:00:00 2001 From: obfuscurity Date: Sun, 19 Jan 2014 22:58:37 -0500 Subject: [PATCH] bundle update all of our gems; fixes for major updates in rufus-scheduler and sequel --- Gemfile.lock | 111 ++++++++++++++++---------------- config.ru | 2 +- lib/descartes/models/init.rb | 9 ++- lib/descartes/models/metrics.rb | 3 +- 4 files changed, 66 insertions(+), 59 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4981054..0a58f87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,40 +1,37 @@ GEM remote: http://rubygems.org/ specs: - addressable (2.3.2) - coderay (1.0.8) + addressable (2.3.5) + atomic (1.1.14) + coderay (1.1.0) daemons (1.1.9) - diff-lcs (1.1.3) + diff-lcs (1.2.5) dotenv (0.9.0) eventmachine (1.0.3) - faraday (0.8.6) - multipart-post (~> 1.1) - faraday_middleware (0.9.0) - faraday (>= 0.7.4, < 0.9) - foreman (0.60.2) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + foreman (0.63.0) + dotenv (>= 0.7) thor (>= 0.13.6) - haml (3.1.7) - hashie (1.2.0) - json (1.7.5) - method_source (0.8.1) - mime-types (1.19) - multi_json (1.6.1) - multipart-post (1.2.0) - netrc (0.7.7) - nokogiri (1.5.5) - octokit (1.23.0) - addressable (~> 2.2) - faraday (~> 0.8) - faraday_middleware (~> 0.9) - hashie (~> 1.2) - multi_json (~> 1.3) - netrc (~> 0.7.7) - omniauth (1.1.1) - hashie (~> 1.2) - rack - omniauth-google-apps (0.0.2) + haml (4.0.5) + tilt + hashie (2.0.5) + json (1.8.1) + method_source (0.8.2) + mime-types (2.0) + mini_portile (0.5.2) + multipart-post (2.0.0) + nokogiri (1.6.1) + mini_portile (~> 0.5.0) + octokit (2.7.0) + sawyer (~> 0.5.2) + omniauth (1.2.1) + hashie (>= 1.2, < 3) + rack (~> 1.0) + omniauth-google-apps (0.1.0) omniauth (~> 1.0) omniauth-openid (~> 1.0) + ruby-openid (~> 2.3.0) ruby-openid-apps-discovery (~> 1.2.0) omniauth-openid (1.0.1) omniauth (~> 1.0) @@ -42,41 +39,44 @@ GEM openid-redis-store (0.0.2) redis ruby-openid - pg (0.14.1) - pry (0.9.10) - coderay (~> 1.0.5) + pg (0.17.1) + pry (0.9.12.4) + coderay (~> 1.0) method_source (~> 0.8) - slop (~> 3.3.1) - rack (1.4.1) + slop (~> 3.4) + rack (1.5.2) rack-canonical-host (0.0.8) addressable rack (~> 1.0) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-protection (1.2.0) + rack-protection (1.5.2) rack - rack-ssl-enforcer (0.2.4) + rack-ssl-enforcer (0.2.6) rack-test (0.6.2) rack (>= 1.0) - rake (0.9.2.2) - redis (3.0.2) + rake (10.1.1) + redis (3.0.6) rest-client (1.6.7) mime-types (>= 1.16) - rspec (2.11.0) - rspec-core (~> 2.11.0) - rspec-expectations (~> 2.11.0) - rspec-mocks (~> 2.11.0) - rspec-core (2.11.1) - rspec-expectations (2.11.3) - diff-lcs (~> 1.1.3) - rspec-mocks (2.11.3) - ruby-openid (2.2.2) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.7) + rspec-expectations (2.14.4) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.4) + ruby-openid (2.3.0) ruby-openid-apps-discovery (1.2.0) ruby-openid (>= 2.1.7) - rufus-scheduler (2.0.17) - tzinfo (>= 0.3.23) - sequel (3.41.0) + rufus-scheduler (3.0.4) + tzinfo + sawyer (0.5.2) + addressable (~> 2.3.5) + faraday (~> 0.8, < 0.10) + sequel (4.6.0) sinatra (1.3.1) rack (~> 1.3, >= 1.3.4) rack-protection (~> 1.1, >= 1.1.2) @@ -84,15 +84,18 @@ GEM sinatra_auth_github (0.13.3) sinatra (~> 1.0) warden-github (~> 0.13.1) - slop (3.3.3) + slop (3.4.7) thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) - thor (0.16.0) - tilt (1.3.3) - tzinfo (0.3.35) - warden (1.2.1) + thor (0.18.1) + thread_safe (0.1.3) + atomic + tilt (1.4.1) + tzinfo (1.1.0) + thread_safe (~> 0.1) + warden (1.2.3) rack (>= 1.0) warden-github (0.13.2) octokit (>= 1.22.0) diff --git a/config.ru b/config.ru index 93459f3..923216e 100644 --- a/config.ru +++ b/config.ru @@ -29,7 +29,7 @@ Metric.load unless ENV['METRICS_UPDATE_ON_BOOT'] == 'false' # update our Metrics list at regular intervals require 'rufus/scheduler' -scheduler = Rufus::Scheduler.start_new +scheduler = Rufus::Scheduler.new # kick off update after we start so as not to hit Heroku's web startup timeout scheduler.in '1m' do Metric.update diff --git a/lib/descartes/models/init.rb b/lib/descartes/models/init.rb index 203c5ae..04aeb5b 100644 --- a/lib/descartes/models/init.rb +++ b/lib/descartes/models/init.rb @@ -2,8 +2,10 @@ require 'securerandom' require 'json' -db = ENV['DATABASE_URL'] || 'postgres://localhost/descartes' -Sequel.connect(db) +dsn = ENV['DATABASE_URL'] || 'postgres://localhost/descartes' + +DB = Sequel.connect(dsn) +DB.extension :pagination $LOAD_PATH.unshift File.dirname(__FILE__) require 'graphs' @@ -15,7 +17,8 @@ require 'metrics' require 'users' -Sequel.extension :pagination +Sequel.extension :core_extensions + Sequel::Model.plugin :json_serializer Graph.plugin :json_serializer Dashboard.plugin :json_serializer diff --git a/lib/descartes/models/metrics.rb b/lib/descartes/models/metrics.rb index 0b95013..fd0bb37 100644 --- a/lib/descartes/models/metrics.rb +++ b/lib/descartes/models/metrics.rb @@ -27,7 +27,8 @@ def self.update request = RestClient::Resource.new("#{u.to_s}/metrics/index.json", :timeout => -1) response = request.get @@paths = JSON.parse(response) - MetricCacheStatus.update(:updated_at => Sequel.function(:NOW)) + + MetricCacheStatus.dataset.update(:updated_at => Sequel.function(:NOW)) end end