From cf52671feb11238e860a97ff797e521830d47553 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 12 Oct 2015 17:26:20 +1100 Subject: [PATCH] stop vendoring rails multisite --- Gemfile | 4 +- Gemfile.lock | 8 +- vendor/gems/rails_multisite/.gitignore | 17 -- vendor/gems/rails_multisite/Gemfile | 14 -- vendor/gems/rails_multisite/Guardfile | 9 - vendor/gems/rails_multisite/LICENSE | 22 -- vendor/gems/rails_multisite/README.md | 29 --- vendor/gems/rails_multisite/Rakefile | 7 - .../rails_multisite/lib/rails_multisite.rb | 3 - .../rails_multisite/connection_management.rb | 190 ------------------ .../lib/rails_multisite/railtie.rb | 23 --- .../lib/rails_multisite/version.rb | 3 - vendor/gems/rails_multisite/lib/tasks/db.rake | 31 --- .../rails_multisite/lib/tasks/generators.rake | 26 --- .../rails_multisite/rails_multisite.gemspec | 20 -- .../spec/connection_management_rack_spec.rb | 47 ----- .../spec/connection_management_spec.rb | 99 --------- .../spec/fixtures/database.yml | 6 - .../rails_multisite/spec/fixtures/two_dbs.yml | 6 - .../gems/rails_multisite/spec/spec_helper.rb | 38 ---- 20 files changed, 5 insertions(+), 597 deletions(-) delete mode 100644 vendor/gems/rails_multisite/.gitignore delete mode 100644 vendor/gems/rails_multisite/Gemfile delete mode 100644 vendor/gems/rails_multisite/Guardfile delete mode 100644 vendor/gems/rails_multisite/LICENSE delete mode 100644 vendor/gems/rails_multisite/README.md delete mode 100755 vendor/gems/rails_multisite/Rakefile delete mode 100644 vendor/gems/rails_multisite/lib/rails_multisite.rb delete mode 100644 vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb delete mode 100644 vendor/gems/rails_multisite/lib/rails_multisite/railtie.rb delete mode 100644 vendor/gems/rails_multisite/lib/rails_multisite/version.rb delete mode 100644 vendor/gems/rails_multisite/lib/tasks/db.rake delete mode 100644 vendor/gems/rails_multisite/lib/tasks/generators.rake delete mode 100644 vendor/gems/rails_multisite/rails_multisite.gemspec delete mode 100644 vendor/gems/rails_multisite/spec/connection_management_rack_spec.rb delete mode 100644 vendor/gems/rails_multisite/spec/connection_management_spec.rb delete mode 100644 vendor/gems/rails_multisite/spec/fixtures/database.yml delete mode 100644 vendor/gems/rails_multisite/spec/fixtures/two_dbs.yml delete mode 100644 vendor/gems/rails_multisite/spec/spec_helper.rb diff --git a/Gemfile b/Gemfile index 342b6be42..0d6a4a392 100644 --- a/Gemfile +++ b/Gemfile @@ -35,7 +35,9 @@ gem 'barber' gem 'babel-transpiler' gem 'message_bus' -gem 'rails_multisite', path: 'vendor/gems/rails_multisite' + +# temporary while getting ownership of rails_multisite gem +gem 'rails_multisite_discourse', require: 'rails_multisite' gem 'fast_xs' diff --git a/Gemfile.lock b/Gemfile.lock index d96defd9c..e30c6f9ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,3 @@ -PATH - remote: vendor/gems/rails_multisite - specs: - rails_multisite (0.0.1) - GEM remote: https://rubygems.org/ specs: @@ -304,6 +299,7 @@ GEM loofah (~> 2.0) rails-observers (0.1.2) activemodel (~> 4.0) + rails_multisite_discourse (1.0.0) railties (4.2.4) actionpack (= 4.2.4) activesupport (= 4.2.4) @@ -504,7 +500,7 @@ DEPENDENCIES rack-protection rails (~> 4.2) rails-observers - rails_multisite! + rails_multisite_discourse rake rb-fsevent rb-inotify (~> 0.9) diff --git a/vendor/gems/rails_multisite/.gitignore b/vendor/gems/rails_multisite/.gitignore deleted file mode 100644 index d87d4be66..000000000 --- a/vendor/gems/rails_multisite/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -*.gem -*.rbc -.bundle -.config -.yardoc -Gemfile.lock -InstalledFiles -_yardoc -coverage -doc/ -lib/bundler/man -pkg -rdoc -spec/reports -test/tmp -test/version_tmp -tmp diff --git a/vendor/gems/rails_multisite/Gemfile b/vendor/gems/rails_multisite/Gemfile deleted file mode 100644 index e80aa6027..000000000 --- a/vendor/gems/rails_multisite/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source 'https://rubygems.org' - -group :test do - gem 'rails' - gem 'rspec' - gem 'activerecord' - gem 'sqlite3' -end - -gem 'guard' -gem 'guard-rspec' - -# Specify your gem's dependencies in rails_multisite.gemspec -gemspec diff --git a/vendor/gems/rails_multisite/Guardfile b/vendor/gems/rails_multisite/Guardfile deleted file mode 100644 index 8645c9b94..000000000 --- a/vendor/gems/rails_multisite/Guardfile +++ /dev/null @@ -1,9 +0,0 @@ -# A sample Guardfile -# More info at https://github.com/guard/guard#readme - -guard :rspec do - watch(%r{^spec/.+_spec\.rb$}) - watch(%r{^lib/rails_multisite/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } - watch('spec/spec_helper.rb') { "spec" } -end - diff --git a/vendor/gems/rails_multisite/LICENSE b/vendor/gems/rails_multisite/LICENSE deleted file mode 100644 index f3d7f653b..000000000 --- a/vendor/gems/rails_multisite/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Sam Saffron - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/gems/rails_multisite/README.md b/vendor/gems/rails_multisite/README.md deleted file mode 100644 index d7121ffb7..000000000 --- a/vendor/gems/rails_multisite/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# RailsMultisite - -TODO: Write a gem description - -## Installation - -Add this line to your application's Gemfile: - - gem 'rails_multisite' - -And then execute: - - $ bundle - -Or install it yourself as: - - $ gem install rails_multisite - -## Usage - -TODO: Write usage instructions here - -## Contributing - -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Added some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request diff --git a/vendor/gems/rails_multisite/Rakefile b/vendor/gems/rails_multisite/Rakefile deleted file mode 100755 index 56bb7292a..000000000 --- a/vendor/gems/rails_multisite/Rakefile +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env rake -require "bundler/gem_tasks" -require "rspec/core/rake_task" - -RSpec::Core::RakeTask.new(:test) do |spec| - spec.pattern = 'spec/*_spec.rb' -end diff --git a/vendor/gems/rails_multisite/lib/rails_multisite.rb b/vendor/gems/rails_multisite/lib/rails_multisite.rb deleted file mode 100644 index 3b89d3351..000000000 --- a/vendor/gems/rails_multisite/lib/rails_multisite.rb +++ /dev/null @@ -1,3 +0,0 @@ -require "rails_multisite/version" -require "rails_multisite/railtie" -require "rails_multisite/connection_management" diff --git a/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb b/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb deleted file mode 100644 index e5ef70c1b..000000000 --- a/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb +++ /dev/null @@ -1,190 +0,0 @@ -module RailsMultisite - class ConnectionManagement - CONFIG_FILE = 'config/multisite.yml' - DEFAULT = 'default'.freeze - - def self.has_db?(db) - return true if db == DEFAULT - (defined? @@db_spec_cache) && @@db_spec_cache && @@db_spec_cache[db] - end - - def self.rails4? - !!(Rails.version =~ /^4/) - end - - def self.establish_connection(opts) - if opts[:db] == DEFAULT && (!defined?(@@default_spec) || !@@default_spec) - # don't do anything .. handled implicitly - else - spec = connection_spec(opts) || @@default_spec - handler = nil - if spec != @@default_spec - handler = @@connection_handlers[spec] - unless handler - handler = ActiveRecord::ConnectionAdapters::ConnectionHandler.new - handler.establish_connection(ActiveRecord::Base, spec) - @@connection_handlers[spec] = handler - end - else - handler = @@default_connection_handler - if !@@established_default - handler.establish_connection(ActiveRecord::Base, spec) - @@established_default = true - end - end - - ActiveRecord::Base.connection_handler = handler - end - end - - def self.with_hostname(hostname) - - unless defined? @@db_spec_cache - # just fake it for non multisite - yield hostname - return - end - - old = current_hostname - connected = ActiveRecord::Base.connection_pool.connected? - - establish_connection(:host => hostname) unless connected && hostname == old - rval = yield hostname - - unless connected && hostname == old - ActiveRecord::Base.connection_handler.clear_active_connections! - - establish_connection(:host => old) - ActiveRecord::Base.connection_handler.clear_active_connections! unless connected - end - - rval - end - - def self.with_connection(db = "default") - old = current_db - connected = ActiveRecord::Base.connection_pool.connected? - - establish_connection(:db => db) unless connected && db == old - rval = yield db - - unless connected && db == old - ActiveRecord::Base.connection_handler.clear_active_connections! - - establish_connection(:db => old) - ActiveRecord::Base.connection_handler.clear_active_connections! unless connected - end - - rval - end - - def self.each_connection - old = current_db - connected = ActiveRecord::Base.connection_pool.connected? - all_dbs.each do |db| - establish_connection(:db => db) - yield db - ActiveRecord::Base.connection_handler.clear_active_connections! - end - establish_connection(:db => old) - ActiveRecord::Base.connection_handler.clear_active_connections! unless connected - end - - def self.all_dbs - ["default"] + - if defined?(@@db_spec_cache) && @@db_spec_cache - @@db_spec_cache.keys.to_a - else - [] - end - end - - def self.current_db - ActiveRecord::Base.connection_pool.spec.config[:db_key] || "default" - end - - def self.config_filename=(config_filename) - @@config_filename = config_filename - end - - def self.config_filename - @@config_filename ||= File.absolute_path(Rails.root.to_s + "/" + RailsMultisite::ConnectionManagement::CONFIG_FILE) - end - - def self.current_hostname - config = ActiveRecord::Base.connection_pool.spec.config - config[:host_names].nil? ? config[:host] : config[:host_names].first - end - - def self.clear_settings! - @@db_spec_cache = nil - @@host_spec_cache = nil - @@default_spec = nil - end - - def self.load_settings! - spec_klass = ActiveRecord::ConnectionAdapters::ConnectionSpecification - configs = YAML::load(File.open(self.config_filename)) - configs.each do |k,v| - raise ArgumentError.new("Please do not name any db default!") if k == "default" - v[:db_key] = k - end - - @@db_spec_cache = Hash[*configs.map do |k, data| - [k, spec_klass::Resolver.new(configs).spec(k)] - end.flatten] - - @@host_spec_cache = {} - configs.each do |k,v| - next unless v["host_names"] - v["host_names"].each do |host| - @@host_spec_cache[host] = @@db_spec_cache[k] - end - end - - @@default_spec = spec_klass::Resolver.new(ActiveRecord::Base.configurations).spec(Rails.env) - ActiveRecord::Base.configurations[Rails.env]["host_names"].each do |host| - @@host_spec_cache[host] = @@default_spec - end - - @@default_connection_handler = ActiveRecord::Base.connection_handler - - @@connection_handlers = {} - @@established_default = false - end - - - def initialize(app, config = nil) - @app = app - end - - def self.host(env) - request = Rack::Request.new(env) - request['__ws'] || request.host - end - - def call(env) - host = self.class.host(env) - begin - - #TODO: add a callback so users can simply go to a domain to register it, or something - return [404, {}, ["not found"]] unless @@host_spec_cache[host] - - ActiveRecord::Base.connection_handler.clear_active_connections! - self.class.establish_connection(:host => host) - @app.call(env) - ensure - ActiveRecord::Base.connection_handler.clear_active_connections! - end - end - - def self.connection_spec(opts) - if opts[:host] - @@host_spec_cache[opts[:host]] - else - @@db_spec_cache[opts[:db]] - end - end - - end -end diff --git a/vendor/gems/rails_multisite/lib/rails_multisite/railtie.rb b/vendor/gems/rails_multisite/lib/rails_multisite/railtie.rb deleted file mode 100644 index 68c8c71e5..000000000 --- a/vendor/gems/rails_multisite/lib/rails_multisite/railtie.rb +++ /dev/null @@ -1,23 +0,0 @@ -module RailsMultisite - class Railtie < Rails::Railtie - rake_tasks do - Dir[File.join(File.dirname(__FILE__),'../tasks/*.rake')].each { |f| load f } - end - - initializer "RailsMultisite.init" do |app| - Rails.configuration.multisite = false - if File.exists?(ConnectionManagement.config_filename) - Rails.configuration.multisite = true - ConnectionManagement.load_settings! - app.middleware.insert_after(ActiveRecord::ConnectionAdapters::ConnectionManagement, RailsMultisite::ConnectionManagement) - app.middleware.delete(ActiveRecord::ConnectionAdapters::ConnectionManagement) - if ENV['RAILS_DB'] - ConnectionManagement.establish_connection(:db => ENV['RAILS_DB']) - end - end - end - - - end -end - diff --git a/vendor/gems/rails_multisite/lib/rails_multisite/version.rb b/vendor/gems/rails_multisite/lib/rails_multisite/version.rb deleted file mode 100644 index 41ecff992..000000000 --- a/vendor/gems/rails_multisite/lib/rails_multisite/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module RailsMultisite - VERSION = "0.0.1" -end diff --git a/vendor/gems/rails_multisite/lib/tasks/db.rake b/vendor/gems/rails_multisite/lib/tasks/db.rake deleted file mode 100644 index 587ffcea2..000000000 --- a/vendor/gems/rails_multisite/lib/tasks/db.rake +++ /dev/null @@ -1,31 +0,0 @@ -desc "migrate all sites in tier" -task "multisite:migrate" => :environment do - RailsMultisite::ConnectionManagement.each_connection do |db| - puts "Migrating #{db}" - puts "---------------------------------\n" - t = Rake::Task["db:migrate"] - t.reenable - t.invoke - end -end - -task "multisite:seed_fu" => :environment do - RailsMultisite::ConnectionManagement.each_connection do |db| - puts "Seeding #{db}" - puts "---------------------------------\n" - t = Rake::Task["db:seed_fu"] - t.reenable - t.invoke - end -end - -desc "rollback migrations for all sites in tier" -task "multisite:rollback" => :environment do - RailsMultisite::ConnectionManagement.each_connection do |db| - puts "Rollback #{db}" - puts "---------------------------------\n" - t = Rake::Task["db:rollback"] - t.reenable - t.invoke - end -end diff --git a/vendor/gems/rails_multisite/lib/tasks/generators.rake b/vendor/gems/rails_multisite/lib/tasks/generators.rake deleted file mode 100644 index 2e019185d..000000000 --- a/vendor/gems/rails_multisite/lib/tasks/generators.rake +++ /dev/null @@ -1,26 +0,0 @@ -desc "generate multisite config file (if missing)" -task "multisite:generate:config" => :environment do - filename = RailsMultisite::ConnectionManagement.config_filename - - if File.exists?(filename) - puts "Config is already generated at #{RailsMultisite::ConnectionManagement::CONFIG_FILE}" - else - puts "Generated config file at #{RailsMultisite::ConnectionManagement::CONFIG_FILE}" - File.open(filename, 'w') do |f| - f.write <<-CONFIG -# site_name: -# adapter: postgresql -# database: db_name -# host: localhost -# pool: 5 -# timeout: 5000 -# db_id: 1 # optionally include other settings you need -# host_names: -# - www.mysite.com -# - www.anothersite.com -CONFIG - - end - - end -end diff --git a/vendor/gems/rails_multisite/rails_multisite.gemspec b/vendor/gems/rails_multisite/rails_multisite.gemspec deleted file mode 100644 index 5fb0b4913..000000000 --- a/vendor/gems/rails_multisite/rails_multisite.gemspec +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding: utf-8 -*- -require File.expand_path('../lib/rails_multisite/version', __FILE__) - -Gem::Specification.new do |gem| - gem.authors = ["Sam Saffron"] - gem.email = ["sam.saffron@gmail.com"] - gem.description = %q{Multi tenancy support for Rails} - gem.summary = %q{Multi tenancy support for Rails} - gem.homepage = "" - - # when this is extracted comment it back in, prd has no .git - # gem.files = `git ls-files`.split($\) - gem.files = Dir['README*','LICENSE','lib/**/*.rb'] - - gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) - gem.name = "rails_multisite" - gem.require_paths = ["lib"] - gem.version = RailsMultisite::VERSION -end diff --git a/vendor/gems/rails_multisite/spec/connection_management_rack_spec.rb b/vendor/gems/rails_multisite/spec/connection_management_rack_spec.rb deleted file mode 100644 index f683a3d47..000000000 --- a/vendor/gems/rails_multisite/spec/connection_management_rack_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'spec_helper' -require 'rails_multisite' -require 'rack/test' - -describe RailsMultisite::ConnectionManagement do - include Rack::Test::Methods - - def app - - RailsMultisite::ConnectionManagement.config_filename = 'spec/fixtures/two_dbs.yml' - RailsMultisite::ConnectionManagement.load_settings! - - @app ||= Rack::Builder.new { - use RailsMultisite::ConnectionManagement - map '/html' do - run lambda { |env| [200, {'Content-Type' => 'text/html'}, "

