diff --git a/Gemfile b/Gemfile index 27e2a474e..100c010c8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'http://rubygems.org' -gem 'mysql2', '0.2.6' -gem 'pg' -#gem 'sqlite3' +gem 'mysql2', '0.2.6' if ENV['DB'].nil? || ENV['DB'] == "mysql" +gem 'pg' if ENV['DB'].nil? || ENV['DB'] == "postgres" +gem 'sqlite3' if ENV['DB'].nil? || ENV['DB'] == "sqlite" gem 'rails', '3.0.9' gem 'foreigner', '0.9.1' gem 'activerecord-import' @@ -56,6 +56,7 @@ gem 'redcarpet', :git => 'git://github.com/tanoku/redcarpet' #Websocket gem 'em-websocket', :git => 'git://github.com/igrigorik/em-websocket', :ref => 'e278f5a1c4db60be7485' +gem 'em-synchrony', :platforms => :ruby_19 #File uploading gem 'carrierwave', '0.5.2' @@ -87,30 +88,24 @@ group :development do gem 'capistrano', '2.5.19', :require => false gem 'capistrano-ext', '1.2.1', :require => false gem 'sod', :git => "git://github.com/MikeSofaer/sod.git", :require => false + gem 'ruby-debug-base19', '0.11.23' if RUBY_VERSION.include? '1.9.1' + gem 'ruby-debug19', :platforms => :ruby_19 + gem 'ruby-debug', :platforms => :mri_18 + gem 'linecache', '0.43', :platforms => :mri_18 end group :test, :development do #gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i #gem 'guard-rspec' - gem 'factory_girl_rails', :require => false - unless ENV["TRAVIS"] - gem 'ruby-debug-base19', '0.11.23' if RUBY_VERSION.include? '1.9.1' - gem 'ruby-debug19', :platforms => :ruby_19 - gem 'ruby-debug', :platforms => :mri_18 - gem 'linecache', '0.43', :platforms => :mri_18 - end - gem 'launchy' - gem 'jasmine', '1.1.0.rc3' end group :test do - gem 'mysql2', '0.2.6' - #gem 'pg' gem 'factory_girl_rails' gem 'fixture_builder', '0.2.2' gem 'selenium-webdriver', '2.4' gem 'capybara', '~> 0.3.9' gem 'cucumber-rails', '0.3.2' + gem 'jasmine', '1.1.0.rc3' gem 'rspec', '>= 2.0.0' gem 'rspec-core', '2.6.0' gem 'rspec-rails', '>= 2.0.0' @@ -118,7 +113,6 @@ group :test do gem 'database_cleaner', '0.6.0' gem 'webmock', :require => false gem 'mongrel', :require => false, :platforms => :ruby_18 - gem 'sqlite3', :require => false gem 'rspec-instafail', '>= 0.1.7', :require => false gem 'fuubar' diff --git a/Gemfile.lock b/Gemfile.lock index e80ffe3f6..6cf7ee5ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -169,6 +169,8 @@ GEM devise (~> 1.3.1) rails (<= 3.2, >= 3.0.0) diff-lcs (1.1.2) + em-synchrony (0.2.0) + eventmachine (>= 0.12.9) erubis (2.6.6) abstract (>= 1.0.0) eventmachine (0.12.10) @@ -238,7 +240,6 @@ GEM json_pure (1.5.3) jwt (0.1.3) json (>= 1.2.4) - launchy (2.0.3) linecache (0.43) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) @@ -476,6 +477,7 @@ DEPENDENCIES devise (~> 1.3.1) devise_invitable (= 0.5.0) diaspora-client! + em-synchrony em-websocket! excon (= 0.2.4) factory_girl_rails @@ -495,7 +497,6 @@ DEPENDENCIES jasmine (= 1.1.0.rc3) json (= 1.4.6) jwt (= 0.1.3) - launchy linecache (= 0.43) mini_magick (= 3.2) mongrel diff --git a/config/ci/before-travis.sh b/config/ci/before-travis.sh index d73e41be9..2ec0681fe 100755 --- a/config/ci/before-travis.sh +++ b/config/ci/before-travis.sh @@ -1,11 +1,3 @@ -# Remove Gemfile.lock and rebundle if we're on Ruby 1.9 -ruby -e "system('rm Gemfile.lock') if RUBY_VERSION.include?('1.9')" -ruby -e "system('bundle install --without development production') if RUBY_VERSION.include?('1.9')" - -# Create a database.yml for the right database -cp config/database.yml.example config/database.yml -ruby -e "system('cp config/ci/database.yml.postgresql config/database.yml') if ENV['DB'] == 'postgres'" - # adjust GC settings for REE export RUBY_HEAP_MIN_SLOTS=1000000 export RUBY_HEAP_SLOTS_INCREMENT=1000000 @@ -13,14 +5,27 @@ export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 export RUBY_GC_MALLOC_LIMIT=1000000000 export RUBY_HEAP_FREE_MIN=500000 -# Install firefox and start xvfb in preparation for cucumber & jasmine -sudo aptitude -q2 -y install firefox +# Install firefox +echo "Installing Firefox" +sudo aptitude -q3 -y install firefox + +# Start xvfb in preparation for cucumber & jasmine +echo "Starting Xvfb" sudo cp config/ci/xvfb /etc/init.d/xvfb sh -e /etc/init.d/xvfb start # Regenerate css files -sass --update public/stylesheets/sass/:public/stylesheets/ +echo "Regenerate CSS files" +bundle exec sass -q --update public/stylesheets/sass/:public/stylesheets/ + +# Create a database.yml for the right database +echo "Setting up database.yml for $DB" +cp config/database.yml.example config/database.yml +if [ "$DB" = "postgres" ]; then + sed 's/<<: *mysql/<<: *postgres/' config/database.yml > config/database.yml +fi # Set up database +echo "Creating databases for $DB and loading schema" bundle exec rake db:create bundle exec rake db:schema:load diff --git a/config/ci/database.yml.postgresql b/config/ci/database.yml.postgresql deleted file mode 100644 index 552e260e2..000000000 --- a/config/ci/database.yml.postgresql +++ /dev/null @@ -1,20 +0,0 @@ -common: &common - ejabbdb: ejabberd - encoding: unicode - adapter: postgresql - username: postgres - password: - port: 5432 - host: localhost - -development: - <<: *common - database: diaspora_development - -production: - <<: *common - database: diaspora_production - -test: - <<: *common - database: "diaspora_test" diff --git a/config/database.yml.example b/config/database.yml.example index 1c26808d9..38798760c 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -1,13 +1,27 @@ -common: &common +mysql: &mysql adapter: mysql2 - host: "localhost" + host: "localhost" port: 3306 -# socket: /tmp/mysql.sock username: "root" password: "" +# socket: /tmp/mysql.sock charset: utf8 collation: utf8_bin +postgres: &postgres + adapter: postgresql + host: localhost + port: 5432 + username: postgres + password: + encoding: unicode + + +common: &common + # Choose one of the following + <<: *mysql + #<<: *postgres + development: <<: *common