Hi

\n \t"] } - end - }.to_app - end - - after do - RailsMultisite::ConnectionManagement.clear_settings! - end - - describe 'with a valid request' do - - before do - end - - it 'returns 200 for valid site' do - get 'http://second.localhost/html' - last_response.should be_ok - end - - it 'returns 200 for valid main site' do - get 'http://default.localhost/html' - last_response.should be_ok - end - - it 'returns 404 for invalid site' do - get '/html' - last_response.should be_not_found - end - end - -end - diff --git a/vendor/gems/rails_multisite/spec/connection_management_spec.rb b/vendor/gems/rails_multisite/spec/connection_management_spec.rb deleted file mode 100644 index a1a17959f..000000000 --- a/vendor/gems/rails_multisite/spec/connection_management_spec.rb +++ /dev/null @@ -1,99 +0,0 @@ -require 'spec_helper' -require 'rails_multisite' - -class Person < ActiveRecord::Base; end - -describe RailsMultisite::ConnectionManagement do - - subject { RailsMultisite::ConnectionManagement } - - def with_connection(db) - subject.establish_connection(db: db) - yield ActiveRecord::Base.connection.raw_connection - ensure - ActiveRecord::Base.connection_handler.clear_active_connections! - end - - context 'default' do - its(:all_dbs) { should == ['default']} - - context 'current' do - before do - subject.establish_connection(db: 'default') - ActiveRecord::Base.establish_connection - end - - its(:current_db) { should == 'default' } - its(:current_hostname) { should == 'default.localhost' } - end - - end - - context 'two dbs' do - - before do - subject.config_filename = "spec/fixtures/two_dbs.yml" - subject.load_settings! - end - - its(:all_dbs) { should == ['default', 'second']} - - context 'second db' do - before do - subject.establish_connection(db: 'second') - end - - its(:current_db) { should == 'second' } - its(:current_hostname) { should == "second.localhost" } - end - - context 'data partitioning' do - after do - ['default','second'].each do |db| - with_connection(db) do |cnn| - cnn.execute("drop table people") rescue nil - end - end - end - - it 'partitions data correctly' do - col1 = [] - col2 = [] - - ['default','second'].map do |db| - - with_connection(db) do |cnn| - cnn.execute("create table if not exists people(id INTEGER PRIMARY KEY AUTOINCREMENT, db)") - end - end - - SQLite3::Database.query_log.clear - - 5.times do - ['default','second'].map do |db| - Thread.new do - with_connection(db) do |cnn| - Person.create!(db: db) - end - end - end.map(&:join) - end - - lists = [] - ['default', 'second'].each do |db| - with_connection(db) do |cnn| - lists << Person.order(:id).to_a.map{|p| [p.id, p.db]} - end - end - - lists[1].should == (1..5).map{|id| [id, "second"]} - lists[0].should == (1..5).map{|id| [id, "default"]} - - # puts SQLite3::Database.query_log.map{|args, caller, oid| "#{oid} #{args.join.inspect}"}.join("\n") - - end - end - - end - -end diff --git a/vendor/gems/rails_multisite/spec/fixtures/database.yml b/vendor/gems/rails_multisite/spec/fixtures/database.yml deleted file mode 100644 index f1ad38f54..000000000 --- a/vendor/gems/rails_multisite/spec/fixtures/database.yml +++ /dev/null @@ -1,6 +0,0 @@ -test: - adapter: sqlite3 - database: "tmp/db.test" - timeout: 5000 - host_names: - - default.localhost diff --git a/vendor/gems/rails_multisite/spec/fixtures/two_dbs.yml b/vendor/gems/rails_multisite/spec/fixtures/two_dbs.yml deleted file mode 100644 index d4485f75a..000000000 --- a/vendor/gems/rails_multisite/spec/fixtures/two_dbs.yml +++ /dev/null @@ -1,6 +0,0 @@ -second: - adapter: sqlite3 - database: "tmp/db1.test" - host_names: - - second.localhost - - 2nd.localhost diff --git a/vendor/gems/rails_multisite/spec/spec_helper.rb b/vendor/gems/rails_multisite/spec/spec_helper.rb deleted file mode 100644 index 0668f45c2..000000000 --- a/vendor/gems/rails_multisite/spec/spec_helper.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'rubygems' -require 'rails' -require 'active_record' - - -ENV["RAILS_ENV"] ||= 'test' -RSpec.configure do |config| - - require 'sqlite3' - class SQLite3::Database - def self.query_log - @@query_log ||= [] - end - - alias_method :old_execute, :execute - alias_method :old_prepare, :prepare - - def execute(*args,&blk) - self.class.query_log << [args, caller, Thread.current.object_id] - old_execute(*args,&blk) - end - - def prepare(*args,&blk) - self.class.query_log << [args, caller, Thread.current.object_id] - old_prepare(*args,&blk) - end - - end - - config.color_enabled = true - - config.before(:suite) do - ActiveRecord::Base.configurations['test'] = (YAML::load(File.open("spec/fixtures/database.yml"))['test']) - end - -end - -